summaryrefslogtreecommitdiff
path: root/gnu/java/net/protocol
diff options
context:
space:
mode:
authorWolfgang Baer <WBaer@gmx.de>2006-02-09 09:23:38 +0000
committerWolfgang Baer <WBaer@gmx.de>2006-02-09 09:23:38 +0000
commitf278169dbae312d08e804a532664a812130b9b54 (patch)
tree69f8465d0a752c9594c18b4a5e311cec5ad37103 /gnu/java/net/protocol
parentb7daaeb77216e050f1a19c99c9daa7775535dae3 (diff)
downloadclasspath-f278169dbae312d08e804a532664a812130b9b54.tar.gz
2006-02-09 Wolfgang Baer <WBaer@gmx.de>
* gnu/java/net/protocol/http/Request.java: (Request): Remove initialization of removed field. (requestBodyNegotiationThreshold): Removed now unused field. (setRequestBodyNegotiationThreshold): Remove now unused method. (dispatch): Do not use 'Expect 100-continue' header if content-length is over a treshold. If user specified 'Expect 100-continue' still initialize the expectingContinue variable.
Diffstat (limited to 'gnu/java/net/protocol')
-rw-r--r--gnu/java/net/protocol/http/Request.java27
1 files changed, 3 insertions, 24 deletions
diff --git a/gnu/java/net/protocol/http/Request.java b/gnu/java/net/protocol/http/Request.java
index d70dd0c9d..ea18b7d42 100644
--- a/gnu/java/net/protocol/http/Request.java
+++ b/gnu/java/net/protocol/http/Request.java
@@ -1,5 +1,5 @@
/* Request.java --
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -94,11 +94,6 @@ public class Request
protected RequestBodyWriter requestBodyWriter;
/**
- * Request body negotiation threshold for 100-continue expectations.
- */
- protected int requestBodyNegotiationThreshold;
-
- /**
* Map of response header handlers.
*/
protected Map responseHeaderHandlers;
@@ -127,7 +122,6 @@ public class Request
this.path = path;
requestHeaders = new Headers();
responseHeaderHandlers = new HashMap();
- requestBodyNegotiationThreshold = 4096;
}
/**
@@ -251,21 +245,6 @@ public class Request
}
/**
- * Sets the request body negotiation threshold.
- * If this is set, it determines the maximum size that the request body
- * may be before body negotiation occurs(via the
- * <code>100-continue</code> expectation). This ensures that a large
- * request body is not sent when the server wouldn't have accepted it
- * anyway.
- * @param threshold the body negotiation threshold, or &lt;=0 to disable
- * request body negotation entirely
- */
- public void setRequestBodyNegotiationThreshold(int threshold)
- {
- requestBodyNegotiationThreshold = threshold;
- }
-
- /**
* Dispatches this request.
* A request can only be dispatched once; calling this method a second
* time results in a protocol exception.
@@ -291,10 +270,10 @@ public class Request
if (requestBodyWriter != null)
{
contentLength = requestBodyWriter.getContentLength();
- if (contentLength > requestBodyNegotiationThreshold)
+ String expect = getHeader("Expect");
+ if (expect != null && expect.equals("100-continue"))
{
expectingContinue = true;
- setHeader("Expect", "100-continue");
}
else
{