Skip to content

Commit dd39277

Browse files
committed
release: 6.0.10
1 parent 72dc744 commit dd39277

File tree

6 files changed

+1963
-899
lines changed

6 files changed

+1963
-899
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.5.1)
22
cmake_policy(SET CMP0069 NEW)
33

4-
project(llhttp VERSION )
4+
project(llhttp VERSION 6.0.10)
55
include(GNUInstallDirs)
66

77
set(CMAKE_C_STANDARD 99)

README.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# llhttp
2+
[![CI](https://github.com/nodejs/llhttp/workflows/CI/badge.svg)](https://github.com/nodejs/llhttp/actions?query=workflow%3ACI)
23

34
Port of [http_parser][0] to [llparse][1].
45

5-
**IMPORTANT: The 2.x series is discontinued and not maintained anymore. Update to the latest version of llhttp as soon as possible. The only exception is the 2.1.x series which will be supported until Node.js 14 goes End-Of-Life).**
6-
76
## Why?
87

98
Let's face it, [http_parser][0] is practically unmaintainable. Even
@@ -33,7 +32,7 @@ So far llhttp outperforms http_parser:
3332

3433
| | input size | bandwidth | reqs/sec | time |
3534
|:----------------|-----------:|-------------:|-----------:|--------:|
36-
| **llhttp** | 8192.00 mb | 1777.24 mb/s | 3583799.39 ops/sec | 4.61 s |
35+
| **llhttp** | 8192.00 mb | 1777.24 mb/s | 3583799.39 req/sec | 4.61 s |
3736
| **http_parser** | 8192.00 mb | 694.66 mb/s | 1406180.33 req/sec | 11.79 s |
3837

3938
llhttp is faster by approximately **156%**.
@@ -91,9 +90,60 @@ if (err == HPE_OK) {
9190
parser.reason);
9291
}
9392
```
93+
For more information on API usage, please refer to [src/native/api.h](https://github.com/nodejs/llhttp/blob/main/src/native/api.h).
94+
95+
## Build Instructions
96+
97+
Make sure you have [Node.js](https://nodejs.org/), npm and npx installed. Then under project directory run:
98+
99+
```sh
100+
npm install
101+
make
102+
```
94103

95104
---
96105

106+
### Bindings to other languages
107+
108+
* Python: [pallas/pyllhttp][8]
109+
* Ruby: [metabahn/llhttp][9]
110+
* Rust: [JackLiar/rust-llhttp][10]
111+
112+
### Using with CMake
113+
114+
If you want to use this library in a CMake project you can use the snippet below.
115+
116+
```
117+
FetchContent_Declare(llhttp
118+
URL "https://github.com/nodejs/llhttp/archive/refs/tags/v6.0.5.tar.gz") # Using version 6.0.5
119+
120+
FetchContent_MakeAvailable(llhttp)
121+
122+
target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp ${PROJECT_NAME})
123+
```
124+
125+
## Building on Windows
126+
127+
### Installation
128+
129+
* `choco install git`
130+
* `choco install node`
131+
* `choco install llvm` (or install the `C++ Clang tools for Windows` optional package from the Visual Studio 2019 installer)
132+
* `choco install make` (or if you have MinGW, it comes bundled)
133+
134+
1. Ensure that `Clang` and `make` are in your system path.
135+
2. Using Git Bash, clone the repo to your preferred location.
136+
3. Cd into the cloned directory and run `npm install`
137+
5. Run `make`
138+
6. Your `repo/build` directory should now have `libllhttp.a` and `libllhttp.so` static and dynamic libraries.
139+
7. When building your executable, you can link to these libraries. Make sure to set the build folder as an include path when building so you can reference the declarations in `repo/build/llhttp.h`.
140+
141+
### A simple example on linking with the library:
142+
143+
Assuming you have an executable `main.cpp` in your current working directory, you would run: `clang++ -Os -g3 -Wall -Wextra -Wno-unused-parameter -I/path/to/llhttp/build main.cpp /path/to/llhttp/build/libllhttp.a -o main.exe`.
144+
145+
If you are getting `unresolved external symbol` linker errors you are likely attempting to build `llhttp.c` without linking it with object files from `api.c` and `http.c`.
146+
97147
#### LICENSE
98148

99149
This software is licensed under the MIT License.
@@ -127,3 +177,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
127177
[5]: https://llvm.org/docs/LangRef.html#call-instruction
128178
[6]: https://clang.llvm.org/
129179
[7]: https://github.com/nodejs/node
180+
[8]: https://github.com/pallas/pyllhttp
181+
[9]: https://github.com/metabahn/llhttp
182+
[10]: https://github.com/JackLiar/rust-llhttp

0 commit comments

Comments
 (0)