summaryrefslogtreecommitdiff
path: root/lib/multi.c
Commit message (Collapse)AuthorAgeFilesLines
* FTP: WILDCARDMATCH/CHUNKING/FNMATCH addedPavel Raiskup2010-05-121-1/+37
|
* remove the CVSish $Id$ linesDaniel Stenberg2010-03-241-1/+0
|
* delayed easy handle kill caused double Curl_close() callDaniel Stenberg2010-03-231-2/+8
| | | | | | | | | | | | | | | | | Hauke Duden provided an example program that made the multi interface crash. His example simply used the multi interface and did first one FTP transfer and after completion it used a second easy handle and did another FTP transfer on the same FTP server. This triggered a bug in the "delayed easy handle kill" system that curl uses: when an FTP connection is left alive it must keep an easy handle around internally - only for the purpose of having an easy handle when it later disconnects it. The code assumed that when the easy handle was removed and an internal reference was made, that version could be killed later on when a new easy handle came using the same connection. This was wrong as Hauke's example showed that the removed handle wasn't killed for real until later. This caused a double close attempt => segfault.
* - Constantine Sapuntzakis brought a patch:Daniel Stenberg2010-03-151-67/+70
| | | | | | | | | The problem mentioned on Dec 10 2009 (http://curl.haxx.se/bug/view.cgi?id=2905220) was only partially fixed. Partially because an easy handle can be associated with many connections in the cache (e.g. if there is a redirect during the lifetime of the easy handle). The previous patch only cleaned up the first one. The new fix now removes the easy handle from all connections, not just the first one.
* fix printf-style format stringsYang Tse2010-02-041-7/+7
|
* Fix compiler warnings: conversion from 'const int ' to 'unsigned char ', ↵Yang Tse2010-02-021-2/+2
| | | | possible loss of data
* We introduce a loop in lib/multi.c around all calls to multi_runsingle() andDaniel Stenberg2010-02-011-14/+10
| | | | | | simply check for CURLM_CALL_MULTI_PERFORM internally. This has the added benefit that this goes in line with my long-term wishes to get rid of the CURLM_CALL_MULTI_PERFORM all together from the public API.
* fix printf-style format stringsYang Tse2010-01-281-3/+3
|
* After the TCP connect is confirmed in CURLM_STATE_WAITCONNECT and it changesDaniel Stenberg2010-01-111-3/+3
| | | | | | | state, we return CURLM_CALL_MULTI_PERFORM unconditionally then so that we can act faster like in the case the protocol-specific connect doesn't block on anything and we can just persue on the next action immediately. It also then avoids a case where curl_multi_fdset() would return -1.
* struct Curl_sh_entry's 'inuse' member was no longer used and is now removedDaniel Stenberg2010-01-091-2/+1
|
* - Julien Chaffraix eliminated a duplicated initialization in singlesocket().Kamil Dudka2010-01-031-1/+0
|
* - Constantine Sapuntzakis figured out a case which would lead to libcurlDaniel Stenberg2009-12-101-19/+28
| | | | | | | | accessing alredy freed memory and thus crash when using HTTPS (with OpenSSL), multi interface and the CURLOPT_DEBUGFUNCTION and a certain order of cleaning things up. I fixed it. (http://curl.haxx.se/bug/view.cgi?id=2891591)
* Make usage of calloc()'s arguments consistent with rest of code baseYang Tse2009-11-181-4/+4
|
* clarify the code by initing newurl to NULLDaniel Stenberg2009-08-241-2/+2
|
* - Andre Guibert de Bruet pointed out a missing return code check for aDaniel Stenberg2009-08-211-3/+16
| | | | | | strdup() that could lead to segfault if it returned NULL. I extended his suggest patch to now have Curl_retry_request() return a regular return code and better check that.
* - Lots of good work by Krister Johansen, mostly related to pipelining:Daniel Stenberg2009-08-211-25/+102
| | | | | | Fix SIGSEGV on free'd easy_conn when pipe unexpectedly breaks Fix data corruption issue with re-connected transfers Fix use after free if we're completed but easy_conn not NULL
* indentation fixes onlyDaniel Stenberg2009-08-031-28/+27
|
* fix compiler warningYang Tse2009-06-121-1/+1
|
* Adjusted to take in account that...Yang Tse2009-06-101-6/+6
| | | | | | | | | With the curl memory tracking feature decoupled from the debug build feature, CURLDEBUG and DEBUGBUILD preprocessor symbol definitions are used as follows: CURLDEBUG used for curl debug memory tracking specific code (--enable-curldebug) DEBUGBUILD used for debug enabled specific code (--enable-debug)
* Internal cleanup: KEEP_WRITE and KEEP_READ are now called KEEP_SEND andDaniel Stenberg2009-05-111-4/+4
| | | | | KEEP_RECV to better match the general terminology: receive and send is what we do from the (remote) servers. We read and write from and to the local fs.
* - Constantine Sapuntzakis fixed bug report #2784055Daniel Stenberg2009-05-081-3/+10
| | | | | | | | | (http://curl.haxx.se/bug/view.cgi?id=2784055) identifying a problem to connect to SOCKS proxies when using the multi interface. It turned out to almost not work at all previously. We need to wait for the TCP connect to be properly verified before doing the SOCKS magic. There's still a flaw in the FTP code for this.
* libcurl's memory.h renamed to curl_memory.hYang Tse2009-04-211-1/+1
|
* - Linus Nielsen Feltzing reported and helped me repeat and fix a problem withDaniel Stenberg2009-02-201-19/+17
| | | | | | | | | | FTP with the multi interface: when a transfer fails, like when aborted by a write callback, the control connection was wrongly closed and thus not re-used properly. This change is also an attempt to cleanup the code somewhat in this area, as now the FTP code attempts to keep (better) track on pending responses necessary to get read in ftp_done().
* minor comment fixDaniel Stenberg2009-02-021-1/+1
|
* - Emil Romanus fixed:Daniel Stenberg2009-01-101-2/+1
| | | | | | | | | | | | | | | When using the multi interface over HTTP and the server returns a Location header, the running easy handle will get stuck in the CURLM_STATE_PERFORM state, leaving the external event loop stuck waiting for data from the ingoing socket (when using the curl_multi_socket_action stuff). While this bug was pretty hard to find, it seems to require only a one-line fix. The break statement on line 1374 in multi.c caused the function to skip the call to multistate(). How to reproduce this bug? Well, that's another question. evhiperfifo.c in the examples directory chokes on this bug only _sometimes_, probably depending on how fast the URLs are added. One way of testing the bug out is writing to hiper.fifo from more than one source at the same time.
* - Igor Novoseltsev fixed a bad situation for the multi_socket() API when doingDaniel Stenberg2008-12-201-2/+67
| | | | | | | pipelining, as libcurl could then easily get confused and A) work on the handle that was not "first in queue" on a pipeline, or even B) tell the app to REMOVE a socket while it was in use by a second handle in a pipeline. Both errors caused hanging or stalling applications.
* - curl_multi_timeout() could return a timeout value of 0 even though nothingDaniel Stenberg2008-12-191-1/+12
| | | | | | | | was actually ready to get done, as the internal time resolution is higher than the returned millisecond timer. Therefore it could cause applications running on fast processors to do short bursts of busy-loops. curl_multi_timeout() will now only return 0 if the timeout is actually alreay triggered.
* - Using the libssh2 0.19 function libssh2_session_block_directions(), libcurlDaniel Stenberg2008-12-191-5/+5
| | | | | | | now has an improved ability to do right when the multi interface (both "regular" and multi_socket) is used for SCP and SFTP transfers. This should result in (much) less busy-loop situations and thus less CPU usage with no speed loss.
* - More work with Igor Novoseltsev to first fix the remaining stuff forDaniel Stenberg2008-12-121-4/+12
| | | | | | | removing easy handles from multi handles when the easy handle is/was within a HTTP pipeline. His bug report #2351653 (http://curl.haxx.se/bug/view.cgi?id=2351653) was also related and was eventually fixed by a patch by Igor himself.
* - Igor Novoseltsev filed bug #2351645Daniel Stenberg2008-12-031-13/+18
| | | | | | (http://curl.haxx.se/bug/view.cgi?id=2351645) that identified a problem with the multi interface that occured if you removed an easy handle while in progress and the handle was used in a HTTP pipeline.
* Use our Curl_addrinfo definition even when an addrinfo struct is available.Yang Tse2008-10-301-1/+2
| | | | Use a wrapper function to call system's getaddrinfo().
* add missing header inclusionsYang Tse2008-10-251-1/+4
|
* attempt to fix or allow further detection of an elusive icc SIGSEGVYang Tse2008-10-191-0/+2
|
* - Igor filed bug #2111613 (http://curl.haxx.se/bug/view.cgi?id=2111613) thatDaniel Stenberg2008-10-081-3/+15
| | | | | | eventually identified a flaw in how the multi_socket interface in some cases missed to call the timeout callback when easy interfaces are removed and added within the same millisecond.
* - Bug #2107803 (http://curl.haxx.se/bug/view.cgi?id=2107803) "noDaniel Stenberg2008-09-291-1/+14
| | | | | CURLINFO_REDIRECT_URL in multi mode" also contained a patch that fixed the problem.
* fix compiler warning: defined but not usedYang Tse2008-09-131-3/+1
|
* fix compiler warning: external declaration in primary source fileYang Tse2008-09-131-2/+2
|
* Checked in some code improvements and minor fixes that I discovered in theDan Fandrich2008-09-101-1/+1
| | | | FreeBSD ports system.
* Dmitry Kurochkin fixed pipelining over proxy using the multi interfaceDaniel Stenberg2008-09-081-6/+7
|
* remove unnecessary typecasting of malloc()Yang Tse2008-09-061-1/+1
|
* remove unnecessary typecasting of calloc()Yang Tse2008-09-061-3/+3
|
* - Constantine Sapuntzakis fixed a bug when doing proxy CONNECT with the multiDaniel Stenberg2008-08-231-1/+11
| | | | | interface, and the proxy would send Connection: close during the authentication phase. http://curl.haxx.se/bug/view.cgi?id=2069047
* Fixed an uninitialized variable in multi_runsingle() that could cause aDan Fandrich2008-08-081-1/+1
| | | | request to prematurely end.
* - Christopher Palow fixed a curl_multi_socket() issue which previous causedDaniel Stenberg2008-06-191-0/+5
| | | | | | | | libcurl to not tell the app properly when a socket was closed (when the name resolve done by c-ares is done) and then immediately re-created and put to use again (for the actual connection). Since the closure will make the "watch status" get lost in several event-based systems libcurl will need to tell the app about this close/re-create case.
* In checkPendPipeline() we can't be setting the TIMER_CONNECT correctly as thatDaniel Stenberg2008-06-131-1/+1
| | | | | is for the TCP connect. I changed it to TIMER_PRETRANSFER which seems to be what was intended here.
* - Emil Romanus found a problem and helped me repeat it. It occured when usingDaniel Stenberg2008-05-281-19/+58
| | | | | | the curl_multi_socket() API with HTTP pipelining enabled and could lead to the pipeline basically stalling for a very long period of time until it took off again.
* with pipelining disabled, the state should never be set to WAITDO but ratherDaniel Stenberg2008-05-191-29/+50
| | | | | | | | | go straight to DO we had multiple states for which the internal function returned no socket at all to wait for, with the effect that libcurl calls the socket callback (when curl_multi_socket() is used) with REMOVE prematurely (as it would be added again within very shortly)
* - Stefan Krause reported a busy-looping case when using the multi interfaceDaniel Stenberg2008-05-091-0/+6
| | | | | and doing CONNECT to a proxy. The app would then busy-loop until the proxy completed its response.
* Christopher Palow provided the patch (edited by me) that introducesYang Tse2008-05-071-19/+15
| | | | | | the use of microsecond resolution keys for internal splay trees. http://curl.haxx.se/mail/lib-2008-04/0513.html
* - To make it easier for applications that want lots of magic stuff done onDaniel Stenberg2008-04-301-1/+5
| | | | | | | | | redirections and thus cannot use CURLOPT_FOLLOWLOCATION easily, we now introduce the new CURLINFO_REDIRECT_URL option that lets applications extract the URL libcurl would've redirected to if it had been told to. This then enables the application to continue to that URL as it thinks is suitable, without having to re-implement the magic of creating the new URL from the Location: header etc. Test 1029 verifies it.