Re-use wsi->preamble_rx to also hold leftover rx after dealing with POST
body. Ensure ah->rx is always big enough to cope with what may have
been read into the pt->serv_buf.
Update the check for forced needed to also accept non-NULL wsi->preamble
as well as ah->rxpos != ah->rxlen as indication forced needed.
Disable autoservice on ah reset during transaction completed... it may
close the wsi underneath us when it sees and processes the pending
wsi->preamble_rx recursively otherwise.
The union used to make a lot of sense to save space between
mutually exclusive modes. But the fact the http2 struct
contains the http1 struct as well as it appearing in the
union means the http1 struct belongs outside the union.
This patch
- eliminates the union
- puts the http_related struct directly in struct lws
- removes http_related from h2
- puts h2 directly in struct lws if enabled for build
- changes ws to be a pointer, allocated if we upgrade to ws
(the ws part contains a 135 byte char array for ping / close)
Again all of this is entirely private / internal and doesn't affect
any apis.
Migrate what used to be in lws_hdr_related into either the ah
or the wsi, and eliminate it along with the three different ways
used to access things inside it.
Eg wsi->u.hdr.ah and wsi->u.http.ah become wsi->ah
These changes are internal-only, in private-libwebsockets.h and lib.
This enables selected things from -Wextra, can't use -Wextra because it is
fussy enough to complain about unused params on functions... they are
there for a reason.
-Wsign-compare
-Wignored-qualifiers
not -Wimplicit-fallthrough=3 ... only on gcc 7
-Wtype-limits
-Wuninitialized
not -Wclobbered ... only on gcc 7ish
fix the warnings everywhere they were found.