mirror of
https://github.com/curl/curl.git
synced 2026-08-26 14:13:35 +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
15
lib/multi.c
15
lib/multi.c
|
|
@ -1218,6 +1218,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi,
|
|||
struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK];
|
||||
struct curl_pollfds cpfds;
|
||||
unsigned int curl_nfds = 0; /* how many pfds are for curl transfers */
|
||||
struct Curl_easy *data = NULL;
|
||||
CURLMcode result = CURLM_OK;
|
||||
unsigned int mid;
|
||||
|
||||
|
|
@ -1243,8 +1244,8 @@ static CURLMcode multi_wait(struct Curl_multi *multi,
|
|||
/* Add the curl handles to our pollfds first */
|
||||
if(Curl_uint_bset_first(&multi->process, &mid)) {
|
||||
do {
|
||||
struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
|
||||
struct easy_pollset ps;
|
||||
data = Curl_multi_get_easy(multi, mid);
|
||||
if(!data) {
|
||||
DEBUGASSERT(0);
|
||||
Curl_uint_bset_remove(&multi->process, mid);
|
||||
|
|
@ -1320,6 +1321,9 @@ static CURLMcode multi_wait(struct Curl_multi *multi,
|
|||
if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms))
|
||||
timeout_ms = (int)timeout_internal;
|
||||
|
||||
if(data)
|
||||
CURL_TRC_M(data, "multi_wait(fds=%d, timeout=%d) tinternal=%ld",
|
||||
cpfds.n, timeout_ms, timeout_internal);
|
||||
#if defined(ENABLE_WAKEUP) && defined(USE_WINSOCK)
|
||||
if(cpfds.n || use_wakeup) {
|
||||
#else
|
||||
|
|
@ -1950,6 +1954,8 @@ static CURLMcode state_performing(struct Curl_easy *data,
|
|||
/* This avoids CURLM_CALL_MULTI_PERFORM so that a very fast transfer does
|
||||
not get stuck on this transfer at the expense of other concurrent
|
||||
transfers */
|
||||
CURL_TRC_M(data, "EXPIRE_RUN_NOW unblocked, select_bits=%x",
|
||||
data->state.select_bits);
|
||||
Curl_expire(data, 0, EXPIRE_RUN_NOW);
|
||||
}
|
||||
free(newurl);
|
||||
|
|
@ -3197,6 +3203,10 @@ static CURLMcode multi_timeout(struct Curl_multi *multi,
|
|||
*timeout_ms = (long)diff;
|
||||
}
|
||||
else {
|
||||
if(multi->timetree) {
|
||||
struct Curl_easy *data = Curl_splayget(multi->timetree);
|
||||
CURL_TRC_M(data, "multi_timeout() says this has expired");
|
||||
}
|
||||
/* 0 means immediately */
|
||||
*timeout_ms = 0;
|
||||
}
|
||||
|
|
@ -3420,6 +3430,9 @@ void Curl_expire_ex(struct Curl_easy *data,
|
|||
Curl_splayset(&data->state.timenode, data);
|
||||
multi->timetree = Curl_splayinsert(*curr_expire, multi->timetree,
|
||||
&data->state.timenode);
|
||||
if(data->id >= 0)
|
||||
CURL_TRC_M(data, "set expire[%d] in %" FMT_TIMEDIFF_T "ns",
|
||||
id, curlx_timediff_us(set, *nowp));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue