aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/gopher.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-10-04 11:15:32 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-10-04 11:29:39 +0300
commit37112f646e6da1c3eb50de15cbbb8793b383b27e (patch)
treef32d6652f26110a47441c8cf8a08216eca1a52b6 /contrib/libs/curl/lib/gopher.c
parent9a6b8cb5c502ba2b158c337ce13e983e3c3dc78f (diff)
downloadydb-37112f646e6da1c3eb50de15cbbb8793b383b27e.tar.gz
Update contrib/libs/curl to 8.10.1
commit_hash:428ef806a15515cdaa325530aa8cc6903fac5fb6
Diffstat (limited to 'contrib/libs/curl/lib/gopher.c')
-rw-r--r--contrib/libs/curl/lib/gopher.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/contrib/libs/curl/lib/gopher.c b/contrib/libs/curl/lib/gopher.c
index 61e41b7e477..051e6e7ab5b 100644
--- a/contrib/libs/curl/lib/gopher.c
+++ b/contrib/libs/curl/lib/gopher.c
@@ -62,7 +62,7 @@ static CURLcode gopher_connecting(struct Curl_easy *data, bool *done);
*/
const struct Curl_handler Curl_handler_gopher = {
- "GOPHER", /* scheme */
+ "gopher", /* scheme */
ZERO_NULL, /* setup_connection */
gopher_do, /* do_it */
ZERO_NULL, /* done */
@@ -75,7 +75,8 @@ const struct Curl_handler Curl_handler_gopher = {
ZERO_NULL, /* domore_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
- ZERO_NULL, /* readwrite */
+ ZERO_NULL, /* write_resp */
+ ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
PORT_GOPHER, /* defport */
@@ -86,7 +87,7 @@ const struct Curl_handler Curl_handler_gopher = {
#ifdef USE_SSL
const struct Curl_handler Curl_handler_gophers = {
- "GOPHERS", /* scheme */
+ "gophers", /* scheme */
ZERO_NULL, /* setup_connection */
gopher_do, /* do_it */
ZERO_NULL, /* done */
@@ -99,7 +100,8 @@ const struct Curl_handler Curl_handler_gophers = {
ZERO_NULL, /* domore_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
- ZERO_NULL, /* readwrite */
+ ZERO_NULL, /* write_resp */
+ ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
PORT_GOPHER, /* defport */
@@ -139,8 +141,8 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
char *sel = NULL;
char *sel_org = NULL;
timediff_t timeout_ms;
- ssize_t amount, k;
- size_t len;
+ ssize_t k;
+ size_t amount, len;
int what;
*done = TRUE; /* unconditionally */
@@ -185,7 +187,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
if(strlen(sel) < 1)
break;
- result = Curl_nwrite(data, FIRSTSOCKET, sel, k, &amount);
+ result = Curl_xfer_send(data, sel, k, FALSE, &amount);
if(!result) { /* Which may not have written it all! */
result = Curl_client_write(data, CLIENTWRITE_HEADER, sel, amount);
if(result)
@@ -207,9 +209,9 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
if(!timeout_ms)
timeout_ms = TIMEDIFF_T_MAX;
- /* Don't busyloop. The entire loop thing is a work-around as it causes a
+ /* Do not busyloop. The entire loop thing is a work-around as it causes a
BLOCKING behavior which is a NO-NO. This function should rather be
- split up in a do and a doing piece where the pieces that aren't
+ split up in a do and a doing piece where the pieces that are not
possible to send now will be sent in the doing function repeatedly
until the entire request is sent.
*/
@@ -227,7 +229,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
free(sel_org);
if(!result)
- result = Curl_nwrite(data, FIRSTSOCKET, "\r\n", 2, &amount);
+ result = Curl_xfer_send(data, "\r\n", 2, FALSE, &amount);
if(result) {
failf(data, "Failed sending Gopher request");
return result;
@@ -236,7 +238,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
if(result)
return result;
- Curl_setup_transfer(data, FIRSTSOCKET, -1, FALSE, -1);
+ Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE);
return CURLE_OK;
}
#endif /* CURL_DISABLE_GOPHER */