Diff
Not logged in

Differences From:

File src/http_transport.c part of check-in [a742cfa292] - Actually get the "file:" transport working this time. by drh on 2009-04-11 13:07:01. [view]

To:

File src/http_transport.c part of check-in [767ae79c3d] - There is some bug in the new HTTP transport layer. The easiest solution is to close the TCP connection after each round trip, which is what this check-in does. by drh on 2009-04-24 18:40:03. [view]

@@ -129,8 +129,9 @@
   }else{
     int sent;
     while( n>0 ){
       sent = socket_send(0, z, n);
+      /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
       if( sent<=0 ) break;
       n -= sent;
     }
   }
@@ -174,8 +175,9 @@
   onHand = transport.nUsed - transport.iCursor;
   if( onHand>0 ){
     int toMove = onHand;
     if( toMove>N ) toMove = N;
+    /* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */
     memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove);
     transport.iCursor += toMove;
     if( transport.iCursor>=transport.nUsed ){
       transport.nUsed = 0;
@@ -193,8 +195,9 @@
     }else if( g.urlIsFile ){
       got = fread(zBuf, 1, N, transport.pFile);
     }else{
       got = socket_receive(0, zBuf, N);
+      /* printf("received %d of %d bytes\n", got, N); fflush(stdout); */
     }
     if( got>0 ){
       nByte += got;
     }
@@ -271,6 +274,7 @@
       break;
     }
     i++;
   }
+  /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
   return &transport.pBuf[iStart];
 }