Skip to content

Commit 3e2b578

Browse files
authored
Merge pull request #694 from kianmeng/fix-typos
Fix typos
2 parents c0bb6d0 + e2f6214 commit 3e2b578

11 files changed

Lines changed: 31 additions & 31 deletions

NEWS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1.17.3 - 2021-03-17
1515
-------------------
1616

17-
- fix: ensure we release a socket in the pool when the requester died before beeing monitored.
17+
- fix: ensure we release a socket in the pool when the requester died before being monitored.
1818

1919
1.17.2 - 2021-03-16
2020
-------------------
@@ -132,7 +132,7 @@ systems using URL as signature or in an hash.
132132
- bump to idna 0.6.0
133133
- fix support of rebar2
134134
- fix specs
135-
- add `hackney:sockname/1` adn `hackney:peername/1` functions
135+
- add `hackney:sockname/1` and `hackney:peername/1` functions
136136
- add new `checkout_timeout` option for clarity
137137
- improve `hackney_url:parse_qs/1` to trim leading and trailing empty values
138138

@@ -444,7 +444,7 @@ systems using URL as signature or in an hash.
444444
------------------
445445

446446
- improvement: Do not wait to cancel a request
447-
- improvement: do not control the request premptively
447+
- improvement: do not control the request preemptively
448448

449449
1.0.4 - 2014/12/8
450450
-----------------
@@ -537,7 +537,7 @@ supported release of hackney.
537537
### Breaking change:
538538

539539
When doing an HEAD request, the signature of the response when it
540-
succeded is now `{ok, Status, ResponseHeaders}` and do not contains a
540+
succeeded is now `{ok, Status, ResponseHeaders}` and do not contains a
541541
client reference any more.
542542

543543

@@ -684,7 +684,7 @@ service release with a new feature and some minor improvements
684684

