- Switch to
gun
2.1.0. - Drop support for Erlang/OTP 25 and earlier.
- Changed log format to be more structured,
host
andport
are included in the log data fields. - Add
max_inactive
duration option (default is10_000
milliseconds). This is to detect zombie connections especially when pipelining is set > 1. With{max_inactive, 10_000}
added to thestart_pool
option, it will try to reconnect HTTP server up on detection of the last sent request had been expired for 10 seconds.
-
Dropped hot-upgrade support.
-
Added support for using HTTP proxy (HTTP 1.1 only). To use it, pass
proxy
in the pool opts.Ex:
%% Point to the proxy host and port ProxyOpts = #{host => "127.0.0.1", port => 8888}. ehttpc_sup:start_pool(<<"pool">>, [{host, "target.host.com"}, {port, 80}, {proxy, ProxyOpts}]). %% To use username and password ProxyOpts = #{host => "127.0.0.1", port => 8888, username => "proxyuser", password => "secret"}. ehttpc_sup:start_pool(<<"pool">>, [{host, "target.host.com"}, {port, 80}, {proxy, ProxyOpts}]).
- Forcefully recreate
gproc_pool
s duringehttpc_pool:init/1
to prevent reusing pools in an inconsistent state.
- Upgrade to gun 1.3.11.
Fix
host
header
- Upgrade to gun 1.3.10 (OTP 26)
- Changed from
gun:open
togun:start_link
to start the gun process. This makes the gun process linked toehttpc
process (instead ofgun_sup
). Prior to this change, some early errors causing gun process to crash might not be able to be caught by ehttpc due to the slow monitoring. e.g. when some SSL option is invalid, the gun process will crash immediately andehttpc
can only get anoproc
error reason from the delayed process monitor.
- Added support for
PATCH
method requests.
- Fixed
ehttpc:request
andehttpc:request_async
to handleTimeout = infinity
option.
- Expanded the fix from 0.4.8 to also account for
{error, {shutdown, normal}}
return values in requests, and added a similar retry when the health check also fails with those two reasons.
- Fix an issue where a race condition would yield an
{error, normal}
return value. This can be caused when thegun
process terminates when the remote server closes the connection for whatever reason. In this case, we simply retry without consuming "retry credits".
- Fix crash when using body headers and no body. When one sent a message with, for example, the content-type header and no body, the underlying gun library would expect a body to come with a gun:data/3 call and would not finish the request. The next request would then crash. See the following issue for more information: ninenines/gun#141
- Fix a bug introduced in 0.4.5:
badarg
crash fromgrpoc
whenpool_type
ishash
.
- Make possible to start pool with
any()
name (not limited toatom()
).
- Fix the issue that ehttpc opens a new client when an existing client has been
opened but not ready (no
gun_up
received).
- Update
gproc
dependency to 0.9.0. - Add
format_status/1
for OTP 25.
- Do not crash on
retry
andretry_timeout
options. They might be persisted somehere, e.g. in an old config, or supervisor's child spec etc.
- Avoid sending stream cancellation messages to the 'gun' process if the stream is already finished ('fin' received)
- Force kill pool workers after 5 seconds waiting for graceful shutdown
- Add async APIs
-
Changes on top of 0.2.1:
- Prohibit the
retry
andretry_timeout
options.
- Prohibit the
-
Improvements and Bug Fixes
- Add ehttpc:health_check/2.
- Major refactoring on top of 0.1.15
- Added test cases.
- Support hot upgrade from all 0.1.X versions.
- No lower level retry (in 'gun' the http client lib).
- Now
enable_pipelining
can be an integer to indicate the number of HTTP requests can be sent on wire before receiving responses (like the inflight-window).enable_pipelining=true
has the same effect asenable_pipelining=100
andenable_pipelining=false
has the same effect asenable_pipelining=1
- Now all requests are async, so the
ehttpc:request
calls can be collected from mailbox into process state, this makes the handling of gun responses more effecient.
- fixed appup. old versions missed ehttpc_pool
- added check_vsn.escript to sure version consistent and run in ci