Diff
Not logged in

Differences From:

File src/http.c part of check-in [6842999f82] - Sync client uses only HTTP/1.0 in order to avoid having to support chunked encoding. by drh on 2009-10-05 14:29:51. [view]

To:

File src/http.c part of check-in [0690aa18a4] - Better error messages when "sync" fails due to server problems. Ticket bfb8427cdd5 by drh on 2009-11-11 14:59:09. [view]

@@ -181,9 +181,14 @@
   iLength = -1;
   while( (zLine = transport_receive_line())!=0 && zLine[0]!=0 ){
     if( strncasecmp(zLine, "http/1.", 7)==0 ){
       if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
-      if( rc!=200 ) goto write_err;
+      if( rc!=200 ){
+        int ii;
+        for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){}
+        printf("ERROR. server says: %s\n", &zLine[ii]);
+        goto write_err;
+      }
       if( iHttpVersion==0 ){
         closeConnection = 1;
       }else{
         closeConnection = 0;
@@ -205,9 +210,12 @@
 
   /*
   ** Extract the reply payload that follows the header
   */
-  if( iLength<0 ) goto write_err;
+  if( iLength<0 ){
+    printf("ERROR.  Server did not reply\n");
+    goto write_err;
+  }
   blob_zero(pReply);
   blob_resize(pReply, iLength);
   iLength = transport_receive(blob_buffer(pReply), iLength);
   blob_resize(pReply, iLength);