Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: net/socket/tcp_socket_libevent.h

Issue 583883002: Adds TCP FastOpen blackhole recovery code to avoid getting persistently blackholed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fixed. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/socket/tcp_socket_libevent.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_socket_libevent.h
diff --git a/net/socket/tcp_socket_libevent.h b/net/socket/tcp_socket_libevent.h
index 89b6a22bdd08d24b05529b6a9f2031351098d256..08844c37eff928bd6af87c850b957cfdf7032908 100644
--- a/net/socket/tcp_socket_libevent.h
+++ b/net/socket/tcp_socket_libevent.h
@@ -88,7 +88,7 @@ class NET_EXPORT TCPSocketLibevent {
private:
// States that a fast open socket attempt can result in.
- enum FastOpenStatus {
+ enum TCPFastOpenStatus {
FAST_OPEN_STATUS_UNKNOWN,
// The initial fast open connect attempted returned synchronously,
@@ -103,6 +103,14 @@ class NET_EXPORT TCPSocketLibevent {
// fast open would have worked.
FAST_OPEN_ERROR,
+ // The initial fast open connect succeeded immediately
+ // (FAST_OPEN_FAST_CONNECT_RETURN) and the attempt to write SYN+DATA failed.
+ FAST_OPEN_FAST_CONNECT_FAILED,
+
+ // The initial fast open connect failed (FAST_OPEN_SLOW_CONNECT_RETURN)
+ // and the first attempt to write data failed.
+ FAST_OPEN_SLOW_CONNECT_FAILED,
mmenke 2014/09/23 15:21:01 These should be added at the end of the list, sinc
Jana 2014/09/24 00:51:27 Thanks for catching this! Done.
+
// An attempt to do a fast open succeeded immediately
// (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server
// had acked the data we sent.
@@ -158,14 +166,14 @@ class NET_EXPORT TCPSocketLibevent {
void WriteCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,
- int rv) const;
- int HandleWriteCompleted(IOBuffer* buf, int rv) const;
+ int rv);
+ int HandleWriteCompleted(IOBuffer* buf, int rv);
int TcpFastOpenWrite(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback);
// Called when the socket is known to be in a connected state.
- void RecordFastOpenStatus();
+ void RecordTCPFastOpenStatus();
scoped_ptr<SocketLibevent> socket_;
scoped_ptr<SocketLibevent> accept_socket_;
@@ -173,9 +181,14 @@ class NET_EXPORT TCPSocketLibevent {
// Enables experimental TCP FastOpen option.
bool use_tcp_fastopen_;
+ // True when TCP FastOpen is in use and we have attempted the
+ // connect with write.
+ bool tcp_fastopen_write_attempted_;
+
// True when TCP FastOpen is in use and we have done the connect.
bool tcp_fastopen_connected_;
- FastOpenStatus fast_open_status_;
+
+ TCPFastOpenStatus tcp_fastopen_status_;
bool logging_multiple_connect_attempts_;
« no previous file with comments | « no previous file | net/socket/tcp_socket_libevent.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698