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 re...@apache.org on 2001/01/11 02:17:39 UTC

cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib WebdavClient.java

remm        01/01/10 17:17:39

  Modified:    src/webdav/client/src/org/apache/webdav/lib
                        WebdavClient.java
  Log:
  - Parsing of the status line should be a bit more robust.
  
  Revision  Changes    Path
  1.16      +12 -5     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java
  
  Index: WebdavClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WebdavClient.java	2000/12/19 03:17:45	1.15
  +++ WebdavClient.java	2001/01/11 01:17:39	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v 1.15 2000/12/19 03:17:45 remm Exp $
  - * $Revision: 1.15 $
  - * $Date: 2000/12/19 03:17:45 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v 1.16 2001/01/11 01:17:39 remm Exp $
  + * $Revision: 1.16 $
  + * $Date: 2001/01/11 01:17:39 $
    *
    * ====================================================================
    *
  @@ -232,7 +232,10 @@
                   // Parsing response
                   
                   // Parse status line
  -                parseStatusLine(readLine(input), method);
  +                String statusLine = readLine(input);
  +                if (statusLine == null)
  +                    throw new IOException("Couldn't parse status line");
  +                parseStatusLine(statusLine, method);
                   
                   // Parse headers
                   responseHeaders = parseHeaders(input);
  @@ -299,6 +302,8 @@
                   }
                   
               } catch (IOException e) {
  +                if (debug > 1)
  +                    e.printStackTrace();
                   // If something goes wrong, disconnect, then reconnect
                   try {
                       closeConnection();
  @@ -307,6 +312,8 @@
                   }
                   openConnection();
               } catch (WebdavException e) {
  +                if (debug > 1)
  +                    e.printStackTrace();
                   // If something goes wrong, disconnect, then reconnect
                   try {
                       closeConnection();
  @@ -550,7 +557,7 @@
   	    int ch = input.read();
   	    if (ch < 0) {
   		if (sb.length() == 0) {
  -		    return ("");
  +		    return (null);
   		} else {
   		    break;
   		}