diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-04-25 14:38:34 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-05-01 22:55:29 +0200 |
commit | e40e9d7f0decc799e3ccfe2c418632f8bb52031a (patch) | |
tree | 9099a157e632bd258e64af5373fac96298bce77e /lib/telnet.c | |
parent | c79f4908d461cecaa9976099dcbb8a63b351f19e (diff) | |
download | curl-e40e9d7f0decc799e3ccfe2c418632f8bb52031a.tar.gz |
buffer: use data->set.buffer_size instead of BUFSIZE
... to properly use the dynamically set buffer size!
Diffstat (limited to 'lib/telnet.c')
-rw-r--r-- | lib/telnet.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/telnet.c b/lib/telnet.c index 57d908c9c..dd93f3530 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1425,7 +1425,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) if(data->set.is_fread_set) { size_t n; /* read from user-supplied method */ - n = data->state.fread_func(buf, 1, BUFSIZE - 1, data->state.in); + n = data->state.fread_func(buf, 1, buf_size, data->state.in); if(n == CURL_READFUNC_ABORT) { keepon = FALSE; result = CURLE_READ_ERROR; @@ -1500,7 +1500,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) } if(events.lNetworkEvents & FD_READ) { /* read data from network */ - result = Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread); + result = Curl_read(conn, sockfd, buf, data->set.buffer_size, &nread); /* read would've blocked. Loop again */ if(result == CURLE_AGAIN) break; @@ -1589,7 +1589,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) default: /* read! */ if(pfd[0].revents & POLLIN) { /* read data from network */ - result = Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread); + result = Curl_read(conn, sockfd, buf, data->set.buffer_size, &nread); /* read would've blocked. Loop again */ if(result == CURLE_AGAIN) break; @@ -1625,12 +1625,12 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) nread = 0; if(poll_cnt == 2) { if(pfd[1].revents & POLLIN) { /* read from in file */ - nread = read(pfd[1].fd, buf, BUFSIZE - 1); + nread = read(pfd[1].fd, buf, data->set.buffer_size); } } else { /* read from user-supplied method */ - nread = (int)data->state.fread_func(buf, 1, BUFSIZE - 1, + nread = (int)data->state.fread_func(buf, 1, data->set.buffer_size, data->state.in); if(nread == CURL_READFUNC_ABORT) { keepon = FALSE; |