Stay in loop forever to keep tlsdated running forever
add TODO item
Add XXX TODO for absolute path
Add proxy support

Support SOCKS4a, SOCKS5, and HTTP proxies through -x / --proxy
<schema>://<host>:<port>. No auth supported yet.

BUG=chromium-os:31505
TEST=unit

Change-Id: Ifd430ca1ed026dcaa33a91dfa07cc7eb7e57eaee
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34566
(cherry picked from commit 9c3e49f2f4823c822fe29342e3eebbd38154d55a)

Conflicts:

	src/Makefile.am
	src/tlsdate-helper.c
Fix warnings in proxy-bio-unittest

Also, move some magic numbers into tlsdate.h

Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Merge pull request #29 from elly/proxy

Add proxy support (http, socks4a, socks5) - thanks again to Elly!
retab things
Update documentation and CHANGELOG to reflect new proxy support
add headers to fix compile for make distcheck
add headers to fix compile for make distcheck (Thanks Sebastian Hahn!)
Merge branch 'master' of github.com:ioerror/tlsdate
fix cert verification when proxy is used
add V to verb output as expected
Move common functions to util.c and add verb() to proxy code
update verbose ints location
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 <ellyjones@chromium.org>
proxy-bio: Fix up buffer length handling logic.

The buffer length was being badly mishandled such that if the returned hostname
was 254 bytes long, we'd repeatedly read zero bytes and get stuck in an endless
loop. There were also a bunch of places that would accept short reads/writes
during protocol negotiation which have now been changed to only accept exact
lengths.

Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Merge pull request #30 from elly/proxy-fix

proxy-bio fixes
Add TODO items that we hope make it into 0.0.4
Update README to include information about tlsdated