commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeri...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods PutMethod.java
Date Thu, 25 Apr 2002 20:09:45 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message