[gnutls-devel] [PATCH] Re: TCP Fast Open

Tim Ruehsen tim.ruehsen at gmx.de
Fri Jul 15 16:52:58 CEST 2016


On Friday, July 15, 2016 2:04:41 PM CEST Nikos Mavrogiannopoulos wrote:
> On Fri, Jul 15, 2016 at 12:35 PM, Tim Ruehsen <tim.ruehsen at gmx.de> wrote:
> > On Friday, July 15, 2016 9:21:03 AM CEST Nikos Mavrogiannopoulos wrote:
> >> On Thu, Jul 14, 2016 at 12:45 PM, Tim Ruehsen <tim.ruehsen at gmx.de> wrote:
> >> > Here is my patch, first version.
> >> > 
> >> > Please review and comment.
> >> > 
> >> > - I have no platform without TFO to test with... so compilation might
> >> > break on such platforms, could anyone give it a try ?
> >> 
> >> I've committed it on a special branch and run through the CI. The
> >> windows and freebsd builds fail:
> >> https://gitlab.com/gnutls/gnutls/builds/2370926
> >> https://gitlab.com/gnutls/gnutls/builds/2370929
> > 
> > I haven't taken care of HAVE_WRITEV in _gnutls_writev(). The amended patch
> > should do that. Please test again.
> 
> Results will be at:
> https://gitlab.com/gnutls/gnutls/pipelines/3717100

Wow, somehow I managed to remove gnutls/socket.h from the patch... here is the 
patch including it.

> > But there is one thing that should be mentioned. The client applications
> > (currently only gnutls-cli) need a different retry strategy with TFO.
> > Without TFO, socket.c/socket_open() loops over the addrinfo list returned
> > by getaddrinfo() until connect() returns success.
> > With TFO, we return with the first successful call to socket(). The
> > implicit connect happens later - and from there we currently can't easily
> > 'continue looping'. Of course we could (we still have 'res' and 'ptr' in
> > the socket_st), but that needs some refactoring of socket.c - not part of
> > this patch.
> That is going to create some trouble when testing this option with
> gnutls-cli.
> >> This path is a bit worrying. Why not have
> >> gnutls_transport_set_fastopen() replace all the pull/push functions
> >> with its own version?
> > 
> > True, but the new writev_tfo functions need a session pointer instead of a
> > transport pointer. And I didn't want to take care for user supplied
> > transport pointers + user defined write functions (set before or after
> > gnutls_transport_set_fastopen()).
> > But I see room for a internal refactoring, that uses session for all
> > system
> > write/writev funtions... and call user supplied functions from there. IMO,
> > that should be another patch.
> 
> Would you be interested in making that patch? That would really
> simplify any such additions in the future.

I can't test the non-POSIX code, so it might go into many time-wasting 
iterations. Time is something I don't have very much of...

Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/attachments/20160715/973f202b/attachment.sig>


More information about the Gnutls-devel mailing list