舌苔发紫是什么原因| 倒挂金钩是什么意思| 槲皮素是什么东西| 手癣用什么药| 阳历1月份是什么星座| 脑梗三项是检查什么| 一会硬一会软什么情况| 紫字五行属什么| 加码是什么意思| 包皮炎是什么症状| 男人经常熬夜喝什么汤| 头疼是什么原因引起| 播客是什么意思| 智齿一般长在什么位置| 资讯是什么意思| 头昏是什么原因引起的| 吃什么可以拉肚子| 什么什么生机| 2014年属什么生肖| 4月5号是什么星座| 痢疾吃什么药| 乳酪和奶酪有什么区别| hib是什么疫苗| 子非鱼什么意思| 护理是什么| 淋巴细胞减少说明什么| au750是什么金属| 箱涵是什么| 下巴痘痘反复长是什么原因| 番茄和蕃茄有什么区别| 缺钾吃什么补得最快| 蛇缠腰是什么病| 气性大是什么意思| 扔枕头有什么忌讳吗| 如厕什么意思| 和尚代表什么生肖| 12月生日是什么星座| 天打五雷轰是什么意思| 明天什么节| 身份证穿什么颜色的衣服| 排暖期出血是什么原因| 肾囊性灶是什么意思| 左侧卵巢内无回声是什么意思| 未融资是什么意思| 洋葱炒什么| ab型和b型生的孩子是什么血型| 睡觉趴着睡什么原因| 7月20号是什么星座| 孕妇梦见狗是什么意思| force是什么牌子| vfu是什么牌子| 偏安一隅是什么意思| 喝红枣水有什么好处和坏处| 查乳腺挂什么科| 跑步后脸红是什么原因| mfg是什么意思| 催乳素过高是什么原因| 美洲大蠊主治什么病| 吃完狗肉不能吃什么| 右眼皮跳是什么预兆男| 甘油三酯低是什么原因| 内在美是什么意思| 右肾占位是什么意思| 梦见被蛇咬是什么意思| 唾液酸偏低意味什么| 取环后月经量少是什么原因| 什么节日吃汤圆| miracle是什么意思| 什么样的水花| 什么像什么似的什么| 为什么不能天天做有氧运动| 落是什么生肖| 总是放屁是什么原因引起的| 孕妇的尿液有什么用途| 甾体是什么意思| 刚生完宝宝的产妇吃什么好| 儿童包皮过长挂什么科| 纸老虎是什么意思| 6月25日是世界什么日| 头痛反胃想吐什么原因| 10月20日什么星座| 印第安人属于什么人种| 妊娠什么意思| 海参什么人不能吃| 五谷丰登是什么生肖| 神仙眷侣是什么意思| 被利用的信任是什么歌| 长期开灯睡觉有什么危害| 太监是什么| 孩子睡觉磨牙是什么原因| 抽脂有什么风险和后遗症| 胸闷气短是什么病| kinghome是什么牌子| 右眼皮跳是什么预兆男| 尿糖是什么意思| 工装是什么| 女朋友的弟弟叫什么| 面部痉挛是什么原因引起的| 九零年属什么生肖| 小动脉瘤是什么意思| 处女座的幸运色是什么| 印巴冲突中国做了什么| 痰湿瘀阻是什么症状| 早搏吃什么药效果好| 茶色尿是什么原因引起的| 钟爱一生是什么意思| 黄喉是什么动物身上的| 脂肪肝喝什么茶最好| 举足轻重是什么意思| 明天什么考试| 肚子着凉吃什么药| 什么油炒菜好吃又健康| 7月生日是什么星座| 为什么会得鼻炎| 小孩脱水有什么症状| 扁平足有什么危害| 系鞋带什么意思| 市政协主席是什么级别| 什么是熵| 浑身乏力吃什么药| 为什么不能用红笔写名字| 樵是什么意思| 前置胎盘是什么原因引起的| 慢性胃炎能吃什么水果| 爱是什么结构| 总是失眠是什么原因| 六月初四是什么星座| 免疫五项能查出什么病| 芋圆是什么| 人授和试管有什么区别| 人为什么会觉得累| 焱加木念什么| 肿瘤出血意味着什么| 竹叶青属于什么茶| 重庆东站什么时候通车| 1月21号什么星座| 节节草能治什么病| 小孩早上起床咳嗽是什么原因| 肚脐周围疼是什么原因| 格格是什么意思| 腋下疼痛挂什么科| 软开是什么| 对付是什么意思| 为什么嘴巴会臭| 肾炎康复片主要是治疗什么| 牛奶能做什么美食| 古尔邦节什么意思| 睾丸炎有什么症状| 恶心想吐吃什么药好| 店长的工作职责是什么| 黄金桂是什么茶| 王字旁加己念什么| 5月30号是什么星座| 猪肝能钓什么鱼| 清创手术是什么意思| 梦见家被偷了什么预兆| 什么是老公| 室内用什么隔墙最便宜| esd手术是什么意思| 厉鬼是什么意思| 蓄势是什么意思| 值机是什么意思| 潼字五行属什么| 什么叫慢性非萎缩性胃炎| 身体缺镁会有什么症状| 阴道松弛吃什么药| 古稀是什么意思| 珑骧包属于什么档次| 孩子肚子疼挂什么科| 可遇不可求什么意思| 卵巢囊性暗区是什么意思| 胃痉挛有什么症状表现| josiny是什么牌子| 阴部痒是什么原因| a型血rh阳性是什么意思| 梦见好多葡萄是什么意思| 喉咙沙哑吃什么药| 什么是八爪鱼| 拉肚子为什么会肚子疼| 弱精吃什么能提高活力| 什么叫做犯太岁| 正月十九是什么日子| 脑血管堵塞吃什么药最好| elaine是什么意思| 菠萝有什么功效和作用| 桥本甲状腺炎挂什么科| 梦见吃桃子是什么预兆| 17度穿什么衣服合适| 子宫b超能查出什么来| 脑管瘤的症状是什么| 尿道口痛什么原因| 2月10号是什么星座| 乳腺4a是什么意思| 睡觉就做梦是什么原因| 阴唇发黑是什么原因| 次胖是什么意思| 糖类抗原125偏高是什么意思| 天宫是什么意思| 列席人员什么意思| 孕晚期流鼻血是什么原因| 花匠是什么意思| 深水炸弹什么意思| 市局长是什么级别| 甲状腺属于什么科| 什么叫主动脉硬化| 恩替卡韦片是什么药| 鱼为什么睁着眼睛睡觉| 打眼是什么意思| 胸一大一小什么原因| 乳腺结节看什么科| 杀鸡给猴看什么意思| 咸鱼翻身是什么意思| 重症肌无力是什么原因引起的| 什么是应力| 什么茶减肥| 墨子是什么家| 老年斑用什么药膏可以去掉| 小鱼吃什么食物| 什么叫放疗治疗| 6月20是什么星座| 什么是夫妻宫| 柯南叫什么| ray是什么意思| 一千年前是什么朝代| 五月十八什么星座| 舒字五行属什么的| 吃什么能增强免疫力和抵抗力| 什么网名好听又有内涵| 黄精什么功效| 梦见要账是什么意思| 什么是全麦面包| 什么是蛇缠腰病| 香蕉水是什么| 碱性磷酸酶偏高说明什么问题| 6岁儿童为什么会长腿毛| 炖乌鸡汤放什么配料| 去新加坡买什么| 肺火吃什么药| 甲状腺过氧化物酶抗体高说明什么问题| 慢保申请有什么条件| 声音有磁性是什么意思| 雪莲菌泡牛奶有什么功效| 压到蛇了是有什么预兆| 59岁属什么生肖| 阿斯伯格综合症是什么| 无关风月是什么意思| 天明是什么意思| bp是什么的缩写| 断掌是什么意思| 做梦梦到鱼是什么意思| 大便不成形吃什么食物好| 什么黄河| 荔枝有什么作用与功效| 细菌性阴道炎用什么药效果好| 227是什么意思| 虎落平阳被犬欺是什么生肖| 六月八号什么星座| 绝技是什么意思| 风致是什么意思| 吃什么长头发| 九一年属什么生肖| 大便颜色发黑是什么原因| 小儿惊风是什么症状| 送女生什么生日礼物比较好| 百度
blob: c40a6838c367a0ea069c3f25e4ba7196836f093b [file] [log] [blame]
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
#define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
#include <stdint.h>
#include <array>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "build/buildflag.h"
#include "net/base/completion_once_callback.h"
#include "net/base/completion_repeating_callback.h"
#include "net/base/net_error_details.h"
#include "net/base/net_export.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/request_priority.h"
#include "net/http/http_auth.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_stream_factory.h"
#include "net/http/http_stream_request.h"
#include "net/http/http_transaction.h"
#include "net/log/net_log_with_source.h"
#include "net/net_buildflags.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
#include "net/socket/connection_attempts.h"
#include "net/ssl/ssl_config.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_versions.h"
#include "net/websockets/websocket_handshake_stream_base.h"
namespace net {
class BidirectionalStreamImpl;
class HttpAuthController;
class HttpNetworkSession;
class HttpStream;
class IOBuffer;
class ProxyInfo;
class SSLPrivateKey;
struct HttpRequestInfo;
class NET_EXPORT_PRIVATE HttpNetworkTransaction
: public HttpTransaction,
public HttpStreamRequest::Delegate {
public:
HttpNetworkTransaction(RequestPriority priority, HttpNetworkSession* session);
HttpNetworkTransaction(const HttpNetworkTransaction&) = delete;
HttpNetworkTransaction& operator=(const HttpNetworkTransaction&) = delete;
~HttpNetworkTransaction() override;
// HttpTransaction methods:
int Start(const HttpRequestInfo* request_info,
CompletionOnceCallback callback,
const NetLogWithSource& net_log) override;
int RestartIgnoringLastError(CompletionOnceCallback callback) override;
int RestartWithCertificate(scoped_refptr<X509Certificate> client_cert,
scoped_refptr<SSLPrivateKey> client_private_key,
CompletionOnceCallback callback) override;
int RestartWithAuth(const AuthCredentials& credentials,
CompletionOnceCallback callback) override;
bool IsReadyToRestartForAuth() override;
int Read(IOBuffer* buf,
int buf_len,
CompletionOnceCallback callback) override;
void StopCaching() override;
int64_t GetTotalReceivedBytes() const override;
int64_t GetTotalSentBytes() const override;
int64_t GetReceivedBodyBytes() const override;
void DoneReading() override;
const HttpResponseInfo* GetResponseInfo() const override;
LoadState GetLoadState() const override;
bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
void PopulateLoadTimingInternalInfo(
LoadTimingInternalInfo* load_timing_internal_info) const override;
bool GetRemoteEndpoint(IPEndPoint* endpoint) const override;
void PopulateNetErrorDetails(NetErrorDetails* details) const override;
void SetPriority(RequestPriority priority) override;
void SetWebSocketHandshakeStreamCreateHelper(
WebSocketHandshakeStreamBase::CreateHelper* create_helper) override;
void SetConnectedCallback(const ConnectedCallback& callback) override;
void SetRequestHeadersCallback(RequestHeadersCallback callback) override;
void SetEarlyResponseHeadersCallback(
ResponseHeadersCallback callback) override;
void SetResponseHeadersCallback(ResponseHeadersCallback callback) override;
void SetModifyRequestHeadersCallback(
base::RepeatingCallback<void(HttpRequestHeaders*)> callback) override;
void SetIsSharedDictionaryReadAllowedCallback(
base::RepeatingCallback<bool()> callback) override;
void CloseConnectionOnDestruction() override;
bool IsMdlMatchForMetrics() const override;
// HttpStreamRequest::Delegate methods:
void OnStreamReady(const ProxyInfo& used_proxy_info,
std::unique_ptr<HttpStream> stream) override;
void OnBidirectionalStreamImplReady(
const ProxyInfo& used_proxy_info,
std::unique_ptr<BidirectionalStreamImpl> stream) override;
void OnWebSocketHandshakeStreamReady(
const ProxyInfo& used_proxy_info,
std::unique_ptr<WebSocketHandshakeStreamBase> stream) override;
void OnStreamFailed(int status,
const NetErrorDetails& net_error_details,
const ProxyInfo& used_proxy_info,
ResolveErrorInfo resolve_error_info) override;
void OnCertificateError(int status, const SSLInfo& ssl_info) override;
void OnNeedsProxyAuth(const HttpResponseInfo& response_info,
const ProxyInfo& used_proxy_info,
HttpAuthController* auth_controller) override;
void OnNeedsClientAuth(SSLCertRequestInfo* cert_info) override;
void OnQuicBroken() override;
ConnectionAttempts GetConnectionAttempts() const override;
private:
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, ResetStateForRestart);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
CreateWebSocketHandshakeStream);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
SetProxyInfoInResponse_Direct);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
SetProxyInfoInResponse_Proxied);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
SetProxyInfoInResponse_Empty);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
SetProxyInfoInResponse_IpProtectionProxied);
FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
SetProxyInfoInResponse_IpProtectionDirect);
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateReceived);
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateSent);
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateOverflow);
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, FlowControlStallResume);
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest,
FlowControlStallResumeAfterSettings);
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest,
FlowControlNegativeSendWindowSize);
enum State {
STATE_CREATE_STREAM,
STATE_CREATE_STREAM_COMPLETE,
STATE_INIT_STREAM,
STATE_INIT_STREAM_COMPLETE,
STATE_CONNECTED_CALLBACK,
STATE_CONNECTED_CALLBACK_COMPLETE,
STATE_GENERATE_PROXY_AUTH_TOKEN,
STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE,
STATE_GENERATE_SERVER_AUTH_TOKEN,
STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE,
STATE_INIT_REQUEST_BODY,
STATE_INIT_REQUEST_BODY_COMPLETE,
STATE_BUILD_REQUEST,
STATE_BUILD_REQUEST_COMPLETE,
STATE_SEND_REQUEST,
STATE_SEND_REQUEST_COMPLETE,
STATE_READ_HEADERS,
STATE_READ_HEADERS_COMPLETE,
STATE_READ_BODY,
STATE_READ_BODY_COMPLETE,
STATE_DRAIN_BODY_FOR_AUTH_RESTART,
STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE,
STATE_NONE
};
bool IsSecureRequest() const;
// Returns true if the request is using an HTTP(S) proxy without being
// tunneled via the CONNECT method.
bool UsingHttpProxyWithoutTunnel() const;
void DoCallback(int result);
void OnIOComplete(int result);
// Runs the state transition loop.
int DoLoop(int result);
// Each of these methods corresponds to a State value. Those with an input
// argument receive the result from the previous state. If a method returns
// ERR_IO_PENDING, then the result from OnIOComplete will be passed to the
// next state method as the result arg.
int DoCreateStream();
int DoCreateStreamComplete(int result);
int DoConnectedCallback();
int DoConnectedCallbackComplete(int result);
int DoInitStream();
int DoInitStreamComplete(int result);
int DoGenerateProxyAuthToken();
int DoGenerateProxyAuthTokenComplete(int result);
int DoGenerateServerAuthToken();
int DoGenerateServerAuthTokenComplete(int result);
int DoInitRequestBody();
int DoInitRequestBodyComplete(int result);
int DoBuildRequest();
int DoBuildRequestComplete(int result);
int DoSendRequest();
int DoSendRequestComplete(int result);
int DoReadHeaders();
int DoReadHeadersComplete(int result);
int DoReadBody();
int DoReadBodyComplete(int result);
int DoDrainBodyForAuthRestart();
int DoDrainBodyForAuthRestartComplete(int result);
int BuildRequestHeaders(bool using_http_proxy_without_tunnel);
#if BUILDFLAG(ENABLE_REPORTING)
// Processes the Report-To header, if one exists. This header configures where
// the Reporting API (in //net/reporting) will send reports for the origin.
void ProcessReportToHeader();
// Processes the NEL header, if one exists. This header configures whether
// network errors will be reported to a specified group of endpoints using the
// Reporting API.
void ProcessNetworkErrorLoggingHeader();
// Calls GenerateNetworkErrorLoggingReport() if |rv| represents a NET_ERROR
// other than ERR_IO_PENDING.
void GenerateNetworkErrorLoggingReportIfError(int rv);
// Generates a NEL report about this request. The NetworkErrorLoggingService
// will discard the report if there is no NEL policy registered for this
// origin.
void GenerateNetworkErrorLoggingReport(int rv);
#endif
// Writes a log message to help debugging in the field when we block a proxy
// response to a CONNECT request.
void LogBlockedTunnelResponse(int response_code) const;
// Called wherever ERR_HTTP_1_1_REQUIRED or
// ERR_PROXY_HTTP_1_1_REQUIRED has to be handled.
int HandleHttp11Required(int error);
// Called to possibly handle a client authentication error. Sets next_state_
// and returns OK if recovering from the error. Otherwise, the same error
// code is returned.
int HandleSSLClientAuthError(int error);
// Called to possibly recover from the given error. Sets next_state_ and
// returns OK if recovering from the error. Otherwise, the same error code
// is returned.
int HandleIOError(int error);
// Gets the response headers from the HttpStream.
HttpResponseHeaders* GetResponseHeaders() const;
// Called when the socket is unexpectedly closed. Returns true if the request
// should be resent in case of a socket reuse/close race.
bool ShouldResendRequest() const;
// Returns true if there have already been |kMaxRetryAttempts| retries for
// HTTP2 or QUIC network errors, and no further retries should be attempted.
bool HasExceededMaxRetries() const;
// Increments the number of restarts and returns true if the restart may
// proceed.
bool CheckMaxRestarts();
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class RetryReason {
kHttpRequestTimeout = 0,
kHttpMisdirectedRequest = 1,
kHttp11Required = 2,
kSslClientAuthSignatureFailed = 3,
kConnectionReset = 4,
kConnectionClosed = 5,
kConnectionAborted = 6,
kSocketNotConnected = 7,
kEmptyResponse = 8,
kEarlyDataRejected = 9,
kWrongVersionOnEarlyData = 10,
kHttp2PingFailed = 11,
kHttp2ServerRefusedStream = 12,
// Entries 13, 14, 15 are removed.
kQuicHandshakeFailed = 16,
kQuicGoawayRequestCanBeRetried = 17,
kQuicProtocolError = 18,
kMaxValue = kQuicProtocolError,
};
static std::optional<RetryReason> GetRetryReasonForIOError(int error);
// Resets the connection and the request headers for resend. Called when
// ShouldResendRequest() is true.
void ResetConnectionAndRequestForResend(RetryReason retry_reason);
// Sets up the state machine to restart the transaction with auth.
void PrepareForAuthRestart(HttpAuth::Target target);
// Called when we don't need to drain the response body or have drained it.
// Resets |connection_| unless |keep_alive| is true, then calls
// ResetStateForRestart. Sets |next_state_| appropriately.
void DidDrainBodyForAuthRestart(bool keep_alive);
// Resets the members of the transaction so it can be restarted.
void ResetStateForRestart();
// Resets the members of the transaction, except |stream_|, which needs
// to be maintained for multi-round auth.
void ResetStateForAuthRestart();
// Caches network error details from the stream if available
// and resets the stream.
void CacheNetErrorDetailsAndResetStream();
// Returns true if we should try to add a Proxy-Authorization header
bool ShouldApplyProxyAuth() const;
// Returns true if we should try to add an Authorization header.
bool ShouldApplyServerAuth() const;
// Handles HTTP status code 401 or 407.
// HandleAuthChallenge() returns a network error code, or OK on success.
// May update |pending_auth_target_| or |response_.auth_challenge|.
int HandleAuthChallenge();
// Returns true if we have auth credentials for the given target.
bool HaveAuth(HttpAuth::Target target) const;
// Get the {scheme, host, path, port} for the authentication target
GURL AuthURL(HttpAuth::Target target) const;
// Returns true if this transaction is for a WebSocket handshake
bool ForWebSocketHandshake() const;
void CopyConnectionAttemptsFromStreamRequest();
// Returns true if response "Content-Encoding" headers respect
// "Accept-Encoding".
bool ContentEncodingsValid() const;
void ResumeAfterConnected(int result);
void RecordStreamRequestResult(int result);
void ProcessAltSvcHeader();
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class QuicProtocolErrorRetryStatus {
kNoRetryExceededMaxRetries = 0,
kNoRetryHeaderReceived = 1,
kNoRetryNoAlternativeService = 2,
kRetryAltServiceBroken = 3,
kRetryAltServiceNotBroken = 4,
kMaxValue = kRetryAltServiceNotBroken,
};
static void SetProxyInfoInResponse(const ProxyInfo& proxy_info,
HttpResponseInfo* response_info);
std::array<scoped_refptr<HttpAuthController>, HttpAuth::AUTH_NUM_TARGETS>
auth_controllers_;
// Whether this transaction is waiting for proxy auth, server auth, or is
// not waiting for any auth at all. |pending_auth_target_| is read and
// cleared by RestartWithAuth().
HttpAuth::Target pending_auth_target_ = HttpAuth::AUTH_NONE;
CompletionRepeatingCallback io_callback_;
CompletionOnceCallback callback_;
raw_ptr<HttpNetworkSession> session_;
NetLogWithSource net_log_;
base::TimeTicks start_timeticks_;
// Reset to null at the start of the Read state machine.
raw_ptr<const HttpRequestInfo> request_ = nullptr;
// The requested URL.
GURL url_;
RequestPriority priority_;
HttpResponseInfo response_;
// Copied from |request_|, as it's needed after the response body has been
// read.
NetworkAnonymizationKey network_anonymization_key_;
// |proxy_info_| is the ProxyInfo used by the HttpStreamRequest.
ProxyInfo proxy_info_;
std::unique_ptr<HttpStreamRequest> stream_request_;
std::unique_ptr<HttpStream> stream_;
// True if we've validated the headers that the stream parser has returned.
bool headers_valid_ = false;
// True if we can send the request over early data.
bool can_send_early_data_ = false;
// True if the client certificate for the server (rather than the proxy) was
// configured in this transaction.
bool configured_client_cert_for_server_ = false;
// Previously observed bad certs when establishing a connection. If the caller
// chooses to retry despite the error, future connection attempts will be
// configured to ignore these errors.
std::vector<SSLConfig::CertAndStatus> observed_bad_certs_;
HttpRequestHeaders request_headers_;
#if BUILDFLAG(ENABLE_REPORTING)
// Whether a NEL report has already been generated. Reset when restarting.
bool network_error_logging_report_generated_ = false;
// Cache some fields from |request_| that we'll need to construct a NEL
// report about the request. (NEL report construction happens after we've
// cleared the |request_| pointer.)
std::string request_method_;
std::string request_referrer_;
std::string request_user_agent_;
int request_reporting_upload_depth_ = 0;
#endif
// The size in bytes of the buffer we use to drain the response body that
// we want to throw away. The response body is typically a small error
// page just a few hundred bytes long.
static const int kDrainBodyBufferSize = 1024;
// User buffer and length passed to the Read method.
scoped_refptr<IOBuffer> read_buf_;
int read_buf_len_ = 0;
// Total number of bytes received on all destroyed HttpStreams for this
// transaction.
int64_t total_received_bytes_ = 0;
// Total number of bytes sent on all destroyed HttpStreams for this
// transaction.
int64_t total_sent_bytes_ = 0;
// When the transaction started / finished creating a stream.
base::TimeTicks create_stream_start_time_;
base::TimeTicks create_stream_end_time_;
// When the transaction started / finished sending the request, including
// the body, if present. |send_start_time_| is set to |base::TimeTicks()|
// until |SendRequest()| is called on |stream_|, and reset for auth restarts.
base::TimeTicks send_start_time_;
base::TimeTicks send_end_time_;
// When the connection and request headers are reset, and the request is
// resent.
base::TimeTicks reset_connection_and_request_for_resend_start_time_;
// The next state in the state machine.
State next_state_ = STATE_NONE;
// True when the tunnel is in the process of being established - we can't
// read from the socket until the tunnel is done.
bool establishing_tunnel_ = false;
// Enable pooling to a SpdySession with matching IP and certificate
// even if the SpdySessionKey is different.
// While QUIC also has a notion of IP based pooling / connection aliasing,
// this field does not affect QUIC. `enable_alternative_services_` is always
// set to false when this field is, which disables QUIC. If that ever changes,
// this field should probably be wired up to QUIC sessions as well.
bool enable_ip_based_pooling_for_h2_ = true;
// Enable using alternative services for the request.
bool enable_alternative_services_ = true;
// When a request is retried because of errors with the alternative service,
// this will store the alternative service used.
AlternativeService retried_alternative_service_;
// The helper object to use to create WebSocketHandshakeStreamBase
// objects. Only relevant when establishing a WebSocket connection.
raw_ptr<WebSocketHandshakeStreamBase::CreateHelper>
websocket_handshake_stream_base_create_helper_ = nullptr;
ConnectedCallback connected_callback_;
RequestHeadersCallback request_headers_callback_;
ResponseHeadersCallback early_response_headers_callback_;
ResponseHeadersCallback response_headers_callback_;
// The callback to modify the request header. They will be called just before
// sending the request to the network.
base::RepeatingCallback<void(HttpRequestHeaders*)> modify_headers_callbacks_;
ConnectionAttempts connection_attempts_;
IPEndPoint remote_endpoint_;
// Network error details for this transaction.
NetErrorDetails net_error_details_;
NextProto negotiated_protocol_ = NextProto::kProtoUnknown;
// Number of retries made for network errors like ERR_HTTP2_PING_FAILED,
// ERR_HTTP2_SERVER_REFUSED_STREAM, ERR_QUIC_HANDSHAKE_FAILED and
// ERR_QUIC_PROTOCOL_ERROR. Currently we stop after 3 tries
// (including the initial request) and fail the request.
// This count excludes retries on reused sockets since a well
// behaved server may time those out and thus the number
// of times we can retry a request on reused sockets is limited.
size_t retry_attempts_ = 0;
// Number of times the transaction was restarted via a RestartWith* call.
size_t num_restarts_ = 0;
bool close_connection_on_destruction_ = false;
// Set to true when the server required HTTP/1.1 fallback.
bool http_1_1_was_required_ = false;
// If set, these values are used as DNS resolution times, rather than
// using DNS times coming from the established stream.
base::TimeTicks dns_resolution_start_time_override_;
base::TimeTicks dns_resolution_end_time_override_;
// The time at which initialize stream started / ended.
base::TimeTicks initialize_stream_start_time_;
base::TimeTicks initialize_stream_end_time_;
base::TimeTicks blocked_initialize_stream_start_time_;
base::TimeTicks blocked_generate_proxy_auth_token_start_time_;
base::TimeTicks blocked_generate_server_auth_token_start_time_;
// Timing information for the connected callback.
base::TimeTicks connected_callback_start_time_;
base::TimeTicks connected_callback_end_time_;
// The number of bytes of the body received from network.
int64_t received_body_bytes_ = 0;
};
} // namespace net
#endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
肺部纤维灶什么意思 菩提是什么东西 朱雀玄武是什么意思 餐中服用是什么意思 屋尘螨是什么东西
cupid什么意思 一眼万年什么意思 八四年属什么生肖 财星是什么意思 手突然抖动是什么原因
西门子洗衣机不脱水是什么原因 白细胞偏低吃什么 直肠炎是什么原因引起的 viola是什么意思 阳虚湿热吃什么中成药
思的五行属性是什么 如法炮制是什么意思 女生肚子疼是什么原因 胰腺炎挂什么科室 脚麻吃什么药
七月份适合种什么菜hcv8jop7ns2r.cn 黄色是什么颜色组成的hcv9jop6ns3r.cn 白细胞计数高是什么原因hcv8jop5ns9r.cn 上皮源性肿瘤什么意思hcv9jop8ns0r.cn 拔罐出水泡是什么原因shenchushe.com
脉压差小是什么原因baiqunet.com 眼睛疼吃什么药效果最好hcv7jop9ns2r.cn 什么叫五音不全hcv9jop5ns5r.cn 眼睛里有红血丝是什么原因helloaicloud.com 吃桃子有什么好处hcv9jop6ns6r.cn
身败名裂是什么意思hcv7jop5ns4r.cn 肠脂膜炎是什么病严重吗hcv8jop0ns4r.cn 孩子咬嘴唇是什么原因hcv7jop6ns7r.cn 政协副主席是什么级别hcv7jop5ns6r.cn 榴莲吃了有什么好处travellingsim.com
浙江大学什么专业最好hcv8jop7ns5r.cn 胎儿脐带绕颈是什么原因造成的hcv9jop8ns0r.cn 乐极生悲是什么意思hcv9jop0ns4r.cn 眼睛痛是什么病hcv9jop4ns9r.cn 婴儿大便有泡沫是什么原因hcv8jop4ns1r.cn
百度