aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
AgeCommit message (Collapse)Author
2011-12-25transfer.c: move a logging statement placementYang Tse
2011-11-02url.c and transfer.c: nullify connection pointer when free()'edYang Tse
2011-10-12OOM handling/cleanup slight adjustmentsYang Tse
2011-09-20Curl_follow: handle redirects to "//hostname/path"Daniel Stenberg
2011-09-11spell-checked commentsDaniel Stenberg
2011-09-05fix bool variables checking and assignmentYang Tse
2011-09-02MemoryTracking: fix logging of free() calls done where Curl_safefree is calledYang Tse
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.
2011-09-02transfer.c: fix parentheses/braces placement for vi/emacs delimiter matchingYang Tse
2011-09-02transfer.c: fix loadhostpairs() OOM handlingYang Tse
2011-08-28NTLM: END of refactoring/splitting/movingYang Tse
First: File curl_ntlm.h renamed curl_ntlm_msgs.h File curl_ntlm.c renamed curl_ntlm_msgs.c Afterwards: File http_ntlm.c renamed curl_ntlm.c File http_ntlm.h renamed curl_ntlm.h
2011-08-13Curl_retry_request: check return code!Daniel Stenberg
Curl_readrewind() was called without checking its return code, which could lead to badness. Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
2011-08-07readwrite_data: improved C-E decoding error messageDaniel Stenberg
2011-07-26stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.hYang Tse
2011-07-25WIN32 io.h and fcntl.h inclusion done in setup_once.hYang Tse
2011-07-25time.h and sys/time.h inclusion conditionally done in setup_once.hYang Tse
2011-07-24errno.h inclusion conditionally done in setup_once.hYang Tse
2011-07-20http error response: stop sending when error is receivedDaniel Stenberg
When libcurl has said to the server that there's a POST or PUT coming (with a content-length and all) it has to either deliver that amount of data or it needs to close the connection before trying a second request. Adds test case 1129, 1130 and 1131 The bug report is about when used with 100-continue, but the change is more generic. Bug: http://curl.haxx.se/mail/lib-2011-06/0191.html Reported by: Steven Parkes
2011-06-07HTTP time condition: force closure for 200 OKDaniel Stenberg
When a time condition isn't met, so that no body is delivered to the application even though a 2xx response is being read from the server, we must close the connection to avoid a re-use of the connection to be completely tricked. Added test 1128 to verify.
2011-06-04Curl_socket_ready: make timeout a 'long'Daniel Stenberg
It was mostly typecasted to int all over the code so switching to long instead all over should be a net gain.
2011-05-18CLOSESOCKETFUNCTION: addedDaniel Stenberg
Introduced the initial setup to allow closesocket callbacks by making sure sclose() is only ever called from one place in the libcurl source and still run all test cases fine.
2011-05-06Fixed compilation when RTSP is disabledDan Fandrich
2011-05-05RTSP: cleanupsDaniel Stenberg
Made several functions static Made one function defined to nothing when RTSP is disabled to avoid the #ifdefs in code. Removed explicit rtsp.h includes
2011-05-05RTSP: convert protocol-specific checks to genericDaniel Stenberg
Add a 'readwrite' function to the protocol handler struct and use that for the extra readwrite functionality RTSP needs.
2011-05-04indent correctlyDaniel Stenberg
2011-04-27whitespace cleanup: no space first in conditionalsDaniel Stenberg
"if(a)" is our style, not "if( a )"
2011-04-27source cleanup: unify look, style and indent levelsDaniel Stenberg
By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
2011-04-25async resolvers: further cleanupsDaniel Stenberg
asyn-ares.c and asyn-thread.c are two separate backends that implement the same (internal) async resolver API for libcurl to use. Backend is specified at build time. The internal resolver API is defined in asyn.h for asynch resolvers.
2011-04-21Fix a couple of spelling errors in lib/Fabian Keil
Found with codespell.
2011-04-21transfer.c: Fixed indentation in readwrite_data.Julien Chaffraix
2011-04-20CURL_DOES_CONVERSIONS: fixesGisle Vanem
Made it compile and work again after the code move.
2011-04-20CURL_DOES_CONVERSIONS: cleanupDaniel Stenberg
Massively reduce #ifdefs all over (23 #ifdef lines less so far) Moved conversion-specific code to non-ascii.c
2011-04-18TE: rename struct field content_encodingDaniel Stenberg
Since this struct member is used in the code to determine what and how to decode automatically and since it is now also used for compressed Transfer-Encodings, I renamed it to the more suitable 'auto_decoding'
2011-04-07HTTP pipelining: Fix handling of zero-length responsesChris Smowton
Also add test case 584 for the same Bug: http://curl.haxx.se/bug/view.cgi?id=3214223
2011-03-29typo fixGisle Vanem
2011-03-21progress: don't print the last update on a separate line.Julien Chaffraix
Curl_posttransfer is called too soon to add the final new line. Moved the new line logic to pgrsDone as there is no more call to update the progress status after this call. Reported by: Dmitri Shubin <sbn_at_tbricks.com> http://curl.haxx.se/mail/lib-2010-12/0162.html
2011-03-20retry-request: rewind if data was sentDaniel Stenberg
When libcurl sends a HTTP request on a re-used connection and detects it being closed (ie no data at all was read from it), it is important to rewind if any data in the request was sent using the read callback or was read from file, as otherwise the retried request will be broken. Reported by: Chris Smowton Bug: http://curl.haxx.se/bug/view.cgi?id=3195205
2011-03-14protocols: use CURLPROTO_ internallyDaniel Stenberg
The PROT_* set of internal defines for the protocols is no longer used. We now use the same bits internally as we have defined in the public header using the CURLPROTO_ prefix. This is for simplicity and because the PROT_* prefix was already used duplicated internally for a set of KRB4 values. The PROTOPT_* defines were moved up to just below the struct definition within which they are used.
2011-03-14protocol handler: added flags fieldDaniel Stenberg
The protocol handler struct got a 'flags' field for special information and characteristics of the given protocol. This now enables us to move away central protocol information such as CLOSEACTION and DUALCHANNEL from single defines in a central place, out to each protocol's definition. It also made us stop abusing the protocol field for other info than the protocol, and we could start cleaning up other protocol-specific things by adding flags bits to set in the handler struct. The "protocol" field connectdata struct was removed as well and the code now refers directly to the conn->handler->protocol field instead. To make things work properly, the code now always store a conn->given pointer that points out the original handler struct so that the code can learn details from the original protocol even if conn->handler is modified along the way - for example when switching to go over a HTTP proxy.
2011-03-12readwrite_upload: stop upload at file sizeDaniel Stenberg
As we know how much to send, we can and should stop once we've sent that much data as it avoids having to rely on other mechanisms to detect the end. This is one of the problems detected by test 582. Reported by: Henry Ludemann <misc@hl.id.au>
2011-03-04transfer: avoid insane conversion of time_tStefan Krause
2011-01-31transfer: add Curl_meets_timecondition()Dave Reisner
This will be used by file_do() and Curl_readwrite() as a unified method of checking to see if a remote document meets the supplied CURLOPT_TIMEVAL and CURLOPT_TIMECONDITION. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-01-04Curl_timeleft: s/conn/data in first argumentDaniel Stenberg
As the function doesn't really use the connectdata struct but only the SessionHanadle struct I modified what argument it wants.
2010-12-20loadhostpairs: return errorcodeDaniel Stenberg
Make sure that Curl_cache_addr() errors are propagated to callers of loadhostpairs(). (this loadhostpairs function caused a scan-build warning due to the 'dns' variable getting assigned but never used)
2010-12-06url: provide dead_connection flag in Curl_handler::disconnectKamil Dudka
It helps to prevent a hangup with some FTP servers in case idle session timeout has exceeded. But it may be useful also for other protocols that send any quit message on disconnect. Currently used by FTP, POP3, IMAP and SMTP.
2010-11-08CURLOPT_RESOLVE: addedDaniel Stenberg
CURLOPT_RESOLVE is a new option that sends along a curl_slist with name:port:address sets that will populate the DNS cache with entries so that request can be "fooled" to use another host than what otherwise would've been used. Previously we've encouraged the use of Host: for that when dealing with HTTP, but this new feature has the added bonus that it allows the name from the URL to be used for TLS SNI and server certificate name checks as well. This is a first change. Surely more will follow to make it decent.
2010-09-17timeout: use the correct start value as offsetDaniel Stenberg
Rodric provide an awesome recipe that proved libcurl didn't timeout at the requested time - it instead often timed out at [connect time] + [timeout time] instead of the documented and intended [timeout time] only. This bug was due to the code using the wrong base offset when comparing against "now". I could also take the oppurtinity to simplify the code by properly using of the generic help function for this: Curl_timeleft. Reported by: Rodric Glaser Bug: http://curl.haxx.se/bug/view.cgi?id=3061535
2010-09-07chunky parser: only rewind if neededDaniel Stenberg
The code reading chunked encoding attempts to rewind the code if it had read more data than the chunky parser consumes. The rewinding can fail and it will then cause an error. This change now makes the rewinding only happen if pipelining is in use - as that's the only time it really needs to be done. Bug: http://curl.haxx.se/mail/lib-2010-08/0297.html Reported by: Ron Parker
2010-08-29multi: set timeouts when transfer beginsDaniel Stenberg
When a new transfer is about to start we now set the proper timeouts to expire for the multi interface if they are set for the handle. This is a follow-up bugfix to make sure that easy handles timeout properly when the times expire and the multi interface is used. This also improves curl_multi_timeout().
2010-08-06multi_socket: set timeout for 100-continueDaniel Stenberg
When libcurl internally decided to wait for a 100-continue header, there was no call to the timeout function so there was no timeout callback called when the multi_socket API was used and thus applications became either completely wrong or at least ineffecient depending on how they handled the situation. We now set a timeout to get triggered. Reported by: Ben Darnell Bug: http://curl.haxx.se/bug/view.cgi?id=3039744
2010-06-08transfer: warning: implicit conversionDaniel Stenberg
There is an implicit conversion from "unsigned long" to "long"; rounding, sign extension, or loss of accuracy may result. Fixed by an added typecast.