Source release 17.1.0

This commit is contained in:
John "Juce" Bruce
2022-07-07 17:14:31 -07:00
parent 8c17574083
commit 694cf6fb25
2233 changed files with 272026 additions and 223371 deletions

View File

@@ -1,10 +1,11 @@
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine Master
// License Agreement.
// source code may only be used and distributed under the Widevine License
// Agreement.
#include "url_request.h"
#include <errno.h>
#include <sstream>
#include "http_socket.h"
@@ -87,7 +88,7 @@ UrlRequest::~UrlRequest() {}
void UrlRequest::Reconnect() {
for (uint32_t i = 0; i < kMaxConnectAttempts && !is_connected_; ++i) {
socket_.CloseSocket();
if (socket_.Connect(kConnectTimeoutMs)) {
if (socket_.ConnectAndLogErrors(kConnectTimeoutMs)) {
is_connected_ = true;
} else {
LOGE("Failed to connect: url = %s, port = %d, attempt = %u",
@@ -104,8 +105,8 @@ bool UrlRequest::GetResponse(std::string* message) {
// non-blocking mode.
while (true) {
char read_buffer[kReadBufferSize];
const int bytes =
socket_.Read(read_buffer, sizeof(read_buffer), kReadTimeoutMs);
const int bytes = socket_.ReadAndLogErrors(read_buffer, sizeof(read_buffer),
kReadTimeoutMs);
if (bytes > 0) {
response.append(read_buffer, bytes);
} else if (bytes < 0) {
@@ -203,9 +204,10 @@ bool UrlRequest::PostRequestWithPath(const std::string& path,
request.append(data);
const int ret =
socket_.Write(request.c_str(), request.size(), kWriteTimeoutMs);
LOGV("HTTP request: (%zu): %s", request.size(), b2a_hex(request).c_str());
const int ret = socket_.WriteAndLogErrors(
request.c_str(), static_cast<int>(request.size()), kWriteTimeoutMs);
LOGV("HTTP request: (%zu): %s", request.size(),
wvutil::b2a_hex(request).c_str());
return ret != -1;
}