lws_header_table_reset: make caller responsibility to clear down ah rx buffer
authorAndy Green <andy@warmcat.com>
Thu, 29 Sep 2016 02:31:06 +0000 (10:31 +0800)
committerAndy Green <andy@warmcat.com>
Thu, 29 Sep 2016 02:31:06 +0000 (10:31 +0800)
commitf94bef42c4e8939c8646c83292611ce1efb4a779
tree8fa79a241c8f0400aeb1547b85ede0d8670ce469
parentb0ff62352646896743814b7e6c83770c587c1635
lws_header_table_reset: make caller responsibility to clear down ah rx buffer

There are two kinds of reaason to call lws_header_table_reset(), one is we are reallocating
a destroyed ah to another wsi, and the other is we are moving to the next pipelined header set
still on the same wsi, and we need a "weaker" reset that only clears down the state related
to the header parsing, not everything about the ah context including the ah rx buffer.

This patch moves the ah rxbuffer rxpos and rxlen resetting out of lws_header_table_reset() and to
be the responsibility of the caller.  Callers who are moving the ah to another wsi are
patched to deal with resetting rxpos and rxlen and lws_http_transaction_completed() who only
resets the ah when moving to the next pipelined headers, no longer wrongly clears the ah rxbuf.

https://github.com/warmcat/libwebsockets/issues/638
lib/parsers.c
lib/server.c