Skip to content

Commit c8fa2e3

Browse files
Merge pull request esl#21 from paulo-ferraz-oliveira/remove/hrl
Remove hrl
2 parents 42d08bc + 93d96aa commit c8fa2e3

29 files changed

+646
-864
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: CI for lhttpc
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
jobs:
8+
ci:
9+
name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}
10+
runs-on: ${{matrix.os}}
11+
strategy:
12+
matrix:
13+
otp_vsn: [19.3, 20.3, 21.3, 22.3, 23.1]
14+
os: [ubuntu-latest]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: version
18+
run: make version

.gitignore

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
ebin/*
2-
3-
doc/edoc-info
4-
doc/*.html
5-
doc/*.png
6-
doc/*.css
7-
util/*.beam
8-
cover_report/
9-
test/*.beam
10-
test/*.log
11-
12-
.eunit
13-
14-
15-
*.plt
1+
.rebar3
2+
_build
163
erl_crash.dump
17-
18-
19-
_build/
20-
log/
21-
TEST-*.xml
4+
logs
5+
rebar3.crashdump
6+
TEST-*

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,121 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

4-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
67
since version `3.0.0`.
78

9+
## [Unreleased]
10+
11+
### Added
12+
13+
- all types that are exposed via API functions to their respective module's `export_type` sections
14+
15+
### Removed
16+
17+
- lhttpc_types.hrl
18+
- lhttpc.hrl
19+
- defined types that are unused internally (and not exported)
20+
821
## [3.3.0] - 2020-05-22
922

1023
### Added
24+
1125
- compatibility with OTP 23
1226

1327
### Changed
28+
1429
- Travis constraints: updated version as per our current reality; added `make check`
1530
- minimum supported version to 19.3
1631
- README.md: removed outdated info; added test-related info
1732

1833
### Fixed
34+
1935
- some broken tests
2036

2137
## [3.2.0] - 2020-04-30
2238

2339
### Changed
40+
2441
- source of dependencies to Hex, for quicker builds
2542

2643
### Removed
44+
2745
- support for OTP 17
2846
- support for OTP 18
2947
- support for rebar2
3048

3149
## [3.1.0] - 2020-03-12
3250

3351
### Added
52+
3453
- exported types lhttpc:result/0 and lhttpc:headers/0
3554

3655
### Changed
56+
3757
- CA bundles, to base them on the latest Mozilla Included CA Certificate List
3858

3959
### Fixed
60+
4061
- OTP 21 dialyzer warnings
4162

4263
## [3.0.7] - 2019-09-25
43-
#
64+
4465
### Fixed
66+
4567
- unwarranted throwing of exception(s) to consumer during racy pool creation
4668

4769
## [3.0.6] - 2019-09-24
48-
#
70+
4971
### Fixed
72+
5073
- warning on rebar3 over ssl_verify_fun's missing .app description
5174

5275
## [3.0.5] - 2019-02-01
53-
#
76+
5477
### Fixed
78+
5579
- potential compilation issues when importing lib. as a dependency on OTP 21
5680

5781
## [3.0.4] - 2019-01-23
58-
#
82+
5983
### Fixed
84+
6085
- bad specification of returned error reasons on :request/{4,5,6,9}
6186

6287
## [3.0.3] - 2019-01-18
63-
#
88+
6489
### Fixed
90+
6591
- dialyzer warnings
6692

6793
## [3.0.2] - 2018-09-13
68-
#
94+
6995
### Fixed
96+
7097
- OTP 21 compile-time warnings
7198

7299
## [3.0.1] - 2018-08-07
73-
#
100+
74101
### Fixed
102+
75103
- rebar2 support
76104

77105
## [3.0.0] - 2018-08-07
78-
#
106+
79107
### Added
108+
80109
- missing boot dependencies
81110

82111
### Changed
112+
83113
- application was rebar3ified while still being usable as a rebar2 dependency
84114
- application version is now determined from git
85115
- HTTPS requests are now secure by default
86116

87117
### Fixed
118+
88119
- unintelligibility of which test cases failed (main suite)
89120
- low test coverage due to broken test cases that prevented others from running
90121

@@ -118,14 +149,14 @@ Version 1.2.5:
118149
* Fix for decoding chunked HTTP responses with extraneous whitespace
119150
(thanks to Bob Ippolito)
120151
* api.facebook.com includes extra whitespace in its chunked HTTP response
121-
length, e.g. "6 \r\n" instead of "6\r\n".
152+
length, e.g. "6 \r\n" instead of "6\r\n".
122153
123154
Version 1.2.4:
124155
* Fix handling of HTTP response code 304 (patch by Ben Slavin)
125156
126157
Version 1.2.3:
127158
* Fix handling of unexpected 100 Continue response (patch by Magnus Henoch)
128-
159+
129160
Version 1.2.2:
130161
* Fix Host header, add port number (reported by Benoit Chesneau)
131162
@@ -143,7 +174,7 @@ Version 1.2.0:
143174
* The client can either return {ok, Result} or {error, Reason}. Reason
144175
(which wasn't very well defined before) can now be:
145176
* connection_closed: The server closed the connection on us (N times
146-
in case it happens just after sending the request)
177+
in case it happens just after sending the request)
147178
* connect_timeout: If the TCP stack gives up or we hit the
148179
connect_timeout option
149180
* timeout: If the overall request timeout value is hit
@@ -165,14 +196,14 @@ Version 1.1.2:
165196
* Fix minor error with {active, once} instead of {active, true} in manager
166197
* Remove socket and try to find another if the manager can't set controlling
167198
process due to socket error
168-
* Improve test suite
199+
* Improve test suite
169200
170201
Version 1.1.1:
171202
* Fix problem with empty lists in dicts when last socket is consumed
172-
* Improve test suite to include cover report
203+
* Improve test suite to include cover report
173204
174205
Version 1.1.0:
175-
* Support for configurable connection timeout
206+
* Support for configurable connection timeout
176207
177208
Version 1.0.0:
178209
* Initial version
File renamed without changes.

MIGRATION.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
1-
# Migration Plan
1+
# Migration guide
2+
23
Whenever there's an interface breaking change (a change in the project's major version),
34
required migration instructions will be detailed in this file.
45

6+
## From [3.x] to [4.x]
7+
8+
### Update
9+
10+
- your code to depend on types from `lhttpc:` and `lhttpc_client:` and not (imported)
11+
`lhttpc_types.hrl` (a simple `dialyzer` procedure should put into evidence what is mis-specified)
12+
- your code to not depend on `lhttpc.hrl`'s `lhttpc_url` record:
13+
- if you're "building" the record, you can use
14+
`lhttpc_client:new_url(Host, Port, Path, IsSSL, User, Password)` where you were once using
15+
`#lhttpc_url{ host = Host,
16+
port = Port,
17+
path = Path,
18+
is_ssl = IsSSL,
19+
user = User,
20+
password = Password }`
21+
(`lhttpc_client:new_url/4` also available, for convenience)
22+
- your code to access the `lhttpc_url` record content via new accessor functions
23+
`lhttpc_client:url(LhttpcURL, FieldName)`
24+
25+
### Remove
26+
27+
- your code's import of `lhttpc_types.hrl`
28+
- your code's import of `lhttpc.hrl`
29+
530
## From [2.x] to [3.x]
31+
632
### Update
33+
734
- calls to lhttpc:request/{4,5,6,9} requesting HTTPS URLs which you **do** need to keep
835
insecure, and only if you need to do so, by explicitly using the new `verify_ssl_cert` option:
36+
937
```erlang
1038
% before:
1139
lhttpc:request("https://self-signed.badssl.com", "GET", [], <<>>, 5000).
@@ -14,7 +42,9 @@ lhttpc:request("https://self-signed.badssl.com", "GET", [], <<>>, 5000).
1442
lhttpc:request("https://self-signed.badssl.com", "GET", [], <<>>, 5000,
1543
[{verify_ssl_cert, false}]).
1644
```
45+
1746
### Other info
47+
1848
- new dependencies:
19-
- `certifi` (version 2.3.1)
20-
- `ssl_verify_fun` (version 1.1.4)
49+
- `certifi` (version 2.3.1)
50+
- `ssl_verify_fun` (version 1.1.4)

Makefile

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,62 @@
1-
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
1+
SHELL := bash
2+
.ONESHELL:
3+
.SHELLFLAGS := -euc
4+
.DELETE_ON_ERROR:
5+
MAKEFLAGS += --warn-undefined-variables
6+
MAKEFLAGS += --no-builtin-rules
27

3-
ifeq ($(wildcard rebar3),rebar3)
4-
REBAR3 = $(CURDIR)/rebar3
5-
endif
8+
version: upgrade clean compile check test edoc
9+
.PHONY: version
610

7-
REBAR3 ?= $(shell test -e `which rebar3` 2>/dev/null && which rebar3 || echo "./rebar3")
8-
9-
ifeq ($(REBAR3),)
10-
REBAR3 = $(CURDIR)/rebar3
11-
endif
11+
shell:
12+
@rebar3 shell
13+
.PHONY: shell
1214

13-
.PHONY: all build clean check dialyzer xref test cover shell
15+
upgrade: upgrade-rebar3_lint
16+
.PHONY: upgrade
1417

15-
.NOTPARALLEL: check
18+
upgrade-rebar3_lint:
19+
@rebar3 plugins upgrade rebar3_lint
20+
.PHONY: upgrade-rebar3_lint
1621

17-
all: build
22+
clean:
23+
@rebar3 clean -a
24+
.PHONY: clean
1825

19-
build: $(REBAR3)
20-
@$(REBAR3) compile
26+
compile:
27+
@rebar3 compile
28+
.PHONY: compile
2129

22-
$(REBAR3):
23-
wget $(REBAR3_URL) || curl -Lo rebar3 $(REBAR3_URL)
24-
@chmod a+x rebar3
30+
check: xref dialyzer elvis-rock
31+
.PHONY: check
2532

26-
clean: $(REBAR3)
27-
@$(REBAR3) clean
33+
xref:
34+
@rebar3 as test xref
35+
.PHONY: xref
2836

29-
check: dialyzer xref
37+
dialyzer:
38+
@rebar3 as test dialyzer
39+
.PHONY: dialyzer
3040

31-
dialyzer: $(REBAR3)
32-
@$(REBAR3) dialyzer
41+
elvis-rock:
42+
@rebar3 lint
43+
.PHONY: elvis-rock
3344

34-
xref: $(REBAR3)
35-
@$(REBAR3) xref
45+
test: eunit ct cover
46+
.PHONY: test
3647

37-
test: $(REBAR3)
38-
@$(REBAR3) do ct, eunit
48+
eunit:
49+
@rebar3 eunit
50+
.PHONY: eunit
3951

40-
test-travis: $(REBAR3)
41-
@$(REBAR3) as travis-ci do ct, eunit
52+
ct:
53+
@rebar3 ct
54+
.PHONY: ct
4255

43-
cover: test
44-
@$(REBAR3) cover
56+
cover:
57+
@rebar3 cover
58+
.PHONY: cover
4559

46-
shell:
47-
@$(REBAR3) shell
60+
edoc:
61+
@rebar3 edoc
62+
.PHONY: edoc

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# lhttpc
22

3-
[![](https://travis-ci.com/miniclip/lhttpc.png?branch=master)](https://travis-ci.com/miniclip/lhttpc)
4-
[![Erlang][erlang badge]][erlang downloads]
3+
![CI for lhttpc](https://github.com/miniclip/lhttpc/workflows/CI%20for%20lhttpc/badge.svg)
4+
[![erlang][erlang badge]][erlang downloads]
55

66
[erlang badge]: https://img.shields.io/badge/erlang-%3E%3D19.3-lightgrey
77
[erlang downloads]: http://www.erlang.org/download

0 commit comments

Comments
 (0)