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

Trac trac at libwebsockets.org
Thu Oct 17 13:58:36 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:
Resolution:                          |   Keywords:
-------------------------------------+-----------------

Comment (by andreaspakulat):

 write() in libwebsocket_issue_raw() sending less bytes than anticipated
 happens for me quite easily with big enough payload. I'm trying to send a
 500 kilobyte message and only around 20K of that will be sent initially by
 current master of libwebsockets.

 Since I don't use compression or extensions (both disabled) the return
 value is actually what is being written to the socket by the write()
 function. So I was able to send the rest of my 500K by obtaining the
 socket filedescriptor and using write() myself.

 And I don't need to block either, I simply write as much as I can and then
 call libwebsocket_callback_on_writable so I get notified once I can write
 more data. Once thats possible I try to write the rest, rinse and repeat.

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



More information about the Libwebsockets mailing list