diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2017-10-01 18:11:36 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2017-10-01 18:11:36 +0100 |
commit | 1ccd5f670a432f98e94b384dd169a1a760dced9a (patch) | |
tree | 3fa341950c38d903920124677b4688a284a445db /src/src/ip.c | |
parent | e924c08b7d031b712013a7a897e2d430b302fe6c (diff) |
TFO: better detection of client fast-open connections (again)
Diffstat (limited to 'src/src/ip.c')
-rw-r--r-- | src/src/ip.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/src/ip.c b/src/src/ip.c index 266eaf414..eb01229e6 100644 --- a/src/src/ip.c +++ b/src/src/ip.c @@ -236,22 +236,26 @@ if (fastopen) { if ((rc = sendto(sock, fastopen->data, fastopen->len, MSG_FASTOPEN | MSG_DONTWAIT, s_ptr, s_len)) >= 0) + /* seen for with-data, experimental TFO option, with-cookie case */ { - DEBUG(D_transport|D_v) - debug_printf("TCP_FASTOPEN mode connection, with data\n"); - tcp_out_fastopen = TRUE; + DEBUG(D_transport|D_v) debug_printf("TFO mode connection attempt, %s data\n", + fastopen->len > 0 ? "with" : "no"); + tcp_out_fastopen = fastopen->len > 0 ? 2 : 1; } else if (errno == EINPROGRESS) /* expected for nonready peer */ - { + /* seen for no-data, proper TFO option, both cookie-request and with-cookie cases */ + /* apparently no visibility of the diffference at this point */ + /* with netwk delay, post-conn tcp_info sees unacked 1 for R, 2 for C; code in smtp_out.c */ + /* ? older Experimental TFO option behaviour ? */ + { /* queue unsent data */ if (!fastopen->data) { - DEBUG(D_transport|D_v) - debug_printf("TCP_FASTOPEN mode connection, no data\n"); - tcp_out_fastopen = TRUE; + tcp_out_fastopen = 1; /* we tried; unknown if useful yet */ rc = 0; } else if ( (rc = send(sock, fastopen->data, fastopen->len, 0)) < 0 - && errno == EINPROGRESS) /* expected for nonready peer */ + && errno == EINPROGRESS /* expected for nonready peer */ + ) rc = 0; } else if(errno == EOPNOTSUPP) |