cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] polarssl: fix possible handshake timeout issue in multi.

From: Gaël PORTAY <gael.portay_at_gmail.com>
Date: Wed, 19 Mar 2014 15:56:12 +0100

Hi,

Here is a trivial patch that fix a possible handshake timeout issue with the
library and multi.

The patch has been tested and obviously fix the bug I had.

Old log:
>>> awaken by my epoll socket callback with curl to 2 (write)
* Connected to xxx (xxx.xxx.xx.xx) port xxx (#4)
* PolarSSL: Connecting to xxx:xx
net_send:533 net_send(ctx: @0xa5d68, buf: @0xbde20, len: 102)
net_send:535: fd: 9
net_send:541 ret: 102
net_recv:495 net_recv(ctx: @0xa5d68, buf: @0xb98e8, len: 5)
net_recv:497: fd: 9
net_recv:501 errno: 11, Resource temporarily unavailable)
net_recv:503 ret: -1
<<< end of socket callback

(... timeout...)

>>> awake by my epoll timer callback
* Operation timed out after 2 milliseconds with 0 out of 0 bytes received
< 0
< libcurl error (28): Timeout was reached
* Closing connection 0
(...)

New Logs
>>> awaken by my epoll socket callback with curl to 2 (write)
* Connected to xxx (xxx.xxx.xx.xx) port xxx (#4)
* PolarSSL: Connecting to xxx:xx
net_send:533 net_send(ctx: @0xa5d68, buf: @0xbde20, len: 102)
net_send:535: fd: 9
net_send:541 ret: 102
net_recv:495 net_recv(ctx: @0xa5d68, buf: @0xb98e8, len: 5)
net_recv:497: fd: 9
net_recv:501 errno: 11, Resource temporarily unavailable)
net_recv:503 ret: -1
=== curl socket_cb tells to set action to 1 (read)
<<< end of socket callback

>>> awaken by my epoll socket callback with curl to 1 (read)
net_recv:495 net_recv(ctx: @0xa5d68, buf: @0xb98e8, len: 5)
net_recv:497: fd: 9
net_recv:503 ret: 5
(...)
net_recv:495 net_recv(ctx: @0xa5d68, buf: @0xb98ed, len: 80)
net_recv:497: fd: 9
net_recv:503 ret: 80
* PolarSSL: Handshake complete, cipher is TLS-DHE-RSA-WITH-AES-256-CBC-SHA256
(...)
<<< end of socket callback

Your faithfully,
Gaël

Gaël PORTAY (1):
  polarssl: fix possible handshake timeout issue in multi.

 lib/http.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.3.2
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-19