summaryrefslogtreecommitdiff
path: root/lib/connect.h
Commit message (Collapse)AuthorAgeFilesLines
* connect: fix unreferenced parameter warningMarcel Raad2017-03-301-3/+3
| | | | | When CURL_DISABLE_VERBOSE_STRINGS is defined, the reason parameter in Curl_conncontrol is not used as the infof macro expands to nothing.
* http_proxy: Fix proxy CONNECT hang on pending dataJay Satiro2016-12-191-0/+2
| | | | | | | - Check for pending data before waiting on the socket. Bug: https://github.com/curl/curl/issues/1156 Reported-by: Adam Langley
* Curl_getconnectinfo: avoid checking if the connection is closedIsaac Boukris2016-12-181-0/+5
| | | | | | | | | | It doesn't benefit us much as the connection could get closed at any time, and also by checking we lose the ability to determine if the socket was closed by reading zero bytes. Reported-by: Michael Kaufmann Closes https://github.com/curl/curl/pull/1134
* lib: fix compiler warnings after de4de4e3c7cMarcel Raad2016-11-181-3/+3
| | | | | | | | | Visual C++ now complains about implicitly casting time_t (64-bit) to long (32-bit). Fix this by changing some variables from long to time_t, or explicitly casting to long where the public interface would be affected. Closes #1131
* connect: fix #ifdefs for debug versions of conn/streamclose() macrosDaniel Stenberg2016-08-301-2/+2
| | | | | | | | CURLDEBUG is for the memory debugging DEBUGBUILD is for the extra debug stuff Pointed-out-by: Steve Holme
* http2: make sure stream errors don't needlessly close the connectionDaniel Stenberg2016-08-281-12/+28
| | | | | | | | With HTTP/2 each transfer is made in an indivial logical stream over the connection, making most previous errors that caused the connection to get forced-closed now instead just kill the stream and not the connection. Fixes #941
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-3/+3
|
* URLs: change more http to httpsViktor Szakats2016-02-041-1/+1
|
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* http2: set TCP_NODELAY unconditionallyDaniel Stenberg2015-09-271-1/+3
| | | | | | For a single-stream download from localhost, we managed to increase transfer speed from 1.6MB/sec to around 400MB/sec, mostly because of this single fix.
* code/docs: Use correct case for IPv4 and IPv6Steve Holme2014-12-271-1/+1
| | | | | | For consistency, as we seem to have a bit of a mixed bag, changed all instances of ipv4 and ipv6 in comments and documentations to use the correct case.
* bits.close: introduce connection close trackingDaniel Stenberg2014-05-221-1/+18
| | | | | | | Make all code use connclose() and connkeep() when changing the "close state" for a connection. These two macros take a string argument with an explanation, and debug builds of curl will include that in the debug output. Helps tracking connection re-use/close issues.
* connect.h: Updated copyright year for last editSteve Holme2013-11-051-1/+1
|
* connect: Add connection delay to Happy Eyeballs.Björn Stenberg2013-11-041-3/+3
| | | | | | | | | | | | This patch adds a 200ms delay between the first and second address family socket connection attempts. It also iterates over IP addresses in the order returned by the system, meaning most dual-stack systems will try IPv6 first. Additionally, it refactors the connect code, removing most code that handled synchronous connects. Since all sockets are now non-blocking, the logic can be made simpler.
* Add "Happy Eyeballs" for IPv4/IPv6.Björn Stenberg2013-10-271-2/+0
| | | | | | | | | This patch invokes two socket connect()s nearly simultaneously, and the socket that is first connected "wins" and is subsequently used for the connection. The other is terminated. There is a very slight IPv4 preference, in that if both sockets connect simultaneously IPv4 is checked first and thus will win.
* build: fix circular header inclusion with other packagesYang Tse2013-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit renames lib/setup.h to lib/curl_setup.h and renames lib/setup_once.h to lib/curl_setup_once.h. Removes the need and usage of a header inclusion guard foreign to libcurl. [1] Removes the need and presence of an alarming notice we carried in old setup_once.h [2] ---------------------------------------- 1 - lib/setup_once.h used __SETUP_ONCE_H macro as header inclusion guard up to commit ec691ca3 which changed this to HEADER_CURL_SETUP_ONCE_H, this single inclusion guard is enough to ensure that inclusion of lib/setup_once.h done from lib/setup.h is only done once. Additionally lib/setup.h has always used __SETUP_ONCE_H macro to protect inclusion of setup_once.h even after commit ec691ca3, this was to avoid a circular header inclusion triggered when building a c-ares enabled version with c-ares sources available which also has a setup_once.h header. Commit ec691ca3 exposes the real nature of __SETUP_ONCE_H usage in lib/setup.h, it is a header inclusion guard foreign to libcurl belonging to c-ares's setup_once.h The renaming this commit does, fixes the circular header inclusion, and as such removes the need and usage of a header inclusion guard foreign to libcurl. Macro __SETUP_ONCE_H no longer used in libcurl. 2 - Due to the circular interdependency of old lib/setup_once.h and the c-ares setup_once.h header, old file lib/setup_once.h has carried back from 2006 up to now days an alarming and prominent notice about the need of keeping libcurl's and c-ares's setup_once.h in sync. Given that this commit fixes the circular interdependency, the need and presence of mentioned notice is removed. All mentioned interdependencies come back from now old days when the c-ares project lived inside a curl subdirectory. This commit removes last traces of such fact.
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: rename 76 lib/*.h filesYang Tse2012-12-281-107/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 76 private header files renamed to use our standard naming scheme. This commit only does the file renaming. ---------------------------------------- renamed: amigaos.h -> curl_amigaos.h renamed: arpa_telnet.h -> curl_arpa_telnet.h renamed: asyn.h -> curl_asyn.h renamed: axtls.h -> curl_axtls.h renamed: bundles.h -> curl_bundles.h renamed: conncache.h -> curl_conncache.h renamed: connect.h -> curl_connect.h renamed: content_encoding.h -> curl_content_encoding.h renamed: cookie.h -> curl_cookie.h renamed: cyassl.h -> curl_cyassl.h renamed: dict.h -> curl_dict.h renamed: easyif.h -> curl_easyif.h renamed: escape.h -> curl_escape.h renamed: file.h -> curl_file.h renamed: fileinfo.h -> curl_fileinfo.h renamed: formdata.h -> curl_formdata.h renamed: ftp.h -> curl_ftp.h renamed: ftplistparser.h -> curl_ftplistparser.h renamed: getinfo.h -> curl_getinfo.h renamed: gopher.h -> curl_gopher.h renamed: gtls.h -> curl_gtls.h renamed: hash.h -> curl_hash.h renamed: hostcheck.h -> curl_hostcheck.h renamed: hostip.h -> curl_hostip.h renamed: http.h -> curl_http.h renamed: http_chunks.h -> curl_http_chunks.h renamed: http_digest.h -> curl_http_digest.h renamed: http_negotiate.h -> curl_http_negotiate.h renamed: http_proxy.h -> curl_http_proxy.h renamed: if2ip.h -> curl_if2ip.h renamed: imap.h -> curl_imap.h renamed: inet_ntop.h -> curl_inet_ntop.h renamed: inet_pton.h -> curl_inet_pton.h renamed: krb4.h -> curl_krb4.h renamed: llist.h -> curl_llist.h renamed: memdebug.h -> curl_memdebug.h renamed: multiif.h -> curl_multiif.h renamed: netrc.h -> curl_netrc.h renamed: non-ascii.h -> curl_non-ascii.h renamed: nonblock.h -> curl_nonblock.h renamed: nssg.h -> curl_nssg.h renamed: parsedate.h -> curl_parsedate.h renamed: pingpong.h -> curl_pingpong.h renamed: polarssl.h -> curl_polarssl.h renamed: pop3.h -> curl_pop3.h renamed: progress.h -> curl_progress.h renamed: qssl.h -> curl_qssl.h renamed: rawstr.h -> curl_rawstr.h renamed: rtsp.h -> curl_rtsp.h renamed: select.h -> curl_select.h renamed: sendf.h -> curl_sendf.h renamed: setup.h -> curl_setup.h renamed: setup_once.h -> curl_setup_once.h renamed: share.h -> curl_share.h renamed: slist.h -> curl_slist.h renamed: smtp.h -> curl_smtp.h renamed: sockaddr.h -> curl_sockaddr.h renamed: socks.h -> curl_socks.h renamed: speedcheck.h -> curl_speedcheck.h renamed: splay.h -> curl_splay.h renamed: ssh.h -> curl_ssh.h renamed: sslgen.h -> curl_sslgen.h renamed: ssluse.h -> curl_ssluse.h renamed: strdup.h -> curl_strdup.h renamed: strequal.h -> curl_strequal.h renamed: strerror.h -> curl_strerror.h renamed: strtok.h -> curl_strtok.h renamed: strtoofft.h -> curl_strtoofft.h renamed: telnet.h -> curl_telnet.h renamed: tftp.h -> curl_tftp.h renamed: timeval.h -> curl_timeval.h renamed: transfer.h -> curl_transfer.h renamed: url.h -> curl_url.h renamed: urldata.h -> curl_urldata.h renamed: warnless.h -> curl_warnless.h renamed: wildcard.h -> curl_wildcard.h ----------------------------------------
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-3/+3
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* timeleft_accept: ack global timeout, moved to ftp.cDaniel Stenberg2011-12-201-5/+0
| | | | | | First off the timeout for accepting a server connect back must of course respect a global timeout. Then the timeleft function is only used by ftp code so it was moved to ftp.c and made static.
* FTP: perform active connections non-blockingGokhan Sengun2011-12-201-0/+5
| | | | | | | | | | | | | | | | | | | | 1- Two new error codes are introduced. CURLE_FTP_ACCEPT_FAILED to be set whenever ACCEPTing fails because of FTP server connected. CURLE_FTP_ACCEPT_TIMEOUT to be set whenever ACCEPTing timeouts. Neither of these errors are considered fatal and control connection remains OK because it could just be a firewall blocking server to connect to the client. 2- One new setopt option was introduced. CURLOPT_ACCEPTTIMEOUT_MS It sets the maximum amount of time FTP client is going to wait for a server to connect. Internal default accept timeout is 60 seconds.
* Curl_socket: internal replacement for socket()Daniel Stenberg2011-12-051-0/+32
| | | | | Moved out into a separate function to work as a "generic" socket() replacement.
* fix a bunch of MSVC compiler warningsYang Tse2011-09-031-1/+2
|
* BSD-style lwIP TCP/IP stack support - followupYang Tse2011-08-071-4/+5
| | | | lwIP library initialization.
* CLOSESOCKETFUNCTION: addedDaniel Stenberg2011-05-181-2/+1
| | | | | | 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.
* Curl_timeleft: s/conn/data in first argumentDaniel Stenberg2011-01-041-2/+2
| | | | | As the function doesn't really use the connectdata struct but only the SessionHanadle struct I modified what argument it wants.
* fix getinfo CURLINFO_LOCAL* for reused connections (take 2)Yang Tse2010-11-301-0/+2
|
* portabilty: use proper variable type to hold socketsDaniel Stenberg2010-09-061-4/+3
| | | | | | Curl_getconnectinfo() is changed to return a proper curl_socket_t for the last socket so that it'll work more portably (and cause less compiler warnings).
* Curl_updateconninfo() error handling fixYang Tse2010-06-071-1/+1
|
* getinfo: added *_PRIMARY_PORT, *_LOCAL_IP and *_LOCAL_PORTFrank Meier2010-06-051-1/+3
|
* remove the CVSish $Id$ linesDaniel Stenberg2010-03-241-1/+0
|
* - Eric Wong introduced curlx_nonblock() that the curl tool now (re-)uses forDaniel Stenberg2009-07-091-2/+1
| | | | | setting a file descriptor non-blocking. Used by the functionality Eric himself brough on June 15th.
* - Made the SO_SNDBUF setting for the data connection socket for ftp uploads asDaniel Stenberg2009-05-071-1/+17
| | | | well. See change 28 Apr 2009.
* - Bug #2218480 (http://curl.haxx.se/bug/view.cgi?id=2218480) pointed out aDaniel Stenberg2008-11-031-2/+0
| | | | | | | problem with my CURLINFO_PRIMARY_IP fix from October 7th that caused a NULL pointer read. I also took the opportunity to clean up this logic (storing of the connection's IP address) somewhat as we had it stored in two different places and ways previously and they are now unified.
* - Introducing curl_easy_send() and curl_easy_recv(). They can be used to sendDaniel Stenberg2008-05-121-0/+9
| | | | | | and receive data over a connection previously setup with curl_easy_perform() and its CURLOPT_CONNECT_ONLY option. The sendrecv.c example was added to show how they can be used.
* - Refactored a lot of timeout code into a few functions in an attempt to makeDaniel Stenberg2008-02-071-4/+10
| | | | | them all use the same (hopefully correct) logic to make it less error-prone and easier to introduce library-wide where it should be used.
* use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handlingYang Tse2007-02-161-3/+1
|
* Constify some arguments in Curl_connecthost() and singleipconnect().Gisle Vanem2006-07-211-1/+1
|
* Roland Blom filed bug report #1481217Daniel Stenberg2006-05-041-2/+2
| | | | | | | | | | | (http://curl.haxx.se/bug/view.cgi?id=1481217), with follow-ups by Michele Bini and David Byron. libcurl previously wrongly used GetLastError() on windows to get error details after socket-related function calls, when it really should use WSAGetLastError() instead. When changing to this, the former function Curl_ourerrno() is now instead called Curl_sockerrno() as it is necessary to only use it to get errno from socket-related functions as otherwise it won't work as intended on Windows.
* conn->ip_addr MUST NOT be used on re-used connectionsDaniel Stenberg2005-01-291-1/+3
|
* make the SSL connect use the same default connect timeout define as theDaniel Stenberg2004-06-301-0/+3
| | | | generic connect uses
* corrected the Curl_is_connected() protoDaniel Stenberg2004-06-291-6/+6
|
* Source cleanups. The major one being that we now _always_ use a Curl_addrinfoDaniel Stenberg2004-06-241-2/+1
| | | | | linked list for name resolved data, even on hosts/systems with only IPv4 stacks as this simplifies a lot of code.
* Use curl_socket_t instead of int for holding sockets. The typedefs andDaniel Stenberg2004-03-091-3/+3
| | | | defines are in setup.h.
* updated year in the copyright stringDaniel Stenberg2004-01-071-1/+1
|
* gcc -Wshadow complaints fixedDaniel Stenberg2003-10-181-1/+1
|
* ourerrno became Curl_ourerrno() and is now available to all libcurlDaniel Stenberg2003-05-011-0/+2
|
* copyright year update in the source headerDaniel Stenberg2003-01-161-1/+1
|
* Curl_resolv() now returns a different struct, and it contains a referenceDaniel Stenberg2002-11-051-1/+1
| | | | | | | | counter so that the caller needs to decrease that counter when done with the returned data. If compiled with MALLOCDEBUG I've added some extra checking that the counter is decreased before a handle is closed etc.
* updated source code boilerplate/headerDaniel Stenberg2002-09-031-7/+7
|