685685
- added the support for [socks5
686686
proxies](https://github.com/benoitc/hackney#socks5-proxy)
687-
- improvment: integer and atom can now be passed in url params or forms
687+
- improvement: integer and atom can now be passed in url params or forms
688688
values.
689689
- breaking change: differentiate connect/recv timeout, now connect
690690
timeout return `{error, connect_timeout}`
@@ -710,7 +710,7 @@ used for async response requests.
710710
process is killed.
711711
- fix: make sure we pass a `Transfer-Encoding: chunked` header when we
712712
send a body without content-length.
713-
- fix: make sure the client is correcly reconnected when we reuse a
713+
- fix: make sure the client is correctly reconnected when we reuse a
714714
reference.
715715

716716
0.7.0 - 2013/11/22
@@ -768,7 +768,7 @@ fix: fix file upload content type
768768
0.4.2 - 2013/06/10
769769
------------------
770770

771-
- handle `identity` transfert encoding. When the connection close return
771+
- handle `identity` transfer encoding. When the connection close return
772772
latest buffer.
773773

774774
0.4.1 - 2013/06/10
@@ -806,7 +806,7 @@ and maybe use the partial body.
806806

807807
- Add Multipart support
808808
- Add HTTP Proxy tunneling support
809-
- Fix Chuncked Response decoding
809+
- Fix Chunked Response decoding
810810

811811
0.2.0 - 2012/07/18
812812
------------------

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->
171171
> Note: you can also fetch a multipart response using the functions
172172
> `hackney:stream_multipart/1` and `hackney:skip_multipart/1`.
173173
174-
> Note 2: using the `with_body` option will return the body directy instead of a reference.
174+
> Note 2: using the `with_body` option will return the body directly instead of a reference.
175175
176176
### Reuse a connection
177177

@@ -327,7 +327,7 @@ LoopFun(LoopFun, ClientRef).
327327
> example [test_async_once2](https://github.com/benoitc/hackney/blob/master/examples/test_async_once2.erl) for the usage.
328328
329329
> **Note 4**: When the option `{follow_redirect, true}` is passed to
330-
> the request, you will receive the folllowing messages on valid
330+
> the request, you will receive the following messages on valid
331331
> redirection:
332332
> - `{redirect, To, Headers}`
333333
> - `{see_other, To, Headers}` for status 303 and POST requests.

doc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->
171171
> Note: you can also fetch a multipart response using the functions
172172
> `hackney:stream_multipart/1` and `hackney:skip_multipart/1`.
173173
174-
> Note 2: using the `with_body` option will return the body directy instead of a reference.
174+
> Note 2: using the `with_body` option will return the body directly instead of a reference.
175175
176176
### Reuse a connection
177177

@@ -327,7 +327,7 @@ LoopFun(LoopFun, ClientRef).
327327
> example [test_async_once2](https://github.com/benoitc/hackney/blob/master/examples/test_async_once2.erl) for the usage.
328328
329329
> **Note 4**: When the option `{follow_redirect, true}` is passed to
330-
> the request, you will receive the folllowing messages on valid
330+
> the request, you will receive the following messages on valid
331331
> redirection:
332332
> - `{redirect, To, Headers}`
333333
> - `{see_other, To, Headers}` for status 303 and POST requests.

doc/hackney.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ url() = #hackney_url{} | binary()
4545

4646

4747
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#body-1">body/1</a></td><td>Return the full body sent with the response.</td></tr><tr><td valign="top"><a href="#body-2">body/2</a></td><td>Return the full body sent with the response as long as the body
48-
length doesn't go over MaxLength.</td></tr><tr><td valign="top"><a href="#cancel_request-1">cancel_request/1</a></td><td>Extract raw informations from the client context
48+
length doesn't go over MaxLength.</td></tr><tr><td valign="top"><a href="#cancel_request-1">cancel_request/1</a></td><td>Extract raw information from the client context
4949
This feature can be useful when you want to create a simple proxy, rerouting
5050
on the headers and the status line and continue to forward the connection for example.</td></tr><tr><td valign="top"><a href="#close-1">close/1</a></td><td>close the client.</td></tr><tr><td valign="top"><a href="#connect-1">connect/1</a></td><td></td></tr><tr><td valign="top"><a href="#connect-2">connect/2</a></td><td></td></tr><tr><td valign="top"><a href="#connect-3">connect/3</a></td><td>connect a socket and create a client state.</td></tr><tr><td valign="top"><a href="#connect-4">connect/4</a></td><td></td></tr><tr><td valign="top"><a href="#controlling_process-2">controlling_process/2</a></td><td>Assign a new controlling process <em>Pid</em> to <em>Client</em>.</td></tr><tr><td valign="top"><a href="#cookies-1">cookies/1</a></td><td></td></tr><tr><td valign="top"><a href="#finish_send_body-1">finish_send_body/1</a></td><td></td></tr><tr><td valign="top"><a href="#location-1">location/1</a></td><td>return the requested location.</td></tr><tr><td valign="top"><a href="#pause_stream-1">pause_stream/1</a></td><td>pause a response stream, the stream process will hibernate and
5151
be woken later by the resume function.</td></tr><tr><td valign="top"><a href="#peername-1">peername/1</a></td><td>peername of the client.</td></tr><tr><td valign="top"><a href="#redirect_location-1">redirect_location/1</a></td><td></td></tr><tr><td valign="top"><a href="#request-1">request/1</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-2">request/2</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-3">request/3</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-4">request/4</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-5">request/5</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request_info-1">request_info/1</a></td><td>get request info.</td></tr><tr><td valign="top"><a href="#resume_stream-1">resume_stream/1</a></td><td>resume a paused response stream, the stream process will be
@@ -112,7 +112,7 @@ cancel_request(Ref::<a href="#type-client_ref">client_ref()</a>) -&gt; {ok, {ato
112112
</code></pre>
113113
<br />
114114

115-
Extract raw informations from the client context
115+
Extract raw information from the client context
116116
This feature can be useful when you want to create a simple proxy, rerouting
117117
on the headers and the status line and continue to forward the connection for example.
118118

doc/hackney_headers_new.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ value() = binary() | {binary() | [{binary(), binary()} | binary()]}
5555

5656

5757
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#append-3">append/3</a></td><td>append a new value to the list of value for the the header field
58-
if the key has not been recorded the list will be created with the value as the first item.</td></tr><tr><td valign="top"><a href="#delete-2">delete/2</a></td><td>delete a field from headers.</td></tr><tr><td valign="top"><a href="#fold-3">fold/3</a></td><td></td></tr><tr><td valign="top"><a href="#from_list-1">from_list/1</a></td><td>create headers from a list.</td></tr><tr><td valign="top"><a href="#get_value-2">get_value/2</a></td><td>get the first value of an headers or return undefined.</td></tr><tr><td valign="top"><a href="#get_value-3">get_value/3</a></td><td>get the first value of an headers or return the default.</td></tr><tr><td valign="top"><a href="#is_key-2">is_key/2</a></td><td>is the header field exists or no.</td></tr><tr><td valign="top"><a href="#lookup-2">lookup/2</a></td><td></td></tr><tr><td valign="top"><a href="#merge-2">merge/2</a></td><td>merge 2 headers objects.</td></tr><tr><td valign="top"><a href="#new-0">new/0</a></td><td>initialize an empty headers objecy.</td></tr><tr><td valign="top"><a href="#new-1">new/1</a></td><td></td></tr><tr><td valign="top"><a href="#parse_content_type-1">parse_content_type/1</a></td><td></td></tr><tr><td valign="top"><a href="#parse_media_type-2">parse_media_type/2</a></td><td>Parse a media type.</td></tr><tr><td valign="top"><a href="#size-1">size/1</a></td><td>return the number of headers fields.</td></tr><tr><td valign="top"><a href="#store-2">store/2</a></td><td>store a list of headers.</td></tr><tr><td valign="top"><a href="#store-3">store/3</a></td><td>replace the content of the header field with the value or the list of values.</td></tr><tr><td valign="top"><a href="#store_new-3">store_new/3</a></td><td>only store a vakue if the key exist.</td></tr><tr><td valign="top"><a href="#to_binary-1">to_binary/1</a></td><td>transform headers to a binary that can be used to construct a request.</td></tr><tr><td valign="top"><a href="#to_iolist-1">to_iolist/1</a></td><td>conver headers to an iolist.</td></tr><tr><td valign="top"><a href="#to_list-1">to_list/1</a></td><td>convert headers to a list.</td></tr></table>
58+
if the key has not been recorded the list will be created with the value as the first item.</td></tr><tr><td valign="top"><a href="#delete-2">delete/2</a></td><td>delete a field from headers.</td></tr><tr><td valign="top"><a href="#fold-3">fold/3</a></td><td></td></tr><tr><td valign="top"><a href="#from_list-1">from_list/1</a></td><td>create headers from a list.</td></tr><tr><td valign="top"><a href="#get_value-2">get_value/2</a></td><td>get the first value of an headers or return undefined.</td></tr><tr><td valign="top"><a href="#get_value-3">get_value/3</a></td><td>get the first value of an headers or return the default.</td></tr><tr><td valign="top"><a href="#is_key-2">is_key/2</a></td><td>is the header field exists or no.</td></tr><tr><td valign="top"><a href="#lookup-2">lookup/2</a></td><td></td></tr><tr><td valign="top"><a href="#merge-2">merge/2</a></td><td>merge 2 headers objects.</td></tr><tr><td valign="top"><a href="#new-0">new/0</a></td><td>initialize an empty headers objecy.</td></tr><tr><td valign="top"><a href="#new-1">new/1</a></td><td></td></tr><tr><td valign="top"><a href="#parse_content_type-1">parse_content_type/1</a></td><td></td></tr><tr><td valign="top"><a href="#parse_media_type-2">parse_media_type/2</a></td><td>Parse a media type.</td></tr><tr><td valign="top"><a href="#size-1">size/1</a></td><td>return the number of headers fields.</td></tr><tr><td valign="top"><a href="#store-2">store/2</a></td><td>store a list of headers.</td></tr><tr><td valign="top"><a href="#store-3">store/3</a></td><td>replace the content of the header field with the value or the list of values.</td></tr><tr><td valign="top"><a href="#store_new-3">store_new/3</a></td><td>only store a value if the key exist.</td></tr><tr><td valign="top"><a href="#to_binary-1">to_binary/1</a></td><td>transform headers to a binary that can be used to construct a request.</td></tr><tr><td valign="top"><a href="#to_iolist-1">to_iolist/1</a></td><td>convert headers to an iolist.</td></tr><tr><td valign="top"><a href="#to_list-1">to_list/1</a></td><td>convert headers to a list.</td></tr></table>
5959

6060

6161
<a name="functions"></a>
@@ -150,7 +150,7 @@ merge(Headers1::<a href="#type-headers">headers()</a>, X2::<a href="#type-header
150150
</code></pre>
151151
<br />
152152

153-
merge 2 headers objects. If a key is already exising in HEader1, it will be kept.
153+
merge 2 headers objects. If a key is already existing in HEader1, it will be kept.
154154

155155
<a name="new-0"></a>
156156

@@ -234,7 +234,7 @@ store_new(Key::<a href="#type-key">key()</a>, Value::<a href="#type-value">value
234234
</code></pre>
235235
<br />
236236

237-
only store a vakue if the key exist.
237+
only store a value if the key exist.
238238

239239
<a name="to_binary-1"></a>
240240

@@ -256,7 +256,7 @@ to_iolist(Headers::<a href="#type-headers">headers()</a>) -&gt; iolist()
256256
</code></pre>
257257
<br />
258258

259-
conver headers to an iolist. Useful to send them over the wire.
259+
convert headers to an iolist. Useful to send them over the wire.
260260

261261
<a name="to_list-1"></a>
262262

doc/overview.edoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->
180180
> Note: you can also fetch a multipart response using the functions
181181
> `hackney:stream_multipart/1` and `hackney:skip_multipart/1'.
182182

183-
> Note 2: using the `with_body' option will return the body directy instead of a reference.
183+
> Note 2: using the `with_body' option will return the body directly instead of a reference.
184184

185185
### Reuse a connection
186186

@@ -329,7 +329,7 @@ LoopFun(LoopFun, ClientRef).</pre>
329329
> example [test_async_once2](https://github.com/benoitc/hackney/blob/master/examples/test_async_once2.erl) for the usage.
330330

331331
> **Note 4**: When the option `{follow_redirect, true}' is passed to
332-
> the request, you will receive the folllowing messages on valid
332+
> the request, you will receive the following messages on valid
333333
> redirection:
334334
> - `{redirect, To, Headers}'
335335
> - `{see_other, To, Headers}' for status 303 and POST requests.

src/hackney.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ connect(Transport, Host, Port, Options) ->
7575
controlling_process(Ref, Pid) ->
7676
hackney_manager:controlling_process(Ref, Pid).
7777

78-
%% @doc Extract raw informations from the client context
78+
%% @doc Extract raw information from the client context
7979
%% This feature can be useful when you want to create a simple proxy, rerouting
8080
%% on the headers and the status line and continue to forward the connection for example.
8181
%%

src/hackney_headers_new.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ store(KVs, Headers) when is_list(KVs) ->
8787
KVs
8888
).
8989

90-
%% @doc only store a vakue if the key exist.
90+
%% @doc only store a value if the key exist.
9191
-spec store_new(key(), value(), headers()) -> {boolean(), headers()}.
9292
store_new(Key, Value, {_N, DictHeaders}=Headers) ->
9393
KL = ?kl(Key),
@@ -148,7 +148,7 @@ do_fold([{_, Key, Value} | Rest], Fun, Acc) ->
148148
do_fold(Rest, Fun, Fun(Key, Value, Acc));
149149
do_fold([], _Fun, Acc) -> Acc.
150150

151-
%% @doc merge 2 headers objects. If a key is already exising in HEader1, it will be kept.
151+
%% @doc merge 2 headers objects. If a key is already existing in HEader1, it will be kept.
152152
-spec merge(headers(), headers()) -> headers().
153153
merge(Headers1, {_, DictHeaders2}) ->
154154
dict:fold(
@@ -178,7 +178,7 @@ to_list(Headers) ->
178178
),
179179
lists:reverse(Result).
180180

181-
%% @doc conver headers to an iolist. Useful to send them over the wire.
181+
%% @doc convert headers to an iolist. Useful to send them over the wire.
182182
-spec to_iolist(headers()) -> iolist().
183183
to_iolist(Headers) ->
184184
L = fold(

src/hackney_http_connect.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ connect(ProxyHost, ProxyPort, Opts, Timeout)
6262
{nodelay, true}],
6363
ConnectOpts = hackney_util:filter_options(Opts, AcceptedOpts, BaseOpts),
6464

65-
%% connnect to the proxy, and upgrade the socket if needed.
65+
%% connect to the proxy, and upgrade the socket if needed.
6666
case gen_tcp:connect(ProxyHost, ProxyPort, ConnectOpts) of
6767
{ok, Socket} ->
6868
case do_handshake(Socket, Host, Port, Opts) of

src/hackney_manager.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ new_request(Client) ->
5959
init_request(InitialState) ->
6060
%% initialize the request
6161
Ref = make_ref(),
62-
%% store the current state in the process dictionnary
62+
%% store the current state in the process dictionary
6363
put(Ref, InitialState#client{request_ref=Ref}),
6464
%% supervise the process owner
6565
{ok, StartTime} = gen_server:call(?MODULE, {new_request, self(), Ref,
@@ -160,15 +160,15 @@ start_async_response(Ref) ->
160160
case gen_server:call(?MODULE, {start_async_response, Ref,
161161
StreamTo, Client}) of
162162
{ok, Pid} ->
163-
%% store temporarely the socket in the the ets so it can
163+
%% store temporarily the socket in the the ets so it can
164164
%% be used by the other process later
165165
true = ets:insert(?MODULE, {Ref, #request{ref=Ref,
166166
state=Client}}),
167-
%% delete the current state from the process dictionnary
167+
%% delete the current state from the process dictionary
168168
%% since it's not the owner
169169
erase(Ref),
170170

171-
%% transfert the control of the socket
171+
%% transfer the control of the socket
172172
case Transport:controlling_process(Socket, Pid) of
173173
ok -> Pid ! controlling_process_done, ok;
174174
Else -> Else
@@ -470,7 +470,7 @@ handle_stream_exit(Pid, Ref, Reason, State) ->
470470
[{Ref, {Owner, Pid, #request_info{pool=Pool}=Info}}] ->
471471
%% untrack the owner
472472
Pids2 = untrack_owner(Owner, Ref, Pids1),
473-
%% if anormal reason let the owner knows
473+
%% if abnormal reason let the owner knows
474474
_ = case Reason of
475475
normal -> ok;
476476
{owner_down, Owner, _} -> ok; %% we were streaming to

0 commit comments

Comments
 (0)