Commit Graph

691 Commits

Author SHA1 Message Date
Alistair Leslie-Hughes bf5b8ae8af wininet: Remove unsued flag HTTP_ADDHDR_FLAG_COALESCE.
This flag has the same value as HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA
which is used in multiple places.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 21:34:13 +02:00
Hans Leidekker 25b10ea4cc wininet: Trace modifiers in hexadecimal in HttpAddRequestHeaders.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-08 12:11:54 +01:00
Michael Stefaniuc b1a3b9e5ce wininet: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 19:44:17 +02:00
Michael Stefaniuc 717a17b24f wininet: Avoid an ARRAY_SIZE-like macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 19:44:17 +02:00
Dmitry Timoshkov 24f3d50ccc wininet: Remove unused parameter from create_netconn().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-07 19:27:22 +02:00
Alistair Leslie-Hughes 6552ddaaa5 wininet: Always copy the password even if blank.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-20 19:36:08 +02:00
Michael Stefaniuc d870d4105d wininet: Use the more common ARRAY_SIZE spelling.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-06 19:44:26 +02:00
Jacek Caban 54b414b121 wininet: Simplify header string handling in HTTP_HttpSendRequestW.
Spotted by Mark Jansen, avoids potential double-free.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-11 16:51:19 +02:00
André Hentschel be002fd92b wininet: Fix negated check for drain_content result (clang).
Introduced with 4f40039cd7

Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-28 23:39:20 +02:00
Piotr Caban ea0dae6db2 wininet: Fix https connections over proxy.
Successful CONNECT request switch to tunnel instead of having a message
body.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-16 00:59:42 +01:00
Wei Xie 6d6dd78e5d wininet: Don't release connection too early.
Signed-off-by: Wei Xie <xiewei@linuxdeepin.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-19 16:40:55 +01:00
Daniel Lehman b84ba52248 wininet: Use case-insensitive comparison for server name.
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-29 21:30:02 +01:00
Daniel Lehman 1b25de7d57 wininet: Fix proxy bypass with wildcard if domain length matches with server.
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-08 16:23:15 +02:00
Jacek Caban 085ce269b1 wininet: Drain content before reusing connection in open_http_connection.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:47 +09:00
Jacek Caban 59395d8845 wininet: Never do blocking reads in chunked_read if zero chunk size is aready read.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:44 +09:00
Jacek Caban 4f40039cd7 wininet: Release connection in HTTPREQ_Read only if remaining control data may be drainad without blocking.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:40 +09:00
Jacek Caban 8090d169ab wininet: Store error state separately from end of stream in chunked stream.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:36 +09:00
Jacek Caban 752d078a42 wininet: Always use drain_content specific to stream type.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:32 +09:00
Jacek Caban 90b936f0b2 wininet: Try to read reamaining data in chunked_drain_content.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:29 +09:00
Jacek Caban 2ecdac8846 wininet: Return error codes from HTTP streams.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-18 08:09:25 +09:00
Jacek Caban 7949a22b43 wininet: Correctly pass URL length to InternetCrackUrlW in get_redirect_url.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-08 20:13:57 +09:00
Nikolay Sivov f55a116101 wininet: Fix potential use-after-free (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-10 20:51:11 +02:00
Jacek Caban 89f1d8c58a wininet: Fixed connection_pool_cs declaration.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-07 19:49:46 +02:00
Jacek Caban cee99826b6 wininet: Return an error on redirect with no host name specified.
Inspired by Michael Müller's patch.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-26 18:18:56 +02:00
Jacek Caban 61e28c01c6 wininet: Moved INTERNET_STATUS_REDIRECT notification to HTTP_HandleRedirect.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-26 18:18:54 +02:00
Jacek Caban 9c959154f6 wininet: Correctly handle redirects to non-http URLs.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-31 20:51:47 +02:00
Akihiro Sagawa 05c23c95f8 wininet: Use isspaceW() instead of isspace() for WCHARs.
Found with Coccinelle.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-17 16:11:26 +02:00
Jacek Caban 7d8cf318a4 wininet: Don't use returned read size if read failed in gzip_read.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-07 18:05:48 +02:00
Jacek Caban 2952c637e3 wininet: Get rid of no longer needed get_avail_data from data stream implementations.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-13 19:28:54 +01:00
Jacek Caban 295291b4be wininet: Always use non-blocking reads in HTTP_ReceiveRequestData.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-13 19:28:52 +01:00
Jacek Caban fd0ac40798 wininet: Get rid of no longer needed blocking_mode_t.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:23 +01:00
Jacek Caban 18f9d0303a wininet: Get rid of no longer needed BLOCKING_WAITALL.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:23 +01:00
Jacek Caban 7eaadabc5c wininet: Merge InternetReadFile and InternetReadFileEx implementations.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:23 +01:00
Jacek Caban a546e8acaa wininet: Reimplemented InternetQueryDataAvailable on top of async_read.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:23 +01:00
Jacek Caban 08808747b2 wininet: Rewrite InternetReadFileEx for http protocol to make use of non-blocking reads.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:23 +01:00
Jacek Caban 98bcd00e21 wininet: Rewrite asynchronous read to try to fill whole buffer and not buffer additional data unless requested.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:22 +01:00
Jacek Caban c140a70425 wininet: Propagate WSAEWOULDBLOCK from read_http_stream.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:22 +01:00
Jacek Caban f42a2ccad1 wininet: Pass blocking mode to HTTPREQ_Read.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:22 +01:00
Jacek Caban 67b56774c5 wininet: Propagate WSAEWOULDBLOCK result from content decoding reads.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 23:21:22 +01:00
Jacek Caban 7b42dc4931 wininet: Improved netconn_drain_content.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-27 16:24:59 +01:00
Jacek Caban 725b55ded2 wininet: Get rid of no longer needed INTERNET_INVALID_PORT_NUMBER in get_server.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-15 23:29:50 +01:00
Michael Müller 0d22e43f8c wininet: Handle INTERNET_INVALID_PORT_NUMBER in HttpOpenRequest.
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-15 23:29:42 +01:00
Fabian Maurer 8c39694882 wininet: Changed usage of UrlEscapeW to fit winapi behavior.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-14 17:32:36 +01:00
Daniel Lehman b3d12a16ce wininet: Canonicalize URL in HttpOpenRequest.
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-30 13:23:09 +01:00
Jacek Caban 7d9a439274 wininet: Don't return available data sizes larger than the read buffer.
Based on patch by Hans Leidekker.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-15 12:55:02 +09:00
Jacek Caban 16d300cacd wininet: Return data available in current chunk in chunked_get_avail_data.
Based on a patch by Hans Leidekker.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-02 09:08:57 -05:00
Jacek Caban 6e0c842dfa wininet: Rewrite chunked stream to store full stream state and allow non-blocking reads crossing chunk boundries.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-01 09:58:06 -05:00
Jacek Caban a9a6948b79 wininet: Include stdlib.h before winsock2.h in http.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-03 10:54:18 +09:00
Jacek Caban fff5dca787 wininet: Correctly handle the last proxy override in HTTP_ShouldBypassProxy.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-01 01:04:45 +09:00
Jacek Caban 9a85a84765 wininet: Fixed leak in HTTP_DealWithProxy (coverity).
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-30 11:10:12 +09:00