diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-09-28 14:14:25 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-09-28 14:16:11 +0200 |
commit | 5a8c5d4c39e2dae2174d8f6ce7cee4c6ea3eb5a9 (patch) | |
tree | 5051c6f490c21aba339ee9f14b2eb15cdb9c1c5f /lib/sendf.c | |
parent | abeeffb11c996aed90ea465fa2128bfa564a1542 (diff) | |
download | curl-bagder/sendf.tar.gz |
sendf: move Curl_sendf to dict.c and make it staticbagder/sendf
... as the only remaining user of that function. Also fix gopher.c to
rather use Curl_write()
Diffstat (limited to 'lib/sendf.c')
-rw-r--r-- | lib/sendf.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/lib/sendf.c b/lib/sendf.c index 157787a37..6cfc89b69 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -286,52 +286,6 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...) } } -/* Curl_sendf() sends formatted data to the server */ -CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn, - const char *fmt, ...) -{ - struct Curl_easy *data = conn->data; - ssize_t bytes_written; - size_t write_len; - CURLcode result = CURLE_OK; - char *s; - char *sptr; - va_list ap; - va_start(ap, fmt); - s = vaprintf(fmt, ap); /* returns an allocated string */ - va_end(ap); - if(!s) - return CURLE_OUT_OF_MEMORY; /* failure */ - - bytes_written = 0; - write_len = strlen(s); - sptr = s; - - for(;;) { - /* Write the buffer to the socket */ - result = Curl_write(conn, sockfd, sptr, write_len, &bytes_written); - - if(result) - break; - - if(data->set.verbose) - Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written); - - if((size_t)bytes_written != write_len) { - /* if not all was written at once, we must advance the pointer, decrease - the size left and try again! */ - write_len -= bytes_written; - sptr += bytes_written; - } - else - break; - } - - free(s); /* free the output string */ - - return result; -} - /* * Curl_write() is an internal write function that sends data to the * server. Works with plain sockets, SCP, SSL or kerberos. |