mirror of
https://github.com/curl/curl.git
synced 2026-07-24 10:57:16 +03:00
select: switch to macros in uppercase
Curl_select_ready() was the former API that was replaced with Curl_select_check() a while back and the former arg setup was provided with a define (in order to leave existing code unmodified). Now we instead offer SOCKET_READABLE and SOCKET_WRITABLE for the most common shortcuts where only one socket is checked. They're also more visibly macros.
This commit is contained in:
parent
a05906190c
commit
8a6e89a9eb
22 changed files with 50 additions and 46 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -245,7 +245,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
|||
}
|
||||
|
||||
if(!blocking) {
|
||||
if(0 == Curl_socket_ready(tunnelsocket, CURL_SOCKET_BAD, 0))
|
||||
if(0 == SOCKET_READABLE(tunnelsocket, 0))
|
||||
/* return so we'll be called again polling-style */
|
||||
return CURLE_OK;
|
||||
else {
|
||||
|
|
@ -280,8 +280,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
|||
}
|
||||
|
||||
/* loop every second at least, less if the timeout is near */
|
||||
switch (Curl_socket_ready(tunnelsocket, CURL_SOCKET_BAD,
|
||||
check<1000L?check:1000)) {
|
||||
switch (SOCKET_READABLE(tunnelsocket, check<1000L?check:1000)) {
|
||||
case -1: /* select() error, stop reading */
|
||||
error = SELECT_ERROR;
|
||||
failf(data, "Proxy CONNECT aborted due to select/poll error");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue