diff options
author | Brad King <brad.king@kitware.com> | 2023-01-31 14:13:15 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-01-31 09:13:24 -0500 |
commit | 1a5bc71c59c75e66e280b3f3f6bf1727b0e21c39 (patch) | |
tree | 53e9b7f3b2c51e2146500f550f51103df081ac6f /Utilities/cmcurl/lib/telnet.c | |
parent | 4dc058270d47316a7779e03ab8e60d75820a86f5 (diff) | |
parent | 8443dfa94663531c8481611cc35b807c1cea2c75 (diff) | |
download | cmake-1a5bc71c59c75e66e280b3f3f6bf1727b0e21c39.tar.gz |
Merge topic 'update-curl'
8443dfa946 curl: Work around missing OpenSSL symbol on machine with LCC 1.23
f9f5957884 Merge branch 'upstream-curl' into update-curl
dac458ddbf curl 2022-12-21 (c12fb3dd)
39dcf9469d curl: Update script to get curl 7.87.0
b2fe717a49 file: Avoid using deprecated curl progress callback
1cd38de47f ctest: Drop unnecessary use of deprecated CURLOPT_PUT
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8131
Diffstat (limited to 'Utilities/cmcurl/lib/telnet.c')
-rw-r--r-- | Utilities/cmcurl/lib/telnet.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Utilities/cmcurl/lib/telnet.c b/Utilities/cmcurl/lib/telnet.c index 923c7f82bd..22bc81e755 100644 --- a/Utilities/cmcurl/lib/telnet.c +++ b/Utilities/cmcurl/lib/telnet.c @@ -571,7 +571,7 @@ void rec_do(struct Curl_easy *data, int option) sendsuboption(data, option); } else if(tn->subnegotiation[option] == CURL_YES) { - /* send information to achieve this option*/ + /* send information to achieve this option */ tn->us[option] = CURL_YES; send_negotiation(data, CURL_WILL, option); sendsuboption(data, option); @@ -1200,7 +1200,7 @@ static CURLcode send_telnet_data(struct Curl_easy *data, j = 0; for(i = 0; i < nread; i++) { - outbuf[j++] = buffer[i]; + outbuf[j++] = (unsigned char)buffer[i]; if((unsigned char)buffer[i] == CURL_IAC) outbuf[j++] = CURL_IAC; } @@ -1248,9 +1248,6 @@ static CURLcode telnet_done(struct Curl_easy *data, curl_slist_free_all(tn->telnet_vars); tn->telnet_vars = NULL; - - Curl_safefree(data->req.p.telnet); - return CURLE_OK; } @@ -1491,6 +1488,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } while(keepon) { + DEBUGF(infof(data, "telnet_do(handle=%p), poll %d fds", data, poll_cnt)); switch(Curl_poll(pfd, poll_cnt, interval_ms)) { case -1: /* error, stop reading */ keepon = FALSE; @@ -1509,6 +1507,14 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) /* returned not-zero, this an error */ if(result) { keepon = FALSE; + /* TODO: in test 1452, macOS sees a ECONNRESET sometimes? + * Is this the telnet test server not shutting down the socket + * in a clean way? Seems to be timing related, happens more + * on slow debug build */ + if(data->state.os_errno == ECONNRESET) { + DEBUGF(infof(data, "telnet_do(handle=%p), unexpected ECONNRESET" + " on recv", data)); + } break; } /* returned zero but actually received 0 or less here, |