[Libwebsockets] [libwebsockets] #105: Pending SSL data not read

Trac trac at libwebsockets.org
Mon Mar 16 15:32:44 CET 2015


#105: Pending SSL data not read
-----------------------------------+-----------------
 Reporter:  mokumei                |      Owner:
     Type:  defect                 |     Status:  new
 Priority:  major                  |  Milestone:
Component:  libwebsockets library  |    Version:
 Keywords:  OpenSSL, pending data  |
-----------------------------------+-----------------
 SSL data is not retrieved although it is available.
 Forcing a SSL_read() does handle the data.
 Please see comments in the log below.

 14:34:22.0462: lws: WSAWaitForMultipleEvents() fired. network events: 1
 POLLIN = 1
 14:34:22.0462: lws: SSL_read(): 4 bytes pending: 0
 14:34:22.0462: lws: remove wsi from pending_read_list
 14:34:22.0462: lws: libwebsocket_read: len=4
 14:34:22.0463: lws: received opcode TEXT/BINARY_FRAME
 14:34:22.0463: lws: HDR_LEN16_2 => rx_packet_length = 4608
 14:34:22.0463: lws: HDR_LEN16_1 => rx_packet_length = 4636
 '''We are awaiting a packet of length 4636'''
 14:34:22.0464: lws: libwebsocket_read: read_ok
 14:34:22.0464: lws: WSAWaitForMultipleEvents() fired. network events: 1
 POLLIN = 1
 14:34:22.0464: lws: SSL_read(): 4096 bytes      pending: 540
 '''First portion handled correctly.'''
 14:34:22.0465: lws: added wsi to pending_read_list
 14:34:22.0465: lws: libwebsocket_read: len=4096
 14:34:22.0465: lws: libwebsocket_read: read_ok
 '''Timeout for WSAWaitForMultipleEvents() is one second.'''
 14:34:2'''3'''.0467: lws: WSAWaitForMultipleEvents() => timeout
 14:34:2'''4'''.0467: lws: WSAWaitForMultipleEvents() => timeout
 '''No events ...'''
 14:34:2'''5'''.0467: lws: WSAWaitForMultipleEvents() => timeout
 '''No LWS_POLLIN for 3 seconds, so we force it:'''
 14:34:25.0468: lws: forcing LWS_POLLIN
 14:34:25.0469: lws: SSL_read(): 540 bytes       pending: 0
 14:34:25.0469: lws: remove wsi from pending_read_list
 14:34:25.0470: lws: libwebsocket_read: len=540
 [4636(0)]
 '''Data is handled correctly and the package is complete. Without forcing
 LWS_POLLIN and hence SSL_read() the 540 bytes would not come through.'''

 - OpenSSL v1.0.1g
 - Windows 8

--
Ticket URL: <http://libwebsockets.org/trac/libwebsockets/ticket/105>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list