[gnutls-devel] TCP Fast Open

Nikos Mavrogiannopoulos nmav at gnutls.org
Mon Jul 25 17:23:13 CEST 2016


On Mon, Jul 25, 2016 at 4:38 PM, Tim Ruehsen <tim.ruehsen at gmx.de> wrote:
>> What do you think about this separation of the fast open code?
>> https://gitlab.com/gnutls/gnutls/commit/448af51f6a745fc1b9a2f68bce09adc3d28d
>> 3edc
>> When the fastopen() function is used, all the push and pull callbacks
>> are overridden with the ones that can cope with the TCP fast open.
>> This separates the two code bases.
> This is a good thing, cleaner design.
> A few little things:
> # Comma missing after 'undesirable':
>   * If this is undesirable TCP Fast Open must be implemented on the user
> # Unneeded 'return' statement in gnutls_transport_set_fastopen()
> # In _system_writev_tfo(), what about
>
> if (likely(!p->connect_addrlen))
>         return sendmsg(fd, &hdr, flags);
>
> That would reduce one level of indentation for most of the code.

Thanks, I'll merge your comments, and resubmit a complete patch. I've
found that I need to handle win32 separately as well (no sendmsg
there).

>> What I found hard with TCP fast open, is error recovery. That has to
>> be implemented by checking errors of the gnutls_handshake() function.
> Could you give an example what exactly you mean ?
> Maybe I have a brain slug... EAGAIN/EINPROGRESS/ENOTCONN/EOPNOTSUPP are
> handled. Most other errors are fatal and are returned by gnutls_handshake() as
> error. What am I missing ?

I meant in abstractions like sockets.c as used in gnutls-cli which
retry connect() for failed attempts. It may not be as hard as I think
though, as we may simply include the handshake in the socket_connect()
process.

regards,
Nikos



More information about the Gnutls-devel mailing list