summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tool: add --unix-socket optionPeter Wu2014-12-045-0/+11
| | | | Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* libcurl: add UNIX domain sockets supportPeter Wu2014-12-0416-3/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ability to do HTTP requests over a UNIX domain socket has been requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a discussion happened, no patch seems to get through. I decided to give it a go since I need to test a nginx HTTP server which listens on a UNIX domain socket. One patch [3] seems to make it possible to use the CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket. Another person wrote a Go program which can do HTTP over a UNIX socket for Docker[4] which uses a special URL scheme (though the name contains cURL, it has no relation to the cURL library). This patch considers support for UNIX domain sockets at the same level as HTTP proxies / IPv6, it acts as an intermediate socket provider and not as a separate protocol. Since this feature affects network operations, a new feature flag was added ("unix-sockets") with a corresponding CURL_VERSION_UNIX_SOCKETS macro. A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This option enables UNIX domain sockets support for all requests on the handle (replacing IP sockets and skipping proxies). A new configure option (--enable-unix-sockets) and CMake option (ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I deliberately did not mark this feature as advanced, this is a feature/component that should easily be available. [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/ [2]: http://sourceforge.net/p/curl/feature-requests/53/ [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html [4]: https://github.com/Soulou/curl-unix-socket Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* tests: add two HTTP over UNIX socket testsPeter Wu2014-12-043-1/+133
| | | | | | | | | | | test1435: a simple test that checks whether a HTTP request can be performed over the UNIX socket. The hostname/port are interpreted by sws and should be ignored by cURL. test1436: test for the ability to do two requests to the same host, interleaved with one to a different hostname. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* tests: add HTTP UNIX socket server testing supportPeter Wu2014-12-045-16/+106
| | | | | | | | | The variable `$ipvnum` can now contain "unix" besides the integers 4 and 6 since the variable. Functions which receive this parameter have their `$port` parameter renamed to `$port_or_path` to support a path to the UNIX domain socket (as a "port" is only meaningful for TCP). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* sws: try to remove socket and retry bindPeter Wu2014-12-041-0/+42
| | | | | | | | | If sws is killed it might leave a stale socket file on the filesystem which would cause an EADDRINUSE error. After this patch, it is checked whether the socket is really stale and if so, the socket file gets removed and another bind is executed. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* sws: add UNIX domain socket supportPeter Wu2014-12-042-1/+61
| | | | | | | | | | | | | This extends sws with a --unix-socket option which causes the port to be ignored (as the server now listens on the path specified by --unix-socket). This feature will be available in the following patch that enables checking for UNIX domain socket support. Proxy support (CONNECT) is not considered nor tested. It does not make sense anyway, first connecting through a TCP proxy, then let that TCP proxy connect to a UNIX socket. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* sws: restrict TCP_NODELAY to IP socketsPeter Wu2014-12-041-29/+44
| | | | | | | TCP_NODELAY does not make sense for Unix sockets, so enable it only if the socket is using IP. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* curl.1: fix trivial typoDave Reisner2014-12-031-1/+1
|
* sasl_gssapi: Added body to Curl_sasl_create_gssapi_user_message()Steve Holme2014-12-031-7/+87
|
* sasl_gssapi: Added body to Curl_sasl_gssapi_cleanup()Steve Holme2014-12-031-1/+13
|
* sasl_gssapi: Added Curl_sasl_build_gssapi_spn() functionSteve Holme2014-12-031-0/+21
| | | | Added helper function for returning a GSS-API compatible SPN.
* NSS: enable the CAPATH optionDaniel Stenberg2014-12-031-0/+3
| | | | | Bug: http://curl.haxx.se/bug/view.cgi?id=1457 Patch-by: Tomasz Kojm
* sasl_gssapi: Enable USE_KERBEROS5 for GSS-API based buildsSteve Holme2014-12-033-4/+4
|
* sasl_gssapi: Added GSS-API based Kerberos V5 variablesSteve Holme2014-12-031-0/+5
|
* sws.c: Fixed compilation warning when IPv6 is disabledSteve Holme2014-12-031-2/+2
| | | | sws.c:69: warning: comma at end of enumerator list
* sasl_gssapi: Made log_gss_error() a common GSS-API functionSteve Holme2014-12-023-32/+48
| | | | | Made log_gss_error() a common function so that it can be used in both the http_negotiate code as well as the curl_sasl_gssapi code.
* sasl_gssapi: Introduced GSS-API based SASL moduleSteve Holme2014-12-025-5/+126
| | | | | Added the initial version of curl_sasl_gssapi.c and updated the project files in preparation for adding GSS-API based Kerberos V5 support.
* smb: Don't try to connect with empty credentialsSteve Holme2014-12-021-0/+4
| | | | | | | On some platforms curl would crash if no credentials were used. As such added detection of such a use case to prevent this from happening. Reported-by: Gisle Vanem
* smb.c: Coding policing of pointer usageSteve Holme2014-12-021-10/+10
|
* configure: Fixed inclusion of SMB when no crypto engines availableSteve Holme2014-12-021-1/+4
|
* build: in Makefile.m32 simplified autodetection.Guenter Knauf2014-12-012-4/+2
|
* sws: move away from IPv4/IPv4-only assumptionPeter Wu2014-11-301-49/+39
| | | | | | | | | | | | | | Instead of depending the socket domain type on use_ipv6, specify the domain type (AF_INET / AF_INET6) as variable. An enum is used here with switch to avoid compiler warnings in connect_to, complaining that rc is possibly undefined (which is not possible as socket_domain is always set). Besides abstracting the socket type, make the debugging messages be independent on IP (introduce location_str which points to "port XXXXX"). Rename "ipv_inuse" to "socket_type" and tighten the scope (main). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* lib/connect: restrict IP/TCP options to said socketsPeter Wu2014-11-301-11/+15
| | | | | | | | | | This patch prepares for adding UNIX domain sockets support. TCP_NODELAY and TCP_KEEPALIVE are specific to TCP/IP sockets, so do not apply these to other socket types. bindlocal only works for IP sockets (independent of TCP/UDP), so filter that out too for other types. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* smb.c: use size_t as input argument types for msg sizesDaniel Stenberg2014-11-301-2/+2
| | | | This fixes warnings about conversions to int
* version: The next release will become 7.40.0Steve Holme2014-11-302-5/+5
|
* docs: Updated for the SMB protocolBill Nagel2014-11-308-5/+42
| | | | This patch updates the documentation for the SMB/CIFS protocol.
* curl tool: Exclude SMB from the protocol redirectSteve Holme2014-11-301-2/+3
| | | | As local files could be accessed through \\localhost\c$.
* curl tool: Enable support for the SMB protocolBill Nagel2014-11-304-2/+7
| | | | This patch enables SMB/CIFS support in the curl command-line tool.
* smb.c: Fixed compilation warningsSteve Holme2014-11-301-2/+2
| | | | | | | smb.c:398: warning: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'unsigned long' smb.c:443: warning: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'unsigned long'
* libcurl: Exclude SMB from the protocol redirectSteve Holme2014-11-301-2/+3
| | | | As local files could be accessed through \\localhost\c$.
* libcurl: Enable support for the SMB protocolBill Nagel2014-11-302-0/+15
| | | | This patch enables SMB/CIFS support in libcurl.
* smb.c: Fixed compilation warningsSteve Holme2014-11-301-8/+8
| | | | | | | | | | | | | | | smb.c:322: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value smb.c:323: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value smb.c:482: warning: conversion to 'short unsigned int' from 'int' may alter its value smb.c:521: warning: conversion to 'unsigned int' from 'curl_off_t' may alter its value smb.c:549: warning: conversion to 'unsigned int' from 'curl_off_t' may alter its value smb.c:550: warning: conversion to 'short unsigned int' from 'int' may alter its value
* smb.c: Renamed SMB command message variables to avoid compiler warningsSteve Holme2014-11-301-75/+75
| | | | | | smb.c:489: warning: declaration of 'close' shadows a global declaration smb.c:511: warning: declaration of 'read' shadows a global declaration smb.c:528: warning: declaration of 'write' shadows a global declaration
* smb.c: Fixed compilation warningsSteve Holme2014-11-301-1/+7
| | | | | | | smb.c:212: warning: unused parameter 'done' smb.c:380: warning: ISO C does not allow extra ';' outside of a function smb.c:812: warning: unused parameter 'premature' smb.c:822: warning: unused parameter 'dead'
* smb.c: Fixed compilation warningsSteve Holme2014-11-301-3/+4
| | | | | | | | | smb.c:311: warning: conversion from 'unsigned __int64' to 'u_short', possible loss of data smb.c:425: warning: conversion from '__int64' to 'unsigned short', possible loss of data smb.c:452: warning: conversion from '__int64' to 'unsigned short', possible loss of data
* smb.c: Fixed compilation warningsSteve Holme2014-11-301-4/+4
| | | | | | | | | | smb.c:162: error: comma at end of enumerator list smb.c:469: warning: conversion from 'size_t' to 'unsigned short', possible loss of data smb.c:517: warning: conversion from 'curl_off_t' to 'unsigned int', possible loss of data smb.c:545: warning: conversion from 'curl_off_t' to 'unsigned int', possible loss of data
* smb: Added initial SMB functionalityBill Nagel2014-11-302-22/+724
| | | | Initial implementation of the SMB/CIFS protocol.
* smb: Added SMB handler interfacesBill Nagel2014-11-302-0/+129
| | | | | Added the SMB and SMBS handler interface structures and associated functions required for SMB/CIFS operation.
* transfer: Code style policingSteve Holme2014-11-301-4/+7
| | | | | Prefer ! rather than NULL in if statements, added comments and updated function spacing, argument spacing and line spacing to be more readble.
* transfer: Fixed existing scratch buffer being checked for NULL twiceSteve Holme2014-11-301-4/+5
| | | | | | | If the scratch buffer already existed when the CRLF conversion was performed then the buffer pointer would be checked twice for NULL. This second check is only necessary if the call to malloc() was performed by the first check.
* smtp: Fixed dot stuffing being performed when no new data readSteve Holme2014-11-301-8/+9
| | | | | | | | | | | | Whilst I had moved the dot stuffing code from being performed before CRLF conversion takes place to after it, in commit 4bd860a001, I had moved it outside the 'when something read' block of code when meant it could perform the dot stuffing twice on partial send if nread happened to contain the right values. It also meant the function could potentially read past the end of buffer. This was highlighted by the following warning: warning: `nread' might be used uninitialized in this function
* smb.h: fixed picky compiler warningDaniel Stenberg2014-11-291-1/+1
| | | | smb.h:30:16: error: comma at end of enumerator list [-Werror=pedantic]
* tests: Disable test 1013 until SMB is fully addedSteve Holme2014-11-291-0/+1
|
* smb: Added SMB protocol and port definitionsBill Nagel2014-11-294-0/+11
| | | | | Added the necessary protocol and port definitions in order to support SMB/CIFS.
* smb: Added internal SMB definitions and structuresBill Nagel2014-11-292-0/+214
| | | | | Added the internal definitions and structures necessary for SMB/CIFS support.
* smb: Added SMB connection structureBill Nagel2014-11-291-0/+22
| | | | | Added the connection structure that will be required in urldata.h for SMB/CIFS based connections.
* smb: Added initial source files for SMBBill Nagel2014-11-295-3/+62
| | | | | Added the initial source files and updated the relevant project files in order to support SMB/CIFS.
* smb: Added configuration options for SMBBill Nagel2014-11-291-0/+22
| | | | | Added --enable-smb and --disable-smb configuration options for the upcoming SMB/CIFS protocol support.
* runtests.pl: fix startup of IPv6 serversPeter Wu2014-11-281-7/+7
| | | | | | | | | | | | | | Commit curl-7_23_1-143-g8218064 changed the parameter of responsive_http_server to accept types other than IPv6 (converting from a boolean to a string), but only considered the lower-case "ipv6" and not the "IPv6" variant. This caused all servers to start in IPv4 mode instead. This patch converts the remaining cases to "ipv6". While not strictly necessary for the run*server variants, these got also converted for consistency and to prevent future errors. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* runtests.pl: fix warning message, remove duplicate valuePeter Wu2014-11-281-2/+2
| | | | Signed-off-by: Peter Wu <peter@lekensteyn.nl>