Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New features and bug fixes #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

fdmanana
Copy link

Hi Oscar,

The following commits add the following features:

  1. Automatic support for HTTP basic auth;

  2. Support IPv6;

  3. Support HTTP proxies;

  4. Support for a limit in the pool (lhttpc_manager);

  5. Allow clients to use different pools (lhttpc_manager instances)

  6. and 2) also fix and enhance lhttpc_lib:parse_url/1.

Best regards,
Filipe Manana

@zaa
Copy link

zaa commented Dec 13, 2011

Hello Filipe,

Really nice modifications.
I guess it would get better chances of a merge if the pull request was split into several smaller ones (for example, one per each separate modification).

Oscar, do you have any comments on the mods?

Also enhanced the lhttpc_lib:parse_url/1 to parse
credentials as specified in RFC1738 - before if user
credentials were specified, this function would consider
that what follows the first : is the port and not a
password.
If an URL targets an IPv6 host, lhttpc will now pass the
inet6 option to the socket automatically.
This also fixes 2 bugs:

1) in lhttpc_lib:parse_url/1 when the host component is an IPv6
   address literal - the parser thinks that what follows the
   first : is a port number;

2) for IPv6 address literals, the Host header must surround those
   literals in square brackets (RFC2732)
This change adds support for HTTP proxies that allow the HTTP
CONNECT method tunneling [1, 2]. Tested against Squid 3.1.15.

[1] http://muffin.doit.org/docs/rfc/tunneling_ssl.html
[2] http://tools.ietf.org/html/rfc2817
This allows the connection pool (lhttpc_manager) to
block clients, when they request a socket, when the
current number of open sockets/connection reaches a
certain (configurable) threshold.
This test verifies that the lhttpc_manager pool closes sockets
if they are not used after a configurable period of time.
This change allows different clients to use different connection
pools (lhttpc_manager instances). This is useful when we have
several different applications or process groups which are
independent and shouldn't share the same pool.
It also reduces the overhead of messaging a single centralized pool.
This reports the duration of each test and which specific
tests fail.
@oscarh
Copy link
Owner

oscarh commented Dec 20, 2011

Hi,

I saw that you sent this to ESL. That's probably for the better, since I've been really busy with other things. I was intending to have a look during the holidays :)

I did have some initial thoughts about the connection limit when we developed lhttpc. My idea was to have that as a separate module, kind of like a seaphore, so that it wouldn't make lhttpc_manager more complex. I haven't looked too much at your changes but as far as I can see you've implemented the changes for connection limits in lhttpc_manager.

/Oscar

@fdmanana
Copy link
Author

That's an interesting idea Oscar.
Thanks

@astro
Copy link

astro commented Apr 16, 2012

+1 for merging

@fdmanana
Copy link
Author

@astro All those changes were merged into Erlang Solutions' lhttpc repository:

https://github.com/esl/lhttpc

regards

@astro
Copy link

astro commented Apr 17, 2012

That is great. I hope they will tag a release some day.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants