You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by je...@apache.org on 2002/04/25 22:09:45 UTC
cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods PutMethod.java
jericho 02/04/25 13:09:45
Modified: httpclient/src/java/org/apache/commons/httpclient/methods
PutMethod.java
Log:
- Don't make any reading and writing to the input and output stream the current connection.
(It make the web-server hang or conflict after that)
- Bug reported by Elodie Tasia <e.tasia at ever-team.com>
Revision Changes Path
1.9 +5 -5 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.java
Index: PutMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- PutMethod.java 5 Jan 2002 11:16:01 -0000 1.8
+++ PutMethod.java 25 Apr 2002 20:09:45 -0000 1.9
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.java,v 1.8 2002/01/05 11:16:01 vmassol Exp $
- * $Revision: 1.8 $
- * $Date: 2002/01/05 11:16:01 $
+ * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.java,v 1.9 2002/04/25 20:09:45 jericho Exp $
+ * $Revision: 1.9 $
+ * $Date: 2002/04/25 20:09:45 $
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -222,7 +222,7 @@
OutputStream out = conn.getRequestOutputStream((isHttp11() && (null == getRequestHeader("Content-Length"))));
InputStream inputStream = null;
- if (file != null) {
+ if (file != null && file.exists()) {
inputStream = new FileInputStream(file);
} else if (url != null) {
inputStream = url.openConnection().getInputStream();
@@ -253,7 +253,7 @@
protected int getRequestContentLength() {
if(null != data) {
return data.length;
- } else if(null != file) {
+ } else if(null != file && file.exists()) {
return (int)(file.length());
} else if(url != null) {
return -1;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>