cURL / Mailing Lists / curl-library / Single Mail


[PATCH] GnuTLS: make the connection phase non-blocking

From: Jerome Vouillon <>
Date: Thu, 15 Apr 2010 14:08:43 +0200


This patch improves the GnuTLS back-end to make the SSL connection
phase non-blocking when the multi interface is used.

As a side-effect, it also fixes a busy-wait issue during SSL
connection, with concern also the easy interface: the back-end always
checks simultaneously for input and ouput readiness, instead of taking
into account the GnuTLS needs. Thus, one get the following sequence of
system calls repeated many times:

    poll([{fd=5, events=POLLIN|POLLPRI}, {fd=5, events=POLLOUT}], 2, 299911) = 1 ([{fd=5, revents=POLLOUT}])
    recvfrom(5, 0x19d9e60, 5, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)

-- Jerome Vouillon

Received on 2010-04-15