You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ms...@apache.org on 2002/02/11 06:54:34 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/methods PutMethod.java
msmith 02/02/10 21:54:34
Modified: src/webdav/client/src/org/apache/commons/httpclient/methods
PutMethod.java
Log:
Don't ever write a 0-length chunk. A 0 length chunk means "end of content",
but we then add another 0 length chunk on close() - because then we actually
want to end the body. The 2nd chunk is then interpreted by the server as
part of the next request, since we don't close the connection between
requests. Tomcat's request line checking isn't nearly as stringent as it
could (should?) be, so the next request looks to tomcat like:
0
LOCK ....
This is now fixed.
Revision Changes Path
1.4 +5 -4 jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/methods/PutMethod.java
Index: PutMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/methods/PutMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PutMethod.java 16 Aug 2001 17:22:27 -0000 1.3
+++ PutMethod.java 11 Feb 2002 05:54:34 -0000 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/methods/PutMethod.java,v 1.3 2001/08/16 17:22:27 juergen Exp $
- * $Revision: 1.3 $
- * $Date: 2001/08/16 17:22:27 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/methods/PutMethod.java,v 1.4 2002/02/11 05:54:34 msmith Exp $
+ * $Revision: 1.4 $
+ * $Date: 2002/02/11 05:54:34 $
*
* ====================================================================
*
@@ -236,7 +236,8 @@
InputStream inputStream = null;
if (data != null) {
- out.write(data,0,data.length);
+ if(data.length > 0)
+ out.write(data,0,data.length);
return;
} else if (file != null) {
inputStream = new FileInputStream(file);
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>