diff options
author | Steve Holme <steve_holme@hotmail.com> | 2016-03-19 20:37:12 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2016-03-19 20:37:12 +0000 |
commit | 4ff5cfd5fa5f4bce90852efef1c5f28995171108 (patch) | |
tree | ded753d8a52e1f5aca3c3e6bd52c2f4dfdf31cd0 /lib/easy.c | |
parent | c5744340db2d55a95743c93f55e47869317b4c95 (diff) | |
download | curl-4ff5cfd5fa5f4bce90852efef1c5f28995171108.tar.gz |
easy: Minor coding standard and style updates
Following commit c5744340db. Additionally removes the need for a second
'result code' variable as well.
Diffstat (limited to 'lib/easy.c')
-rw-r--r-- | lib/easy.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/easy.c b/lib/easy.c index caab2629a..2bddbb22f 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -697,21 +697,22 @@ static CURLcode easy_transfer(CURLM *multi) while(!done && !mcode) { int still_running = 0; - int ret; + int rc; before = curlx_tvnow(); - mcode = curl_multi_wait(multi, NULL, 0, 1000, &ret); + mcode = curl_multi_wait(multi, NULL, 0, 1000, &rc); - if(mcode == CURLM_OK) { - if(ret == 0) { + if(!mcode) { + if(!rc) { struct timeval after = curlx_tvnow(); + /* If it returns without any filedescriptor instantly, we need to avoid busy-looping during periods where it has nothing particular to wait for */ if(curlx_tvdiff(after, before) <= 10) { without_fds++; if(without_fds > 2) { - int sleep_ms = without_fds < 10 ? (1 << (without_fds-1)): 1000; + int sleep_ms = without_fds < 10 ? (1 << (without_fds - 1)) : 1000; Curl_wait_ms(sleep_ms); } } @@ -727,8 +728,7 @@ static CURLcode easy_transfer(CURLM *multi) } /* only read 'still_running' if curl_multi_perform() return OK */ - if((mcode == CURLM_OK) && !still_running) { - int rc; + if(!mcode && !still_running) { CURLMsg *msg = curl_multi_info_read(multi, &rc); if(msg) { result = msg->data.result; @@ -739,10 +739,10 @@ static CURLcode easy_transfer(CURLM *multi) /* Make sure to return some kind of error if there was a multi problem */ if(mcode) { - return (mcode == CURLM_OUT_OF_MEMORY) ? CURLE_OUT_OF_MEMORY : - /* The other multi errors should never happen, so return - something suitably generic */ - CURLE_BAD_FUNCTION_ARGUMENT; + result = (mcode == CURLM_OUT_OF_MEMORY) ? CURLE_OUT_OF_MEMORY : + /* The other multi errors should never happen, so return + something suitably generic */ + CURLE_BAD_FUNCTION_ARGUMENT; } return result; |