diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-05-20 14:33:04 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-05-20 23:06:45 +0200 |
commit | b0143a2a33f0e577b1c2c9a407ac081418b5ea6b (patch) | |
tree | ef8d61a23c8829f6cc28ecc8014753b35cc6b28e /lib/telnet.c | |
parent | 6a688976f07576ca8209dbe29fe2e93e2b41db8c (diff) | |
download | curl-b0143a2a33f0e577b1c2c9a407ac081418b5ea6b.tar.gz |
read_callback: move to SessionHandle from connectdata
With many easy handles using the same connection for multiplexing, it is
important we store and keep the transfer-oriented stuff in the
SessionHandle so that callbacks and callback data work fine even when
many easy handles share the same physical connection.
Diffstat (limited to 'lib/telnet.c')
-rw-r--r-- | lib/telnet.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/telnet.c b/lib/telnet.c index 91863c065..4ea049d21 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1423,7 +1423,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) for(;;) { if(data->set.is_fread_set) { /* read from user-supplied method */ - result = (int) conn->fread_func(buf, 1, BUFSIZE - 1, conn->fread_in); + result = (int) conn->fread_func(buf, 1, BUFSIZE - 1, data->set.in); if(result == CURL_READFUNC_ABORT) { keepon = FALSE; result = CURLE_READ_ERROR; @@ -1562,13 +1562,13 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) pfd[0].fd = sockfd; pfd[0].events = POLLIN; - if(conn->fread_func != (curl_read_callback)fread) { + if(data->set.fread_func != (curl_read_callback)fread) { poll_cnt = 1; interval_ms = 100; /* poll user-supplied read function */ } else { /* really using fread, so infile is a FILE* */ - pfd[1].fd = fileno((FILE *)conn->fread_in); + pfd[1].fd = fileno((FILE *)data->set.in); pfd[1].events = POLLIN; poll_cnt = 2; interval_ms = 1 * 1000; @@ -1627,7 +1627,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) } else { /* read from user-supplied method */ - nread = (int)conn->fread_func(buf, 1, BUFSIZE - 1, conn->fread_in); + nread = (int)data->set.fread_func(buf, 1, BUFSIZE - 1, data->set.in); if(nread == CURL_READFUNC_ABORT) { keepon = FALSE; break; |