]> granicus.if.org Git - curl/commitdiff
fixed up the telnet to work (using support from Linus Nielsen)
authorDaniel Stenberg <daniel@haxx.se>
Wed, 31 Jan 2001 15:05:44 +0000 (15:05 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 31 Jan 2001 15:05:44 +0000 (15:05 +0000)
lib/telnet.c
lib/transfer.c

index 201bd6b50d8d394a8a9581ec02a49d99b9b3bbb8..cda76d446900991f3871ebf0f5b00c7e986f1aa0 100644 (file)
@@ -872,20 +872,22 @@ CURLcode Curl_telnet(struct connectdata *conn)
         }
       }
 
-      if(FD_ISSET(sockfd, &readfd))
+      if(FD_ISSET(sockfd, &readfd)) {
         Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread);
 
-      /* if we receive 0 or less here, the server closed the connection and
-         we bail out from this! */
-      if (nread <= 0) {
-        keepon = FALSE;
-        break;
-      }
+        /* if we receive 0 or less here, the server closed the connection and
+           we bail out from this! */
+        if (nread <= 0) {
+          keepon = FALSE;
+          break;
+        }
 
-      telrcv(data, (unsigned char *)buf, nread);
+        telrcv(data, (unsigned char *)buf, nread);
+      }
     }
   }
-  return CURLE_OK;
+  /* mark this as "no further transfer wanted" */
+  return Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 }
 
 
index 09c1262cb97492c096aaaf8c6d3e002c8eb90dbe..92b56600ceb6df57fdcc5833af2c78898622edac 100644 (file)
@@ -161,6 +161,12 @@ _Transfer(struct connectdata *c_conn)
   Curl_pgrsTime(data, TIMER_PRETRANSFER);
   Curl_speedinit(data);
 
+  if((conn->sockfd == -1) &&
+     (conn->writesockfd == -1)) {
+    /* nothing to read, nothing to write, we're already OK! */
+    return CURLE_OK;
+  }
+
   if (!conn->getheader) {
     header = FALSE;
     if(conn->size > 0)