ioerror/tlsdate — pull request #30 by elly (2012-11-05 15:37:55+00:00)
Title: proxy-bio fixes

1. Send the Host header with HTTP CONNECT, as it is required by RFC 2616,
section 14.23:

A client MUST include a Host header field in all HTTP/1.1 request
messages . If the requested URI does not include an Internet host
name for the service being requested, then the Host header field MUST
be given with an empty value. An HTTP/1.1 proxy MUST ensure that any
request message it forwards does contain an appropriate Host header
field that identifies the service being requested by the proxy. All
Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request)
status code to any HTTP/1.1 request message which lacks a Host header
field.

2. Drain the response buffer for SOCKS5 connections even if the hostname is too
long for us to store (i.e., is longer than NI_MAXHOST); this could happen if
NI_MAXHOST < 255, but I believe there are no systems on which this is true in
practice.

3. Use unsigned buffers in SOCKS4/SOCKS5 code to save on casts to/from unsigned.

4. Return an int from BIO_proxy_set_host() so we can signal malloc failures to
the caller.

Signed-off-by: Elly Fong-Jones