mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:43:33 +03:00
lib: unify recv/send function signatures
cfilter/conn: change send/recv function signatures. Unify the calling/return conventions in our send/receive handling. Curl_conn_recv(), adjust pnread type Parameter `pnread` was a `ssize_t *`, but `size_t *` is better since the function returns any error in its `CURLcode` return value. Closes #17546
This commit is contained in:
parent
3934431421
commit
20c90ba298
37 changed files with 1114 additions and 1219 deletions
|
|
@ -131,17 +131,17 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf,
|
|||
case HAPROXY_SEND:
|
||||
len = curlx_dyn_len(&ctx->data_out);
|
||||
if(len > 0) {
|
||||
ssize_t nwritten;
|
||||
nwritten = Curl_conn_cf_send(cf->next, data,
|
||||
curlx_dyn_ptr(&ctx->data_out), len, FALSE,
|
||||
&result);
|
||||
if(nwritten < 0) {
|
||||
size_t nwritten;
|
||||
result = Curl_conn_cf_send(cf->next, data,
|
||||
curlx_dyn_ptr(&ctx->data_out), len, FALSE,
|
||||
&nwritten);
|
||||
if(result) {
|
||||
if(result != CURLE_AGAIN)
|
||||
goto out;
|
||||
result = CURLE_OK;
|
||||
nwritten = 0;
|
||||
}
|
||||
curlx_dyn_tail(&ctx->data_out, len - (size_t)nwritten);
|
||||
curlx_dyn_tail(&ctx->data_out, len - nwritten);
|
||||
if(curlx_dyn_len(&ctx->data_out) > 0) {
|
||||
result = CURLE_OK;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue