summaryrefslogtreecommitdiff
path: root/lib/select.c
Commit message (Collapse)AuthorAgeFilesLines
...
* build: rename 93 lib/*.c filesYang Tse2013-01-031-529/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 93 lib/*.c source files renamed to use our standard naming scheme. This commit only does the file renaming. ---------------------------------------- renamed: lib/amigaos.c -> lib/curl_amigaos.c renamed: lib/asyn-ares.c -> lib/curl_asyn_ares.c renamed: lib/asyn-thread.c -> lib/curl_asyn_thread.c renamed: lib/axtls.c -> lib/curl_axtls.c renamed: lib/base64.c -> lib/curl_base64.c renamed: lib/bundles.c -> lib/curl_bundles.c renamed: lib/conncache.c -> lib/curl_conncache.c renamed: lib/connect.c -> lib/curl_connect.c renamed: lib/content_encoding.c -> lib/curl_content_encoding.c renamed: lib/cookie.c -> lib/curl_cookie.c renamed: lib/cyassl.c -> lib/curl_cyassl.c renamed: lib/dict.c -> lib/curl_dict.c renamed: lib/easy.c -> lib/curl_easy.c renamed: lib/escape.c -> lib/curl_escape.c renamed: lib/file.c -> lib/curl_file.c renamed: lib/fileinfo.c -> lib/curl_fileinfo.c renamed: lib/formdata.c -> lib/curl_formdata.c renamed: lib/ftp.c -> lib/curl_ftp.c renamed: lib/ftplistparser.c -> lib/curl_ftplistparser.c renamed: lib/getenv.c -> lib/curl_getenv.c renamed: lib/getinfo.c -> lib/curl_getinfo.c renamed: lib/gopher.c -> lib/curl_gopher.c renamed: lib/gtls.c -> lib/curl_gtls.c renamed: lib/hash.c -> lib/curl_hash.c renamed: lib/hmac.c -> lib/curl_hmac.c renamed: lib/hostasyn.c -> lib/curl_hostasyn.c renamed: lib/hostcheck.c -> lib/curl_hostcheck.c renamed: lib/hostip.c -> lib/curl_hostip.c renamed: lib/hostip4.c -> lib/curl_hostip4.c renamed: lib/hostip6.c -> lib/curl_hostip6.c renamed: lib/hostsyn.c -> lib/curl_hostsyn.c renamed: lib/http.c -> lib/curl_http.c renamed: lib/http_chunks.c -> lib/curl_http_chunks.c renamed: lib/http_digest.c -> lib/curl_http_digest.c renamed: lib/http_negotiate.c -> lib/curl_http_negotiate.c renamed: lib/http_negotiate_sspi.c -> lib/curl_http_negotiate_sspi.c renamed: lib/http_proxy.c -> lib/curl_http_proxy.c renamed: lib/idn_win32.c -> lib/curl_idn_win32.c renamed: lib/if2ip.c -> lib/curl_if2ip.c renamed: lib/imap.c -> lib/curl_imap.c renamed: lib/inet_ntop.c -> lib/curl_inet_ntop.c renamed: lib/inet_pton.c -> lib/curl_inet_pton.c renamed: lib/krb4.c -> lib/curl_krb4.c renamed: lib/krb5.c -> lib/curl_krb5.c renamed: lib/ldap.c -> lib/curl_ldap.c renamed: lib/llist.c -> lib/curl_llist.c renamed: lib/md4.c -> lib/curl_md4.c renamed: lib/md5.c -> lib/curl_md5.c renamed: lib/memdebug.c -> lib/curl_memdebug.c renamed: lib/mprintf.c -> lib/curl_mprintf.c renamed: lib/multi.c -> lib/curl_multi.c renamed: lib/netrc.c -> lib/curl_netrc.c renamed: lib/non-ascii.c -> lib/curl_non_ascii.c renamed: lib/curl_non-ascii.h -> lib/curl_non_ascii.h renamed: lib/nonblock.c -> lib/curl_nonblock.c renamed: lib/nss.c -> lib/curl_nss.c renamed: lib/nwlib.c -> lib/curl_nwlib.c renamed: lib/nwos.c -> lib/curl_nwos.c renamed: lib/openldap.c -> lib/curl_openldap.c renamed: lib/parsedate.c -> lib/curl_parsedate.c renamed: lib/pingpong.c -> lib/curl_pingpong.c renamed: lib/polarssl.c -> lib/curl_polarssl.c renamed: lib/pop3.c -> lib/curl_pop3.c renamed: lib/progress.c -> lib/curl_progress.c renamed: lib/qssl.c -> lib/curl_qssl.c renamed: lib/rawstr.c -> lib/curl_rawstr.c renamed: lib/rtsp.c -> lib/curl_rtsp.c renamed: lib/security.c -> lib/curl_security.c renamed: lib/select.c -> lib/curl_select.c renamed: lib/sendf.c -> lib/curl_sendf.c renamed: lib/share.c -> lib/curl_share.c renamed: lib/slist.c -> lib/curl_slist.c renamed: lib/smtp.c -> lib/curl_smtp.c renamed: lib/socks.c -> lib/curl_socks.c renamed: lib/socks_gssapi.c -> lib/curl_socks_gssapi.c renamed: lib/socks_sspi.c -> lib/curl_socks_sspi.c renamed: lib/speedcheck.c -> lib/curl_speedcheck.c renamed: lib/splay.c -> lib/curl_splay.c renamed: lib/ssh.c -> lib/curl_ssh.c renamed: lib/sslgen.c -> lib/curl_sslgen.c renamed: lib/ssluse.c -> lib/curl_ssluse.c renamed: lib/strdup.c -> lib/curl_strdup.c renamed: lib/strequal.c -> lib/curl_strequal.c renamed: lib/strerror.c -> lib/curl_strerror.c renamed: lib/strtok.c -> lib/curl_strtok.c renamed: lib/strtoofft.c -> lib/curl_strtoofft.c renamed: lib/telnet.c -> lib/curl_telnet.c renamed: lib/tftp.c -> lib/curl_tftp.c renamed: lib/timeval.c -> lib/curl_timeval.c renamed: lib/transfer.c -> lib/curl_transfer.c renamed: lib/url.c -> lib/curl_url.c renamed: lib/version.c -> lib/curl_version.c renamed: lib/warnless.c -> lib/curl_warnless.c renamed: lib/wildcard.c -> lib/curl_wildcard.c ----------------------------------------
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-5/+5
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* Curl_socket_check: fix timeout return value for select usersDaniel Stenberg2012-08-071-2/+4
| | | | | | This is the same fix applied for the conditional code that uses select() that was already done for the poll specific code in commit b61e8b81f5038.
* Curl_socket_check: fix return code for timeoutMaxime Larocque2012-08-071-1/+3
| | | | | | | | | | | | | | | | | | | | We found a problem with ftp transfer using libcurl (7.23 and 7.25) inside an application which is receiving unix signals (SIGUSR1, SIGUSR2...) almost continuously. (Linux 2.4, PowerPC, HAVE_POLL_FINE defined). Curl_socket_check() uses poll() to wait for the socket, and retries it when a signal is received (EINTR). However, if a signal is received and it also happens that the timeout has been reached, Curl_socket_check() returns -1 instead of 0 (indicating an error instead of a timeout). In our case, the result is an aborted connection even before the ftp banner is received from the server, and a return value of CURLE_OUT_OF_MEMORY from curl_easy_perform() (Curl_pp_multi_statemach(), in pingpong.c, actually returns OOM if Curl_socket_check() fails :-) Funny to debug on a system on which OOM is a possible cause). Bug: http://curl.haxx.se/mail/lib-2012-07/0122.html
* Curl_socket_check: enlarge poll struct array to 3Daniel Stenberg2011-12-201-1/+1
| | | | | | | | | | | This function was introduced in commit 5527417afae0 and as pointed out by Gokhan Sengun, the array with poll structs must large enough to hold 3 sockets since that is what the function can accept. It could be noted that he had this fixed in his patch as posted in http://curl.haxx.se/mail/lib-2011-12/0179.html Bug: http://curl.haxx.se/mail/lib-2011-12/0228.html Reported by: Gokhan Sengun
* sockets: new Curl_socket_check() can wait for 3 socketsDaniel Stenberg2011-12-201-20/+55
| | | | | This offers an alternative to the existing Curl_socket_ready() API which only checks one socket for read and one for write.
* curl_multi_fdset: avoid FD_SET out of boundsDaniel Stenberg2011-09-251-14/+0
| | | | | | | | If a socket is larger than FD_SETSIZE, avoid using FD_SET() on the platforms where this is possible. Bug: http://curl.haxx.se/bug/view.cgi?id=3413274 Reported by: Tim Starling
* fix a bunch of MSVC compiler warningsYang Tse2011-09-031-1/+1
|
* MemoryTracking: fix logging of free() calls done where Curl_safefree is calledYang Tse2011-09-021-2/+2
| | | | | | | | | | | | | | Just internal stuff... Curl_safefree is now a macro defined in memdebug.h instead of a function prototyped in url.h and implemented in url.c, so inclusion of url.h is no longer required in order to simply use Curl_safefree. Provide definition of macro WHILE_FALSE in setup_once.h in order to allow other macros such as DEBUGF and DEBUGASSERT, and code using it, to compile without 'conditional expression is constant' warnings. The WHILE_FALSE stuff fixes 150+ MSVC compiler warnings.
* Give the NTLM SSO helper a moment to cleanly shut down if neededDan Fandrich2011-07-281-3/+3
|
* time.h and sys/time.h inclusion conditionally done in setup_once.hYang Tse2011-07-251-3/+0
|
* long/int messDaniel Stenberg2011-06-111-2/+2
| | | | Typecast when converting to int from long to avoid some compiler warnings
* wait_ms: takes an int argumentDaniel Stenberg2011-06-051-2/+2
| | | | Typecasts added since I changed more code to use long for timeouts
* Curl_socket_ready: make timeout a 'long'Daniel Stenberg2011-06-041-1/+1
| | | | | It was mostly typecasted to int all over the code so switching to long instead all over should be a net gain.
* compiler warning: fixYang Tse2011-05-241-0/+1
| | | | | | Fix compiler warning: variable was set but never used Fix compiler warning: clobber ignored
* source cleanup: unify look, style and indent levelsDaniel Stenberg2011-04-271-5/+5
| | | | | By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
* remove the CVSish $Id$ linesDaniel Stenberg2010-03-241-1/+0
|
* Fix spellingYang Tse2009-10-271-2/+2
|
* Some systems poll function sets POLLHUP in revents without settingYang Tse2009-09-151-0/+14
| | | | | | | | POLLIN, and sets POLLERR without setting POLLIN and POLLOUT. In some libcurl code execution paths this could trigger busy wait loops with high CPU usage until a timeout condition aborted the loop. This fix for Curl_poll adresses the above in a libcurl-wide mode.
* Andreas Faerber and Scott McCreary made (lib)curl build for the Haiku OSDaniel Stenberg2008-05-261-1/+1
|
* Internal time differences now use monotonic time source if available.Yang Tse2008-05-091-2/+2
| | | | This also implies the removal of the winmm.lib dependency for WIN32.
* Regression fix:Yang Tse2008-03-061-8/+8
| | | | | | | | select/poll calls will only be retried upon EINTR failures as it previously was in lib/select.c revision 1.29 In this way Curl_socket_ready() and Curl_poll() will again fail on any select/poll errors different than EINTR.
* removed space after if and while before the parenthesis for better source codeDaniel Stenberg2007-11-051-75/+75
| | | | consistency
* Cleanup no longer used macrosYang Tse2007-10-031-10/+0
|
* Fix compiler warning: local variable may be used without having been initializedYang Tse2007-10-031-2/+2
|
* When transferring 500 downloads in parallel with a c-ares enabled build onlyDaniel Stenberg2007-05-311-221/+0
| | | | | | | | to find that it crashed miserably, and this was due to some select()isms left in the code. This was due to API restrictions in c-ares 1.3.x, but with the upcoming c-ares 1.4.0 this is no longer the case so now libcurl runs much better with c-ares and the multi interface with > 1024 file descriptors in use.
* Primarily this fixes an off-by-one buffer overwrite (rare but still existing).Daniel Stenberg2007-05-261-6/+13
| | | | | | | | | | I also switched from calloc() to malloc() as a minor performance boost since the rest of the code fills in the structs fine anyway - and they must for the case when we use the stack-based auto variable array instead of the allocated one. I made the loop filling in poll_fds[] break when poll_nfds is reached as a minor speed improvement.
* initialize pending_ms to zero to avoid compiler warning:Yang Tse2007-04-201-3/+3
| | | | 'pending_ms' may be used uninitialized in this function
* - Save one call to curlx_tvnow(), which calls gettimeofday(), in each ofYang Tse2007-04-201-33/+127
| | | | | | | | | | | | | Curl_socket_ready(), Curl_poll() and Curl_select() when these are called with a zero timeout or a timeout value indicating a blocking call should be performed. These unnecessary calls to gettimeofday() got introduced in 7.16.2 when fixing 'timeout would restart when signal caught while awaiting socket events' on 20 March 2007. - Move some loop breaking logic from the while clause into the loop, avoiding compiler warning 'assignment within conditional expression'
* keep lines < 80 columnsDaniel Stenberg2007-04-191-2/+4
|
* - Robert Iakobashvil added curl_multi_socket_action() to libcurl, which is aDaniel Stenberg2007-04-161-9/+9
| | | | | | | | function that deprecates the curl_multi_socket() function. Using the new function the application tell libcurl what action that was found in the socket that it passes in. This gives a significant performance boost as it allows libcurl to avoid a call to poll()/select() for every call to curl_multi_socket*().
* move WinSock definitions of EBADF, EINTR, EINVAL and EAFNOSUPPORT to ↵Yang Tse2007-04-041-11/+0
| | | | setup_once.h
* fix MSDOS symbol checkYang Tse2007-04-031-3/+3
|
* fix compiler warningYang Tse2007-04-021-1/+1
|
* fix error introduced in last commitYang Tse2007-03-291-0/+1
|
* Improve detection of socket events which allow a further recv() callYang Tse2007-03-281-20/+13
| | | | | | | to complete with no delay and actually find out what happened with the socket. As well as detection of socket send()able condition. This also allows removal of a Cygwin specific block of code.
* New Internal wrapper function Curl_select() around select (2), itYang Tse2007-03-271-2/+195
| | | | | uses poll() when a fine poll() is available, so now libcurl can be built without select() support at all if a fine poll() is available.
* don't retry select() call upon unrecoverable error EBADFYang Tse2007-03-271-7/+17
|
* Internal function Curl_select() renamed to Curl_socket_ready()Yang Tse2007-03-261-3/+3
|
* Add a couple of local macros to improve code readability.Yang Tse2007-03-221-43/+66
| | | | | For completeness sake, wait_ms() might also get interrupted when experimental CURL_ACKNOWLEDGE_EINTR is defined.
* fix compiler warning: implicit conversion from "long" to "int"Yang Tse2007-03-211-4/+4
|
* Fixed: When a signal was caught awaiting for an event using Curl_select()Yang Tse2007-03-201-32/+94
| | | | | | | | | | | | | or Curl_poll() with a non-zero timeout both functions would restart the specified timeout. This could even lead to the extreme case that if a signal arrived with a frecuency lower to the specified timeout neither function would ever exit. Added experimental symbol definition check CURL_ACKNOWLEDGE_EINTR in Curl_select() and Curl_poll(). When compiled with CURL_ACKNOWLEDGE_EINTR defined both functions will return as soon as a signal is caught. Use it at your own risk, all calls to these functions in the library should be revisited and checked before fully supporting this feature.
* Fix compiler warning/error: ISO C90 forbids mixed declarations and codeYang Tse2007-03-181-1/+5
|
* Code refactoring, extracting a new function wait_ms() from Curl_select andYang Tse2007-03-181-46/+75
| | | | | | | Curl_poll() which is called whenever not a single valid file descriptor is passed to these functions. Improve readibility using a poll() macro to replace WSApoll().
* reverted the pselect patch => http://curl.haxx.se/mail/lib-2007-03/0100.htmlDaniel Stenberg2007-03-111-150/+19
|
* - Bryan Henderson introduces two things:Daniel Stenberg2007-03-101-19/+150
| | | | | 1) the progress callback gets called more frequently (at times) 2) libcurl *might* call the callback when it receives a signal
* Removed inclusion of <sys/types.h> and <sys/stat.h> in .c-filesGisle Vanem2007-02-261-3/+0
| | | | since they're already included through "setup.h".
* use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handlingYang Tse2007-02-161-16/+21
|
* Include <dos.h> for delay() on MSDOS.Gisle Vanem2007-01-051-2/+6
|
* - Victor Snezhko helped us fix bug report #1603712Daniel Stenberg2007-01-021-1/+16
| | | | | | | | | | | (http://curl.haxx.se/bug/view.cgi?id=1603712) (known bug #36) --limit-rate (CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE) are broken on Windows (since 7.16.0, but that's when they were introduced as previous to that the limiting logic was made in the application only and not in the library). It was actually also broken on select()-based systems (as apposed to poll()) but we haven't had any such reports. We now use select(), Sleep() or delay() properly to sleep a while without waiting for anything input or output when the rate limiting is activated with the easy interface.