Supports HTTP and HTTPS destinations and performs all hostname
resolution via the SOCKS proxy, preventing privacy leakage if used
with Tor.
If hostname is a valid IP address then it is used directly, the
hostname is not resolved again via the SOCKS5 proxy (Patch suggested
by Klaus Trainer but implementation here slightly different).
if the option return_raw_request` was unset or false, ibrowse was
still returning the returning thhe raw request. This change fix it.
(Spotted while running couchdb tests)
fix function_clause error:
{error,
{error,
{'EXIT',
{{function_clause,
[{ibrowse_http_client,do_send_body_1,
[{{ok,<<>>},
The case {Function, State} wasn't took in consideration while handling
the body.
Below are the warnings that were fixed by this commit.
[git: master]Iris:ibrowse andreas$ make dialyzer
Building local plt at .dialyzer_plt
dialyzer --output_plt .dialyzer_plt --build_plt \
--apps erts kernel stdlib ssl crypto public_key asn1 compiler hipe edoc gs syntax_tools inets xmerl runtime_tools mnesia
Compiling some key modules to native code... done in 0m19.73s
Creating PLT .dialyzer_plt ... done in 1m40.98s
done (passed successfully)
dialyzer --fullpath --plt .dialyzer_plt -Wrace_conditions -Wunmatched_returns -Werror_handling -r ./ebin
Checking whether the PLT .dialyzer_plt is up-to-date... yes
Proceeding with analysis...
src/ibrowse_http_client.erl:197: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:298: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:322: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:335: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:352: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:582: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:587: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:590: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:706: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:789: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:797: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:1402: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
src/ibrowse_http_client.erl:1859: Expression produces a value of type 'ok' | integer(), but this value is unmatched
src/ibrowse_socks5.erl:25: Expression produces a value of type {'ok',<<_:16>>}, but this value is unmatched
done in 0m8.07s
done (warnings were emitted)
make: *** [dialyzer] Error 2
When a tcp_closed or ssl_closed message is handled while ibrowse is
trying to send a request to a worker, ibrowse would incorrectly return a
req_timedout message, when, in fact, the request had not even been
handled.
This patch attempts to avoid that race condition by signalling tcp or
ssl closed messages back to ibrowse differently than a normal exit.