From e7d6be512b08e81dce94e9776f905c23ec0967da Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 5 Mar 2015 13:13:08 +0100 Subject: [PATCH] bump to 1.1.0 --- NEWS.md | 20 ++++++++++++++++++++ README.md | 2 +- doc/README.md | 2 +- doc/hackney_http_connect.md | 33 +++++++++++++++++++++++---------- doc/hackney_socks5.md | 15 ++++++++++++++- doc/hackney_ssl_transport.md | 15 ++++++++++++++- doc/hackney_tcp_transport.md | 15 ++++++++++++++- doc/overview.edoc | 2 +- src/hackney.app.src | 2 +- 9 files changed, 89 insertions(+), 17 deletions(-) diff --git a/NEWS.md b/NEWS.md index f7037570..c67e37ac 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,25 @@ # NEWS +1.1.0 - 2015/03/04 +------------------ + +- fix: honor max_redirect. +- fix: socket checkout in the pool: close the socket if something happen while + passing the control to the client +- fix: put back the waiter in the queue of the pool if no socket can be + delivered +- fix: make sure we don't release a closed typo +- add: shutdown method to transports +- add: hackney_trace module to trace a request +- add: reuse/new connection metrics +- fix: guard binary in `hackney_multipart:len_mp_stream/2` +- improvement: pass the socket to `hackney:request_info/1` +- dependency: update ssl_verify_hostname +- fix: make sure to pass the Host header to the request +- fix: HTTP basic authentication +- fix content-type case +- improvement: tests + 1.0.6 - 2015/01/21 ------------------ diff --git a/README.md b/README.md index 5c75d6d1..377bd426 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Copyright (c) 2012-2015 Benoît Chesneau. -__Version:__ 1.0.6 +__Version:__ 1.1.0 # hackney diff --git a/doc/README.md b/doc/README.md index c337126d..24219be5 100644 --- a/doc/README.md +++ b/doc/README.md @@ -4,7 +4,7 @@ Copyright (c) 2012-2015 Benoît Chesneau. -__Version:__ 1.0.6 +__Version:__ 1.1.0 # hackney diff --git a/doc/hackney_http_connect.md b/doc/hackney_http_connect.md index dfccdefa..beb74332 100644 --- a/doc/hackney_http_connect.md +++ b/doc/hackney_http_connect.md @@ -14,12 +14,12 @@ -### socks5_socket() ### +### http_socket() ###

-socks5_socket() = {atom(), inet:socket()}
+http_socket() = {atom(), inet:socket()}
 
@@ -28,7 +28,7 @@ socks5_socket() = {atom(), inet:socket()} ## Function Index ## -
close/1Close a socks5 socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
sockname/1Get the local address and port of a socket.
+
close/1Close a socks5 socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
shutdown/2Immediately close a socket in one or two directions.
sockname/1Get the local address and port of a socket.
@@ -41,7 +41,7 @@ socks5_socket() = {atom(), inet:socket()}

-close(X1::socks5_socket()) -> ok
+close(X1::http_socket()) -> ok
 

@@ -68,7 +68,7 @@ __See also:__ [gen_tcp:close/1](gen_tcp.md#close-1).

-controlling_process(X1::socks5_socket(), Pid::pid()) -> ok | {error, closed | not_owner | atom()}
+controlling_process(X1::http_socket(), Pid::pid()) -> ok | {error, closed | not_owner | atom()}
 

@@ -88,7 +88,7 @@ Atoms used to identify messages in {active, once | true} mode.

-peername(X1::socks5_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}
+peername(X1::http_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}
 

@@ -108,7 +108,7 @@ __See also:__ [inet:peername/1](inet.md#peername-1).

-recv(X1::socks5_socket(), Length::non_neg_integer(), Timeout::timeout()) -> {ok, any()} | {error, closed | atom()}
+recv(X1::http_socket(), Length::non_neg_integer(), Timeout::timeout()) -> {ok, any()} | {error, closed | atom()}
 

@@ -121,7 +121,7 @@ __See also:__ [gen_tcp:recv/3](gen_tcp.md#recv-3).

-send(X1::socks5_socket(), Packet::iolist()) -> ok | {error, atom()}
+send(X1::http_socket(), Packet::iolist()) -> ok | {error, atom()}
 

@@ -134,20 +134,33 @@ __See also:__ [gen_tcp:send/2](gen_tcp.md#send-2).

-setopts(X1::socks5_socket(), Opts::list()) -> ok | {error, atom()}
+setopts(X1::http_socket(), Opts::list()) -> ok | {error, atom()}
 

Set one or more options for a socket. __See also:__ [inet:setopts/2](inet.md#setopts-2). + + +### shutdown/2 ### + + +

+shutdown(X1::http_socket(), How::read | write | read_write) -> ok
+
+
+ +Immediately close a socket in one or two directions. + +__See also:__ [gen_tcp:shutdown/2](gen_tcp.md#shutdown-2). ### sockname/1 ###

-sockname(X1::socks5_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}
+sockname(X1::http_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}
 

diff --git a/doc/hackney_socks5.md b/doc/hackney_socks5.md index 4b528f36..0e5ddedf 100644 --- a/doc/hackney_socks5.md +++ b/doc/hackney_socks5.md @@ -31,7 +31,7 @@ socks5_socket() = {atom(), inet:socket()} ## Function Index ## -
close/1Close a socks5 socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
sockname/1Get the local address and port of a socket.
+
close/1Close a socks5 socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
shutdown/2Immediately close a socket in one or two directions.
sockname/1Get the local address and port of a socket.
@@ -144,6 +144,19 @@ setopts(X1::socks5_socket(), Opts::list()) -&g Set one or more options for a socket. __See also:__ [inet:setopts/2](inet.md#setopts-2). + + +### shutdown/2 ### + + +

+shutdown(X1::socks5_socket(), How::read | write | read_write) -> ok
+
+
+ +Immediately close a socket in one or two directions. + +__See also:__ [gen_tcp:shutdown/2](gen_tcp.md#shutdown-2). ### sockname/1 ### diff --git a/doc/hackney_ssl_transport.md b/doc/hackney_ssl_transport.md index 564f14ae..b36e6e67 100644 --- a/doc/hackney_ssl_transport.md +++ b/doc/hackney_ssl_transport.md @@ -10,7 +10,7 @@ ## Function Index ## -
close/1Close a TCP socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
sockname/1Get the local address and port of a socket.
+
close/1Close a TCP socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
shutdown/2Immediately close a socket in one or two directions.
sockname/1Get the local address and port of a socket.
@@ -123,6 +123,19 @@ setopts(Socket::ssl:sslsocket(), Opts::list( Set one or more options for a socket. __See also:__ [ssl:setopts/2](ssl.md#setopts-2). + + +### shutdown/2 ### + + +

+shutdown(Socket::ssl:socket(), How::read | write | read_write) -> ok
+
+
+ +Immediately close a socket in one or two directions. + +__See also:__ [ssl:shutdown/2](ssl.md#shutdown-2). ### sockname/1 ### diff --git a/doc/hackney_tcp_transport.md b/doc/hackney_tcp_transport.md index d95059ce..617ca60d 100644 --- a/doc/hackney_tcp_transport.md +++ b/doc/hackney_tcp_transport.md @@ -10,7 +10,7 @@ ## Function Index ## -
close/1Close a TCP socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
sockname/1Get the local address and port of a socket.
+
close/1Close a TCP socket.
connect/3
connect/4
controlling_process/2Assign a new controlling process Pid to Socket.
messages/1Atoms used to identify messages in {active, once | true} mode.
peername/1Return the address and port for the other end of a connection.
recv/2
recv/3Receive a packet from a socket in passive mode.
send/2Send a packet on a socket.
setopts/2Set one or more options for a socket.
shutdown/2Immediately close a socket in one or two directions.
sockname/1Get the local address and port of a socket.
@@ -123,6 +123,19 @@ setopts(Socket::inet:socket(), Opts::list()) - Set one or more options for a socket. __See also:__ [inet:setopts/2](inet.md#setopts-2). + + +### shutdown/2 ### + + +

+shutdown(Socket::inet:socket(), How::read | write | read_write) -> ok
+
+
+ +Immediately close a socket in one or two directions. + +__See also:__ [gen_tcp:shutdown/2](gen_tcp.md#shutdown-2). ### sockname/1 ### diff --git a/doc/overview.edoc b/doc/overview.edoc index d0c24c95..13f2ef9c 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -16,7 +16,7 @@ @copyright 2012-2015 Benoît Chesneau. -@version 1.0.6 +@version 1.1.0 @title hackney - HTTP client library in Erlang @doc diff --git a/src/hackney.app.src b/src/hackney.app.src index 5993f4c8..99fcc354 100644 --- a/src/hackney.app.src +++ b/src/hackney.app.src @@ -4,7 +4,7 @@ {application, hackney, [ {description, "simple HTTP client"}, - {vsn, "1.0.6"}, + {vsn, "1.1.0"}, {registered, [hackney_pool]}, {applications, [kernel, stdlib,