Граф коммитов

14 Коммитов

Автор SHA1 Сообщение Дата
Catalin Fratila f7c3207667 Handle everything not in [200, 300) as error. For example HockeyApp responds with 202. 2017-06-12 09:54:07 -07:00
Mark Mentovai 60be5a66a0 net: Provide better HTTP User-Agent strings
Previously, macOS used “User-Agent: crashpad_util_test (unknown version)
CFNetwork/807.2.14 Darwin/16.4.0 (x86_64)” and Windows gave results like
“User-Agent: Crashpad/0.8.0”.

Now, macOS uses “User-Agent: Crashpad/0.8.0 CFNetwork/807.2.14
Darwin/16.4.0 (x86_64)” and Windows uses “User-Agent: Crashpad/0.8.0
WinHTTP/10.0.14393.351 Windows_NT/10.0.14393.0 (x64)”

Change-Id: I578b44734cf59d79e3d9b6136b4b92f05acefe71
Reviewed-on: https://chromium-review.googlesource.com/447796
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-03-01 17:44:08 +00:00
Mark Mentovai 1dcd45ab75 win: Pass a query component, if present, to an HTTP server
BUG=crashpad:163

Change-Id: I046dcef56a788ae04848383b0601e35d172c8183
Reviewed-on: https://chromium-review.googlesource.com/447916
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-02-28 19:01:34 +00:00
Mark Mentovai cd28471383 win: Implement Transfer-Encoding: chunked for HTTP requests
Chunked encoding doesn’t require the length of the request body to be
known in advance. In cases where this value isn’t independently known,
as is normal for Crashpad report uploads where the HTTP request body is
constructed on the fly, chunked encoding eliminates the need to prepare
the entire request body in memory before transmitting it. In these
cases, it’s much less wasteful.

When the length of the request body is known in advance, based on the
provision of a Content-Length header, chunked encoding is not used.
Even so, the request is sent in pieces rather than reading the entire
request into memory before sending anything.

BUG=crashpad:159
TEST=crashpad_util_test HTTPTransport.*

Change-Id: Iebb2b63b936065cb8c3c4a62b58f9c14fec43937
Reviewed-on: https://chromium-review.googlesource.com/439644
Reviewed-by: Scott Graham <scottmg@chromium.org>
2017-02-08 21:17:05 +00:00
Marcin Grześkowiak 6f6242865d win: Handle the case when GetBytesBuffer returns error in HTTPTransportWin
HTTPBodyStream::GetBytesBuffer returns negative number on error.

Change-Id: I9958fb35d65e894067d71e8f37c30ff8948cd90d
Reviewed-on: https://chromium-review.googlesource.com/366360
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-05 12:41:11 +00:00
Scott Graham a02ba24006 Convert from scoped_ptr to std::unique_ptr
Follows https://codereview.chromium.org/1911823002/ but fixes includes
that were messed up there.

Change-Id: Ic4bad7d095ee6f5a1c9f8ca2d11ac9e67d55a626
Reviewed-on: https://chromium-review.googlesource.com/340497
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-04-25 19:16:26 +00:00
Mark Mentovai 6d2d31d2d1 Use base/macros.h instead of base/basictypes.h
This was done in Chromium’s local copy of Crashpad in 562827afb599. This
change is similar to that one, except more care was taken to avoid
including headers from a .cc or _test.cc when already included by the
associated .h. Rather than using <stddef.h> for size_t, Crashpad has
always used <sys/types.h>, so that’s used here as well.

This updates mini_chromium to 8a2363f486e3a0dc562a68884832d06d28d38dcc,
which removes base/basictypes.h.

e128dcf10122 Remove base/move.h; use std::move() instead of Pass()
8a2363f486e3 Move basictypes.h to macros.h

R=avi@chromium.org

Review URL: https://codereview.chromium.org/1566713002 .
2016-01-06 12:22:50 -05:00
Scott Graham 3d598cdbcd Change file op |ssize_t|s to FileOperationResult
R=mark@chromium.org

Review URL: https://codereview.chromium.org/1416493006 .
2015-10-22 16:14:18 -07:00
Scott Graham ccf9f98519 win xp: Don't use ICU_REJECT_USERPWD with WinHttpCrackUrl
Fails on XP with ERROR_INVALID_PARAMETER (undocumented). Not overly
important that we reject embedded user/passwords in the URL for this
use case.

R=mark@chromium.org
BUG=crashpad:50

Review URL: https://codereview.chromium.org/1339793002 .
2015-09-11 13:23:59 -07:00
Scott Graham 78bba8808b win: Pass WINHTTP_FLAG_SECURE when necessary
Otherwise the server drops us when connecting to an https endpoint,
and WinHttpReceiveResponse fails with an obscure error.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1317023003 .
2015-08-31 13:29:00 -07:00
Scott Graham 07fcf63c21 win: fixes for Windows x64
Mostly size_t <-> unsigned int warnings, but I also had a mistake in
PROCESS_BASIC_INFORMATION, the pids are 32-on-32 and 64-on-64.

The Windows build is still x86 until https://codereview.chromium.org/981333002/.
I don't think I'll bother maintaining the x86 build for now, though we will probably
need it for x86 OSs in the future. It should be straightforward to revive it once we
need it, and have bots to support it.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/983103004
2015-03-06 16:05:34 -08:00
Scott Graham b16b89c89d Make HTTPTransportWin respect user timeout
Uses solution suggested in linked bug. No test as it'd be flaky, slow,
or both.

R=mark@chromium.org
BUG=crashpad:8

Review URL: https://codereview.chromium.org/897393002
2015-02-06 10:10:55 -08:00
Mark Mentovai 242619d958 HTTPTransport: callers should be able to obtain the HTTP response body.
This adds a new optional out-parameter to
HTTPTransport::ExecuteSynchronously() and provides Mac and Windows
implementations.

BUG=crashpad:5
R=rsesek@chromium.org, scottmg@chromium.org

Review URL: https://codereview.chromium.org/885183004
2015-02-05 18:05:40 -05:00
Scott Graham 7c9bd944ae win: Add implementation of HTTPTransport based on WinHTTP
(There's also https://codereview.chromium.org/854363006/ based on
WinInet, I'm still a little uncertain which is preferable here.)

R=cpu@chromium.org, mark@chromium.org, rsesek@chromium.org, ananta@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/852213004
2015-01-26 13:31:35 -08:00