summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-01-31 15:05:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-01-31 15:05:44 +0000
commita14aaaf23fa8202fe60f5d7ba29dfe842ab5f80d (patch)
tree550b7f75e3b5390b2e097437327b9980a083f7b1
parentc41c5a0ef236f1eb1a973eeb25f47e848c9e68db (diff)
downloadgnurl-a14aaaf23fa8202fe60f5d7ba29dfe842ab5f80d.tar.gz
gnurl-a14aaaf23fa8202fe60f5d7ba29dfe842ab5f80d.tar.bz2
gnurl-a14aaaf23fa8202fe60f5d7ba29dfe842ab5f80d.zip
fixed up the telnet to work (using support from Linus Nielsen)
-rw-r--r--lib/telnet.c20
-rw-r--r--lib/transfer.c6
2 files changed, 17 insertions, 9 deletions
diff --git a/lib/telnet.c b/lib/telnet.c
index 201bd6b50..cda76d446 100644
--- a/lib/telnet.c
+++ b/lib/telnet.c
@@ -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);
}
diff --git a/lib/transfer.c b/lib/transfer.c
index 09c1262cb..92b56600c 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -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)