aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2010-09-22security.c: removed superfluous parenthesesDaniel Stenberg
And also removed the FIXME where memory was zeroed just before freed, and some other minor whitespace changes.
2010-09-22security.c: Update the #include statements after the rewrite.Julien Chaffraix
2010-09-22security.c: sec_write tweaksJulien Chaffraix
- |fd| is now a curl_socket_t and |len| a size_t to avoid conversions. - Added 2 FIXMEs about the 2 unsigned -> signed conversions. - Included 2 minor changes to Curl_sec_end.
2010-09-22security.c: _sec_send tweaksJulien Chaffraix
- Renamed the method to sec_send now that we renamed sec_send to do_sec_send. - Some more variable renaming.
2010-09-22security.c: sec_read tweaksJulien Chaffraix
- Renamed the function to sec_recv. - Renamed the parameters and variable to match the rest of the code.
2010-09-22security.c: Curl_sec_fflush_fd tweaksJulien Chaffraix
- Use an early return as it makes the code more readable. - Added a FIXME about a conversion.
2010-09-22security.c: sec_send tweaksJulien Chaffraix
- Renamed it to do_sec_send as it is the function doing the actual transfer. - Do not return any values as no one was checking it and it never reported a failure (added a FIXME about checking for errors). - Renamed the variables to make their use more specific. - Removed some casts (int -> curl_socket_t, ...) - Avoid doing the htnl <-> nthl twice by caching the 2 results.
2010-09-22security.c: Curl_sec_read_msg tweaksJulien Chaffraix
- Renamed the variables name to better match their intend. - Unified the |decoded_len| checks. - Added some FIXMEs to flag some improvement that did not go in this change.
2010-09-22security.c: Curl_sec_set_protection_level tweakingJulien Chaffraix
- Removed sec_prot_internal as it is now inlined in the function (this removed a redundant check). - Changed the prototype to return an error code. - Updated the method to use the new ftp_send_command function. - Added a level_to_char helper method to avoid relying on the compiler's bound checks. This default to the maximum security we have in case of a wrong input.
2010-09-22security.c: factored the logic from Curl_sec_login into a dedicated method ↵Julien Chaffraix
that better reflect its intent. Introduced a helper method ftp_send_command that synchronously send an FTP query.
2010-09-22security.c: Remove out_buffer as it was never written into.Julien Chaffraix
2010-09-22security.c: buffer_read various fixes.Julien Chaffraix
Tighten the type of the |data| parameter to avoid a cast. Also made it const as we should not modify it. Added a DEBUGASSERT on the size to be written while changing it.
2010-09-22security.c: Made block_write return a CURLcode.Julien Chaffraix
While doing so, renamed it to socket_write to better match its function.
2010-09-22security.c: Made block_read and sec_get_data return CURLcode.Julien Chaffraix
To do so, made block_read call Curl_read_plain instead of read. While changing them renamed block_read to socket_read and sec_get_data to read_data to better match their function. Also fixed a potential memory leak in block_read.
2010-09-22Security.c: Fix headers guard to match the rest of the code.Julien Chaffraix
2010-09-21parse_remote_port: ignore colons without port numberDaniel Stenberg
Obviously, browsers ignore a colon without a following port number. Both Firefox and Chrome just removes the colon for such URLs. This change does not remove the colon for URLs sent over a HTTP proxy, so we should consider doing that change as well. Reported by: github user 'kreshano'
2010-09-21duphandle: use ares_dup()Daniel Stenberg
curl_easy_duphandle() was not properly duping the ares channel. The ares_dup() function was introduced in c-ares 1.6.0 so by starting to use this function we also raise the bar and require c-ares >= 1.6.0 (released Dec 9, 2008) for such builds. Reported by: Ning Dong Bug: http://curl.haxx.se/mail/lib-2010-08/0318.html
2010-09-18FTP: fix bad check of Curl_timeleft() return codeDaniel Stenberg
When it returns 0 it means no timeout. Only a negative value means that we're out of time.
2010-09-18LDAP: moved variable declaration to avoid compiler warnDaniel Stenberg
If built without HTTP or proxy support it would cause a compiler warning due to the unused variable. I moved the declaration of it into the only scope it is used.
2010-09-18LDAP: Use FALSE instead of bool_false when setting bits.closeTor Arntsen
bool_false is the internal name used in the setup_once.h definition we fall back to for non-C99 non-stdbool systems, it's not the actual name to use in assignments (we use bool_false, bool_true there to avoid global namespace problems, see comment in setup_once.h). The correct C99 value to use is 'false', but let's use FALSE as used elsewhere when assigning to bits.close. FALSE is set equal to 'false' in setup_once.h when possible. This fixes a build problem on C99 targets.
2010-09-18LDAP: Add missing declaration for 'result'Tor Arntsen
2010-09-18LDAP: Support for tunnelling queries through HTTP proxyMauro Iorio
As of curl-7.21.1 tunnelling ldap queries through HTTP Proxies is not supported. Actually if --proxytunnel command-line option (or equivalent CURLOPT_HTTPPROXYTUNNEL) is used for ldap queries like ldap://ldap.my.server.com/... You are unable to successfully execute the query. In facts ldap_*_bind is executed directly against the ldap server and proxy is totally ignored. This is true for both openLDAP and Microsoft LDAP API. Step to reproduce the error: Just launch "curl --proxytunnel --proxy 192.168.1.1:8080 ldap://ldap.my.server.com/dc=... " This fix adds an invocation to Curl_proxyCONNECT against the provided proxy address and on successful "CONNECT" it tunnels ldap query to the final ldap server through the HTTP proxy. As far as I know Microsoft LDAP APIs don't permit tunnelling in any way so the patch provided is for OpenLDAP only. The patch has been developed against OpenLDAP 2.4.23 and has been tested with Microsoft ISA Server 2006 and works properly with basic, digest and NTLM authentication.
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-17Curl_timeleft: avoid returning "no timeout" by mistakeDaniel Stenberg
As this function uses return code 0 to mean that there is no timeout, it needs to check that it doesn't return a time left value that is exactly zero. It could lead to libcurl doing an extra 1000 ms select() call and thus not timing out as accurately as it should. I fell over this bug when working on the bug 3061535 but this fix does not correct that problem alone, although this is a problem that needs to be fixed. Reported by: Rodric Glaser Bug: http://curl.haxx.se/bug/view.cgi?id=3061535
2010-09-14multi: don't do extra expire calls for the connectionDaniel Stenberg
The timeout is set for the connect phase already at the start of the request so we should not add a new one, and we MUST not set expire to 0 as that will remove any other potentially existing timeouts.
2010-09-12inflate_stream: remove redundant check that is always trueDaniel Stenberg
2010-09-12digest: make it clear the condition is always trueDaniel Stenberg
2010-09-12ssluse: removed redundant check that is always trueDaniel Stenberg
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-09-06rtsp: avoid SIGSEGV on malformed headerKamil Dudka
2010-09-06rtsp: avoid SIGSEGV on malformed headerKamil Dudka
2010-09-06warning: fix conversion to 'int' from 'size_t'Daniel Stenberg
2010-09-06portabilty: use proper variable type to hold socketsDaniel Stenberg
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).
2010-09-03Trial to fix another compiler warning with braces.Guenter Knauf
2010-09-02Moved S_ISREG define to setup as suggested by Dan.Guenter Knauf
2010-09-02Use own typedef as workaround for broken sspi.h header (f.e. Watcom).Guenter Knauf
2010-09-02Added S_ISREG define for Win32.Guenter Knauf
2010-09-01multi: fixes for timing out handlesDaniel Stenberg
Add a timeout check for handles in the state machine so that they will timeout in all states disregarding what actions that may or may not happen. Fixed a bug in socket_action introduced recently when looping over timed out handles: it wouldn't assign the 'data' variable and thus it wouldn't properly take care of handles. In the update_timer function, the code now checks if the timeout has been removed and then it tells the application. Previously it would always let the remaining timeout(s) just linger to expire later on.
2010-09-01threaded resolver: no more expire 0 callsDaniel Stenberg
Curl_expire() set to 0 expires ALL timeouts so it should only be called if we truly and really want to remove all timeouts for the handle.
2010-09-01resolve_server: simplify codeDaniel Stenberg
Make use of the helper function Curl_timeleft() instead of duplicating code.
2010-08-31multi: make sure the next timeout is used when one expiresDaniel Stenberg
Each easy handle has a list of timeouts, so as soon as the main timeout for a handle expires, we must make sure to get the next entry from the list and re-add the handle to the splay tree. This was attempted previously but was done poorly in my commit 232ad6549a68450.
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-25Makefile: add gopher.c file to buildDaniel Stenberg
As the VC and RISCOS makefiles don't use the .inc file
2010-08-25gopher: enable the header callback/verbosityDaniel Stenberg
2010-08-25gopher: fix memory leak and busyloopDaniel Stenberg
The fix for the busyloop really only is a temporary work-around. It causes a BLOCKING behavior which is a NO-NO. This function should rather be split up in a do and a doing piece where the pieces that aren't possible to send now will be sent in the doing function repeatedly until the entire request is sent.
2010-08-25Gopher using Curl_write; test suite (4 tests)Cameron Kaiser
2010-08-25Remove url.c testCameron Kaiser
2010-08-25Forgot gopher.h in Makefile.incCameron Kaiser
2010-08-25Gopher protocol support (initial release)Cameron Kaiser
2010-08-25http: handle trailer headers in all chunked responsesDaniel Stenberg
HTTP allows that a server sends trailing headers after all the chunks have been sent WITHOUT signalling their presence in the first response headers. The "Trailer:" header is only a SHOULD there and as we need to handle the situation even without that header I made libcurl ignore Trailer: completely. Test case 1116 was added to verify this and to make sure we handle more than one trailer header properly. Reported by: Patrick McManus Bug: http://curl.haxx.se/bug/view.cgi?id=3052450