[Libwebsockets] [libwebsockets] #42: calculates number of actually sent bytes incorrectly in libwebsockets_write

Trac trac at libwebsockets.org
Wed Oct 16 16:15:55 CEST 2013


#42: calculates number of actually sent bytes incorrectly in libwebsockets_write
------------------------------------+-----------------
 Reporter:  andreaspakulat          |      Owner:
     Type:  defect                  |     Status:  new
 Priority:  major                   |  Milestone:
Component:  libwebsocket test apps  |    Version:
 Keywords:                          |
------------------------------------+-----------------
 I found out that libwebsockets_write does not return the correct number of
 payload bytes actually sent over the socket. For a 29-bytes payload the
 function returns 31 which is clearly incorrect.

 The problem is the calculation of the number of actual payload bytes at
 the end of the function. The attached patches reorders the calculation
 making it (hopefully) easier to understand and work correctly.

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



More information about the Libwebsockets mailing list