s4:lib/http: let http_read_response_send/recv() also consume the body if it fits...
authorStefan Metzmacher <metze@samba.org>
Thu, 20 Jul 2017 16:12:27 +0000 (18:12 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 7 Aug 2017 13:20:01 +0000 (15:20 +0200)
commite42f12c6bec41a9d6c7f0f3c67b7fd9607b7457e
treeebc30c7897ed62650f0f078f8fd4d7425c306fcf
parent7b86da08ea760ac5198a9ca13a349c9536aba1a7
s4:lib/http: let http_read_response_send/recv() also consume the body if it fits into a max value

We need to consume full HTTP responses from the socket during the
authentication exchanges, otherwise our HTTP parser gets out of sync for
the next requests.

This will be important for gensec mechs which use an even number
for authentication packets.

I guess this should be done just based on the Content-Length value and
not based on the response code.

So far I saw bodies with 200 and 401 codes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/lib/http/http.c
source4/lib/http/http.h
source4/lib/http/http_auth.c
source4/lib/http/http_internal.h
source4/librpc/rpc/dcerpc_roh_channel_out.c