aboutsummaryrefslogtreecommitdiff
path: root/lib/file.c
AgeCommit message (Collapse)Author
2012-12-14setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>Yang Tse
Inclusion of top two most included header files now done in setup_once.h
2012-11-13FILE: Make upload-writes unbuffered by not using FILE streamsSebastian Rasmussen
2012-07-30file: use fdopen() for uploaded files if availableKamil Dudka
It eliminates noisy events when using inotify and fixes a TOCTOU issue. Bug: https://bugzilla.redhat.com/844385
2011-11-24query-part: ignore the URI part for given protocolsJonas Schnelli
By setting PROTOPT_NOURLQUERY in the protocol handler struct, the protocol will get the "query part" of the URL cut off before the data is handled by the protocol-specific code. This makes libcurl adhere to RFC3986 section 2.2. Test 1220 is added to verify a file:// URL with query-part.
2011-11-03url.c and file.c: fix OOM triggered segfaultYang Tse
2011-10-21curl_multi_fdset: correct fdset with FTP PORT useDaniel Stenberg
After a PORT has been issued, and the multi handle would switch to the CURLM_STATE_DO_MORE state (which is unique for FTP), libcurl would return the wrong fdset to wait for when curl_multi_fdset() is called. The code would blindly assume that it was waiting for a connect of the second connection, while that isn't true immediately after the PORT command. Also, the function multi.c:domore_getsock() was highly FTP-centric and therefore ugly to keep in protocol-agnostic code. I solved this problem by introducing a new function pointer in the Curl_handler struct called domore_getsock() which is only called during the DOMORE state for protocols that set that pointer. The new ftp.c:ftp_domore_getsock() function now returns fdset info about the control connection's command/response handling while such a state is in use, and goes over to waiting for a writable second connection first once the commands are done. The original problem could be seen by running test 525 and checking the time stamps in the FTP server log. I can verify that this fix at least fixes this problem. Bug: http://curl.haxx.se/mail/lib-2011-10/0250.html Reported by: Gokhan Sengun
2011-10-21file.c: OOM handling fixYang Tse
file_disconnect() free's resources for multi API
2011-10-14file.c: fix compiler warningYang Tse
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-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-05remove FILE protocol-specific checksDaniel Stenberg
Also, convert the BANPROXY flag into NONETWORK for the protocols (file:// only atm) that don't work over networks.
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-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-04transfer: avoid insane conversion of time_tStefan Krause
2011-02-07Curl_gmtime: added a portable gmtimeDaniel Stenberg
Instead of polluting many places with #ifdefs, we create a single place for this function, and also check return code properly so that a NULL pointer returned won't cause problems.
2011-01-31file: add support for CURLOPT_TIMECONDITIONDave Reisner
2010-11-26s/isspace/ISSPACEYang Tse
2010-04-16file_range: remove unnecessary check for NULL pointerDaniel Stenberg
2010-04-16file_range: Value stored to 'totalsize' is never readDaniel Stenberg
2010-03-24remove the CVSish $Id$ linesDaniel Stenberg
2009-11-18Make usage of calloc()'s arguments consistent with rest of code baseYang Tse
2009-06-04allow building libcurl for VxWorksYang Tse
2009-04-21libcurl's memory.h renamed to curl_memory.hYang Tse
2009-02-03- Hidemoto Nakada provided a small fix that makes it possible to get theDaniel Stenberg
CURLINFO_CONTENT_LENGTH_DOWNLOAD size from file:// "transfers" with CURLOPT_NOBODY set true.
2008-12-19- Using the libssh2 0.19 function libssh2_session_block_directions(), libcurlDaniel Stenberg
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.
2008-11-14Added some #ifdefs around header files and change the EAGAIN test toDan Fandrich
fix compilation on Cell (reported by Jeff Curley).
2008-11-04CURLINFO_FILETIME now works for file:// transfers as wellDaniel Stenberg
2008-09-29Removed unneeded includes of signal.h and setjmp.hDan Fandrich
2008-09-12ANSI C compatibility fixYang Tse
2008-09-10Checked in some code improvements and minor fixes that I discovered in theDan Fandrich
FreeBSD ports system.
2008-09-06remove unnecessary typecasting of calloc()Yang Tse
2008-08-16Library internal only C preprocessor macros FORMAT_OFF_T and FORMAT_OFF_TUYang Tse
remain in use as internal curl_off_t print formatting strings for the internal *printf functions which still cannot handle print formatting string directives such as "I64d", "I64u", and others available on MSVC, MinGW, Intel's ICC, and other DOS/Windows compilers. This reverts previous commit part which did: FORMAT_OFF_T -> CURL_FORMAT_CURL_OFF_T FORMAT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU
2008-08-15For congruency sake with the naming of other CURL_XXXXXX_CURL_OFF_T macros,Yang Tse
the names of the curl_off_t formatting string directives now become CURL_FORMAT_CURL_OFF_T and CURL_FORMAT_CURL_OFF_TU. CURL_FMT_OFF_T -> CURL_FORMAT_CURL_OFF_T CURL_FMT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU Remove the use of an internal name for the curl_off_t formatting string directives and use the common one available from the inside and outside of the library. FORMAT_OFF_T -> CURL_FORMAT_CURL_OFF_T FORMAT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU
2008-05-21Renamed MSDOS_FILESYSTEM to avoid conflict with MIT GSSDan Fandrich
2008-04-22Added support for running on Symbian OS.Dan Fandrich
2008-04-17Some trivial changesDan Fandrich
2008-01-31- Dmitry Kurochkin moved several struct fields from the connectdata struct toDaniel Stenberg
the SingleRequest one to make pipelining better. It is a bit tricky to keep them in the right place, to keep things related to the actual request or to the actual connection in the right place.
2008-01-11fix compiler warningYang Tse
2008-01-11Daniel Egger made CURLOPT_RANGE work on file:// URLs the very same way itDaniel Stenberg
already worked for FTP:// URLs
2007-12-08All static functions that were previously name Curl_* something no longerDaniel Stenberg
use that prefix as we use that prefix only for library-wide internal global symbols.
2007-11-24struct HandleData is now called struct SingleRequest, and is only for data thatDaniel Stenberg
is inited at the start of the DO action. I removed the Curl_transfer_keeper struct completely, and I had to move out a few struct members (that had to be set before DO or used after DONE) to the UrlState struct. The SingleRequest struct is accessed with SessionHandle->req. One of the biggest reasons for doing this was the bunch of duplicate struct members in HandleData and Curl_transfer_keeper since it was really messy to keep track of two variables with the same name and basically the same purpose!
2007-11-15Rearranged code and changed Curl_readwrite_init() and Curl_pre_readwrite() intoDaniel Stenberg
do_init() and do_complete() which now are called first and last in the DO function. It simplified the flow in multi.c and the functions got more sensible names!
2007-11-07if () => if()Daniel Stenberg
while () => while() and some other minor re-indentings
2007-10-30Fixed an OOM problem with file: URLsDan Fandrich
Moved Curl_file_connect into the protocol handler struct.
2007-10-23File is not a protocol that can deal with "persistancy"Yang Tse
2007-10-22Michal Marek forwarded the bug reportDaniel Stenberg
https://bugzilla.novell.com/show_bug.cgi?id=332917 about a HTTP redirect to FTP that caused memory havoc. His work together with my efforts created two fixes: #1 - FTP::file was moved to struct ftp_conn, because is has to be dealt with at connection cleanup, at which time the struct HandleData could be used by another connection. Also, the unused char *urlpath member is removed from struct FTP. #2 - provide a Curl_reset_reqproto() function that frees data->reqdata.proto.* on connection setup if needed (that is if the SessionHandle was used by a different connection).