[gnutls-devel] TCP Fast Open

Nikos Mavrogiannopoulos nmav at gnutls.org
Wed Jul 13 09:28:28 CEST 2016

On Tue, Jul 12, 2016 at 5:33 PM, Tim Ruehsen <tim.ruehsen at gmx.de> wrote:
> Hi,
> I just wanted to mention that I recently added TFO in Wget2 using GnuTLS
> (tested on Linux, speedup ~ 1xRTT).

Hi Tim,
 That sounds great. Did you combine that with other optimizations such
as session resumption and false start?

> Is there any interest in a gnutls_ helper function ?

Certainly. I have not a good overview of the changes required, but as
I understand from your description we would have to handle the
connect()/sendmsg() steps within gnutls and its callbacks. As you have
a better overview, I'd suggest that you make a proposal on what you
think is the simplest.

> What I do now is setting my own vec_push function + transport pointer.
> In the vec_push function I use sendmsg() with MSG_FASTOPEN and fallback to
> connect/writev on errno=EOPNOTSUPP (ups, just see that I didn't test the
> fallback yet). At this point we need the sockaddr + sockaddrlen of the socket
> descriptor.
> From here on I set the vec_push function and the transport pointer 'back to
> normal', which is writev and a socket descriptor.
> If there is interest, what would be the best place to add a function for this
> ?
> It should be something like
> gnutls_transport_set_int_tfo(tcp->ssl_session, tcp->sockfd, sockaddr *addr,
> socklen_t *addrlen);

That sounds reasonable.

> Or is there any way retrieve addr/addrlen from the socket descriptor ?

As far as I know you can get these from already connected sockets.


More information about the Gnutls-devel mailing list