aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2010-09-28security.c: Fix Curl_sec_login after rewrite.Julien Chaffraix
Curl_sec_login was returning the opposite result that the code in ftp.c was expecting. Simplified the return code (using a CURLcode) so to see more clearly what is going on.
2010-09-28security.c: Readd the '\n' to the infof() calls.Julien Chaffraix
They are not automatically added and make the output of the verbose mode a lot more readable.
2010-09-28security.c: Fix typo (PSBZ -> PBSZ)Julien Chaffraix
2010-09-28security.c: Fix ftp_send_command.Julien Chaffraix
My use of va_args was completely wrong. Fixed the usage so that we send the right commands!
2010-09-28curl_easy_escape: don't escape "unreserved" charactersDaniel Stenberg
According to RFC3986 section 2.3 the letters -, ., _ and ~ should not be percent-encoded. Reported by: Miguel Diaz Bug: http://curl.haxx.se/mail/lib-2010-09/0227.html
2010-09-28multi: don't expire timeouts at disonnect or doneDaniel Stenberg
The functions Curl_disconnect() and Curl_done() are both used within the scope of a single request so they cannot be allowed to use Curl_expire(... 0) to kill all timeouts as there are some timeouts that are set before a request that are supposed to remain until the request is done. The timeouts are now instead cleared at curl_easy_cleanup() and when the multi state machine changes a handle to the complete state.
2010-09-27multi_runsingle: set timeout error messagesDirk Manske
With the latest changes to fix the timeout handling with multi interface we lost the timeout error messages. This patch brings them back.
2010-09-27parsedate: allow time specified without secondsDaniel Stenberg
The date format in RFC822 allows that the seconds part of HH:MM:SS is left out, but this function didn't allow it. This change also includes a modified test case that makes sure that this now works. Reported by: Matt Ford Bug: http://curl.haxx.se/bug/view.cgi?id=3076529
2010-09-26TFTP: re-indented the source codeDaniel Stenberg
Just made sure that the good old curl indentation style is used all over this file.
2010-09-26TFTP: Work around tftpd-hpa upload bugTim Newsome
tftpd-hpa has a bug where it will send an incorrect ack when the block counter wraps and tftp options have been sent. Work around that by accepting an ack for 65535 when we're expecting one for 0.
2010-09-24Revert "security.c: buffer_read various fixes."Daniel Stenberg
This reverts commit fbb38de415b7bb7d743e53a7b4b887ffb12b3e5b.
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.