Commit Graph

361 Commits

Author SHA1 Message Date
Andrew Talbot bc8d8e5211 wininet: Sign-compare warnings fix. 2008-12-08 22:03:00 +01:00
Hans Leidekker 2ac52b0eee wininet: Stop leaking username and password. 2008-12-03 09:46:45 +01:00
Hans Leidekker a57cc6dcf6 wininet: Support setting username and password options on request handles. 2008-12-03 09:46:30 +01:00
Hans Leidekker d1076aeab4 wininet: Don't increase index in HttpQueryInfo if requested level is HTTP_QUERY_STATUS_CODE.
Some apps depend on this quirk because they don't reset the index
before subsequent calls to HttpQueryInfo.
2008-12-02 14:03:54 +01:00
Michael Stefaniuc e6bd2881d8 wininet: Remove some superfluous casts. 2008-12-01 12:57:03 +01:00
Francois Gouget 523679666d wininet: Remove WINAPI on static functions where not needed. 2008-11-25 11:50:08 +01:00
Lei Zhang be2570f7a0 wininet: Handle HTTP 303 redirects. 2008-11-05 10:55:40 +01:00
Lei Zhang 905f628c05 wininet: Remove redundant variables. 2008-11-05 10:55:36 +01:00
Marcus Meissner 2d5ca30994 wininet: Removed redundant NULL check (Coverity). 2008-11-03 11:50:10 +01:00
Hans Leidekker bd80529709 wininet: Add an exception handler in HttpOpenRequestA to protect against invalid accept type pointers. 2008-10-24 14:25:00 +02:00
Hans Leidekker d5dca63cb6 wininet: Don't destroy authentication data when closing the connection.
Fixes basic authentication in combination with connection close semantics.
Spotted by Vincent Povirk.
2008-10-17 14:12:33 +02:00
Jan-Peter Nilsson b261836709 wininet: Fix HTTP_ProcessCookies only processing one cookie. 2008-10-08 14:17:08 +02:00
Rob Shearman 0715d9c123 wininet: Fix crash when calling HttpQueryInfoA/W(HTTP_QUERY_RAW_HEADERS) before any response has been received from a server. 2008-10-08 12:17:11 +02:00
Hans Leidekker 128b8a5e0c wininet: Avoid a crash on certain buffer size queries in HTTP_HttpQueryInfoW. 2008-10-07 12:03:12 +02:00
Rob Shearman d31ce9ae37 wininet: Compare HRESULT values explicitly against S_OK instead of using an implicit != 0 comparison. 2008-10-01 11:43:30 -05:00
Hans Leidekker 8c20124fc4 wininet: Support setting username and password through options. 2008-09-25 11:51:41 +02:00
Lei Zhang f7e56d19c4 wininet: Remove redundant CrLf variables. 2008-08-28 11:24:50 +02:00
Lei Zhang bc9e214f6f wininet: Work around NULL headers when handling HTTP_QUERY_RAW_HEADERS_CRLF. 2008-08-28 11:24:50 +02:00
Vincent Povirk 17c0c0a54b wininet: Default to keep-alive when the server is HTTP/1.1, not when it isn't. 2008-08-19 14:56:06 +02:00
Dan Kegel 1e7f89194c wininet: HTTP_QUERY_RAW_HEADERS_CRLF length shouldn't include nul. 2008-07-31 14:02:04 +02:00
Hans Leidekker 216d4c0834 wininet: Fix cookie buffer overflow.
Spotted by Yann Droneaud.
2008-07-21 12:22:05 +02:00
Hans Leidekker 572b0bab88 wininet: Move insertion of cookie header from HttpOpenRequest to HttpSendRequest.
Based on a patch by Yann Droneaud.
2008-07-21 12:21:58 +02:00
Hans Leidekker e3e2622e41 wininet: Fix a memory leak. 2008-07-21 12:21:27 +02:00
Jacek Caban 7426e7e055 wininet: Moved more InternetQueryOption implementation to vtbl. 2008-07-21 12:18:48 +02:00
Jacek Caban 13a95f1648 wininet: Move InternetQueryOption(INTERNET_OPTION_USER_AGENT) to vtbl. 2008-07-21 12:18:41 +02:00
Vincent Povirk fd5b97bc4d wininet: Always respect Proxy-Connection: or Connection: if it exists. 2008-07-17 10:51:26 +02:00
Alexander Morozov 4f51b6c1d8 wininet: Add port number to Host HTTP header. 2008-07-07 14:16:07 +02:00
Alexander Morozov ad2f53db8f wininet: Add support of INTERNET_FLAG_NO_CACHE_WRITE. 2008-07-07 14:16:07 +02:00
Alexander Morozov 70218092bb wininet: Remove unneeded variable. 2008-07-04 19:50:58 +02:00
Hans Leidekker bdf311f91f wininet: Only reconnect when redirected to an external site. 2008-06-30 15:08:47 +02:00
Hans Leidekker 6233704481 wininet: Resolve hostname once per connection. 2008-06-24 11:45:18 +02:00
Hans Leidekker 34ff555cf9 wininet: Send a 'Pragma: no-cache' header if asked for. 2008-06-24 11:45:10 +02:00
Hans Leidekker 3434935f44 wininet: Clear last error upon successful return from HttpSendRequest. 2008-06-24 11:44:57 +02:00
Rob Shearman 62e0a8ca38 wininet: Fix memory leak in HTTP_DeleteCustomHeader.
Free the memory associated with the field and value of the custom
header otherwise it will be leaked. Found by Valgrind.
2008-06-21 11:12:50 +02:00
Colin Finck bbd550ad5c wininet: Always pass a variable as lpNumberOfBytesWritten on a WriteFile call if lpOverlapped is set to NULL. 2008-06-19 11:47:03 +02:00
Hans Leidekker 656a035821 wininet: Don't send a "Connection: Close" header. 2008-06-02 14:05:32 +02:00
Hans Leidekker 2f99450c49 wininet: Make resolving hostnames thread-safe. 2008-06-02 13:44:31 +02:00
Lei Zhang bd58463eda wininet: Send https scheme to proxy server when appropriate. 2008-05-22 11:44:29 +02:00
Hans Leidekker 694a09284a wininet: Fix buffer size query for HttpQueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF). 2008-05-19 14:04:10 +02:00
Hans Leidekker e1b889830d wininet: INTERNET_STATUS_REQUEST_COMPLETE callback must supply a handle. 2008-05-19 13:35:24 +02:00
Rob Shearman 6021fa09f3 wininet: Fix a typo in is_basic_auth_value.
This fixes basic authentication when the server uses a realm string.
2008-05-19 13:35:19 +02:00
Hans Leidekker 1c5bc9a772 wininet: HTTP_BuildProxyRequestUrl returns a pointer. 2008-05-12 14:01:06 +02:00
Hans Leidekker aec0e93d23 wininet: Don't overwrite content length header in HttpSendRequest. 2008-05-12 14:00:51 +02:00
Hans Leidekker 493b6915ca wininet: Deal with bogus accept types array passed into HttpOpenRequestA. 2008-05-07 17:49:31 +02:00
Andrew Talbot 07ae2992b8 wininet: Remove unused variables. 2008-05-05 12:52:26 +02:00
Hans Leidekker e2f690a0ac wininet: Don't add the user agent header until HttpSendRequest is called. 2008-05-05 12:51:56 +02:00
Dan Hipschman d3051cba22 wininet: Don't forget the INTERNET_STATUS_REDIRECT callback in HttpEndRequest. 2008-04-24 12:03:34 +02:00
Dan Hipschman a1ebffb452 wininet: Remove custom content-length/type headers from redirects. 2008-04-23 12:23:39 +02:00
Austin English 6e59cd2c34 Spelling fixes. 2008-04-22 12:20:12 +02:00
Aric Stewart bade2a31a6 wininet: Correct the case where Content-Length is set as well as Transfer-Encoding == chunked. 2008-04-18 11:45:52 +02:00
Alexandre Julliard 631f469cb5 wininet: Avoid size_t type in trace. 2008-04-04 13:12:21 +02:00
Hans Leidekker 612f3c1414 wininet: Use INTERNET_MAX_URL_LENGTH to size buffers we intend to store a URL in. 2008-04-01 11:27:03 +02:00
Hans Leidekker 8210e1b454 wininet: Parse the redirect URL in HTTP_HandleRedirect in case of a proxy connection. 2008-04-01 11:26:52 +02:00
Hans Leidekker 729631d907 wininet: Remove dead code from HTTP_DealWithProxy and improve its debug trace. 2008-04-01 11:26:42 +02:00
Hans Leidekker e4c59c263d wininet: Don't set the host port from the server port.
This works for direct connections but in case of proxy connections server
port and host port usually are different.
2008-03-31 13:00:42 +02:00
Hans Leidekker 0ffe9f5207 wininet: Fix redirects through a proxy.
HTTP_DealWithProxy replaces the request path with a full URL to make sure
a correct request is built for for the proxy. This will work just once in
case of a redirect because the path will be appended to the redirect url,
resulting in an incorrect url.
2008-03-31 13:00:32 +02:00
Hans Leidekker 454fae8432 wininet: Don't close proxy connections when keep-alive is specified. 2008-03-31 13:00:18 +02:00
Dan Hipschman 0929593b6c wininet: InternetReadFileExA should check INTERNET_FLAG_ASYNC. 2008-03-28 09:50:42 +01:00
Dan Hipschman aaecdf79bd wininet: HttpSendRequestExA is not a stub. 2008-03-28 09:50:38 +01:00
Hans Leidekker 058761fa34 wininet: Support chunked reads in InternetReadFileEx too. 2008-03-26 23:48:13 +01:00
Hans Leidekker 0936601f5b wininet: Implement chunked reads. 2008-03-26 13:46:12 +01:00
Hans Leidekker 3a57711bb8 wininet: Don't strip Accept-Encoding headers from version 1.1 requests. 2008-03-25 11:33:32 +01:00
Rob Shearman db5745c001 wininet: If we receive an error from InitializeSecurityContext in HTTP_DoAuthorization then set pAuthInfo->finished so that we don't carry on using the security context. 2008-03-15 10:58:38 +01:00
Rob Shearman e74514b138 wininet: Assume that if we're connected to an HTTP/1.1 server then connections can be kept alive by default.
So don't close the connection in this case in HTTP_FinishedReading.
2008-03-15 10:58:38 +01:00
Rob Shearman ebaa4d987d wininet: Only clear authentication header if the connection has authentication information. 2008-03-12 17:55:21 +01:00
Rob Shearman b8ad4dee86 wininet: Fix proxy authentication by using the data in lpwhr->pProxyAuthInfo in HTTP_InsertAuthorization instead of lpwhr->pAuthInfo when inserting the Proxy-Authentication header. 2008-03-12 17:55:12 +01:00
Jacek Caban 7e63f95326 wininet: Move InternetQueryOption(INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT) to vtbl. 2008-03-12 12:00:00 +01:00
Jacek Caban ce6a2289c6 wininet: Move InternetQueryOption(INTERNET_OPTION_DATAFILE_NAME). 2008-03-12 11:59:54 +01:00
Jacek Caban 0e010d83a1 wininet: Move InternetQueryOption(INTERNET_OPTION_URL) to vtbl. 2008-03-12 11:59:47 +01:00
Jacek Caban e2933c20d6 wininet: Move INTERNET_OPTION_HANDLE_TYPE to vtbl. 2008-03-12 11:59:41 +01:00
Rob Shearman 0be05ab6aa wininet: Retrieve the maximum token length from the SSP and use a buffer of that length in calls to InitializeSecurityContextW.
Otherwise, InitializeSecurityContextW could run out of space with our
small, fixed buffer and fail.
2008-03-10 19:12:54 +01:00
Rob Shearman 7631bdf0c1 wininet: Allow HTTP_DoAuthorization to accept a NULL username/domain in the non-Basic case.
When using SSPI, pass in a NULL identity in this case so that the SSP
can try to use cached credentials.
2008-03-10 19:12:54 +01:00
Rob Shearman 8c6ac00820 wininet: Don't call DeleteSecurityContext and FreeCredentialsHandle on invalid handles. 2008-03-10 19:12:54 +01:00
Rob Shearman bdc81d9963 wininet: Make the reference count of WININETHANDLEHEADER thread-safe by using InterlockedIncrement/InterlockedDecrement. 2008-03-10 19:12:54 +01:00
Jacek Caban d597fd12fc wininet: Moved InternetReadFileExA to vtbl. 2008-03-03 20:45:31 +01:00
Jacek Caban ca39a55e88 wininet: Don't use INTERNET_ReadFile in HTTP_DrainContent. 2008-03-03 12:00:32 +01:00
Jacek Caban 3b4ca69e18 wininet: Move InternetReadFile to vtbl. 2008-03-03 12:00:20 +01:00
Jacek Caban 9a5c046129 wininet: Move INTERNET_STATUS_REQUEST_COMPLETE call from INTERNET_ReadFile. 2008-03-03 12:00:06 +01:00
Jacek Caban 3314184597 wininet: Move InternetQueryDataAvailable to vtbl. 2008-02-29 20:07:13 +01:00
Jacek Caban 8c45eecca7 wininet: Moved InternetFindNextFileW implementation to vtbl. 2008-02-28 10:44:42 +01:00
Jacek Caban 0e33eee9a2 wininet: Use vtbl for InternetSetOption(INTERNET_OPTION_[SEND|RECEIVE]_TIMEOUT) implementation. 2008-02-27 14:52:25 +01:00
Jacek Caban 1ffcfbce85 wininet: Use vtbl in InternetWriteFile implementation. 2008-02-27 14:52:24 +01:00
Jacek Caban 7dc9bf677b wininet: Moved close_connection to vtbl. 2008-02-27 14:52:24 +01:00
Jacek Caban 5a535d6b23 wininet: Moved handle destructor to vtbl. 2008-02-27 14:52:24 +01:00
Maarten Lankhorst 5132fb4469 wininet: Fix retrieving raw headers. 2008-02-27 14:52:24 +01:00
Francois Gouget abfa73b5c1 wininet: Document HttpAddRequestHeadersW()'s handling of the trailing '\0'. Fix tracing of the corresponding header strings as they may not be '\0' terminated. 2008-02-19 13:39:24 +01:00
Rob Shearman 719cd82f35 wininet: Fix potential buffer overrun in HttpQueryInfoA.
If HTTP_QUERY_CUSTOM is specified then the buffer contains a
null-terminated string on input and data of length len on output. The
code wasn't taking into account that the input len could be less than
the length of the string and thus could result in the allocated buffer
being overrun with the call to WideCharToMultiByte.
2008-02-19 13:39:24 +01:00
Hans Leidekker 9717113fcb wininet: Rename a function to better match what it does. 2008-02-18 13:33:52 +01:00
Hans Leidekker 2617fb6dea wininet: Handle the "100 Continue" response by ignoring it. 2008-02-18 13:33:33 +01:00
Hans Leidekker d0033dbaed wininet: Honour the version override in HttpOpenRequest. 2008-02-18 13:33:10 +01:00
Rob Shearman f8f9dbbbe7 wininet: Fix an off-by-one error in the boundary checks in HTTP_DecodeBase64. 2008-02-16 13:54:17 +01:00
Jacek Caban f979134270 wininet: Code clean up. 2008-02-15 10:00:12 +01:00
Jacek Caban d7a49e8147 wininet: Added beginning support for HTTP cache files. 2008-02-15 10:00:03 +01:00
Andrew Talbot 45481db078 wininet: Remove unneeded casts. 2008-02-05 12:19:37 +01:00
Hans Leidekker b0912d1151 wininet: Add zero value content length header to POST requests only. 2008-02-04 14:18:51 +01:00
Hans Leidekker c132dd9360 wininet: Send HTTP/1.1 requests by default. 2008-02-04 14:18:20 +01:00
Hans Leidekker b069ef4268 wininet: Make sure not to overwrite any caller supplied authorization header. 2008-02-04 14:18:20 +01:00
Rob Shearman 59ab0cf362 wininet: HTTP_Connect should fail if a NULL or empty hostname is passed in.
Add tests for these circumstances.
2008-02-04 13:04:34 +01:00
Rob Shearman 5edcf3ab6c wininet: Pass the server name into InitializeSecurityContextW. 2008-01-25 12:30:08 +01:00
Gerald Pfeifer 3f1a20b8b1 wininet: Fix type of a loop variable in HTTP_BuildHeaderRequestStr(). 2008-01-14 15:31:37 +01:00