It avoids leaving dangling pointers behind in memory.
Also remove redundant checks for whether the URLContext to be closed is
already NULL.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
multiple_requests=1 is also set. Without an EOF to signal the end of
the last chunk, tls_read gets stuck forever trying to read more data
than is available. This occurs with the http protocol reproducibly,
because http.c always reads 4kb at a time, and the last chunk of an
http response is often much smaller.
After this commit, tls_read always returns any buffered plaintext
first before attempting to read more encrypted data off the
underlying tcp socket.
Signed-off-by: Rodger Combs <rodger.combs@gmail.com>
This works as expected on iOS, except for the ca_file feature which
is disabled because SecItemImport is not available.
Signed-off-by: Aman Gupta <aman@tmm1.net>