Commit Graph

370 Commits (main)

Author SHA1 Message Date
Chris Babcock e29741fb1f Merge remote-tracking branch 'upstream/master' into main 2021-03-06 23:52:36 -07:00
Jianhui Zhao 7f5b41317b feat: connection: new api: traverse_headers
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-03-02 20:53:05 +08:00
Jianhui Zhao 83f888096c style: fix
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-03-02 20:51:58 +08:00
Jianhui Zhao 6c7a255c71 Bump version 3.10.1
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-03-01 17:12:42 +08:00
Jianhui Zhao c35cee771c fix: Misuse of sendfile when SSL is enabled
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-03-01 17:10:09 +08:00
Jianhui Zhao e281f44bde Bump version 3.10.0
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-02-27 00:30:50 +08:00
Jianhui Zhao 93b0e7e3c5 ci: auto release
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-02-27 00:29:53 +08:00
Jianhui Zhao 9166d3ab80 feat: multiple listen
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-02-27 00:22:53 +08:00
Jianhui Zhao 175f7c8f55 ci: build: test all supported ssl libraries
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-02-20 10:48:05 +08:00
Jianhui Zhao f34f8cbb8a Improve gen_cert.sh
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-02-19 15:06:33 +08:00
Jianhui Zhao 930f47282b Bump version 3.9.0
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-27 13:21:02 +08:00
Jianhui Zhao 6e84f2a738 connection: add api: close
close low level TCP connection

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-27 13:18:27 +08:00
Jianhui Zhao 2f951e5166 send_head: use int64_t for content_length
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-21 16:02:44 +08:00
Jianhui Zhao b2e52fe1af Use github actions
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-20 23:33:22 +08:00
Jianhui Zhao fb5c0337a8 Bump CMake minimum to 2.8.12
Fix: CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required)

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-20 22:34:15 +08:00
Jianhui Zhao 81db1fa371 file: support handle large file
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-19 20:35:50 +08:00
Jianhui Zhao f2c55aff77 file: fix bug: send "Content-Range" error
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-19 20:25:33 +08:00
Jianhui Zhao d659ff4e0e
Merge pull request #15 from ffontaine/master
src/uhttpd.c: fix build without dlopen
2021-01-18 15:15:24 +08:00
Fabrice Fontaine 117ae812a4 src/uhttpd.c: fix build without dlopen
Fix the following build failure without dlopen:

/home/buildroot/autobuild/instance-3/output-1/build/libuhttpd-3.8.0/src/uhttpd.c: In function 'uh_load_plugin':
/home/buildroot/autobuild/instance-3/output-1/build/libuhttpd-3.8.0/src/uhttpd.c:155:32: error: unused variable 'srvi' [-Werror=unused-variable]
     struct uh_server_internal *srvi = (struct uh_server_internal *)srv;
                                ^~~~

Fixes:
 - http://autobuild.buildroot.org/results/00e5b5e1da782dcedda48777cbb0a2cba9c98cec

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-01-18 07:33:34 +01:00
Jianhui Zhao 2f12b7d434 connection: New API: get_content_length
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-15 17:17:23 +08:00
Jianhui Zhao fa6248b1f1 uh_log_xx: check the arguments like printf
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-15 15:40:21 +08:00
Jianhui Zhao b0d35ed4fb example: Improve code
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-15 15:35:35 +08:00
Jianhui Zhao afeee7ec2f Support set a callback for connection closed
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-15 13:07:37 +08:00
Jianhui Zhao 6cf45fb0a2 uh_connection: Add a pointer to save context for user
userdata

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-15 12:02:10 +08:00
Jianhui Zhao 971602f45f use url decode while handle file
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-15 11:52:25 +08:00
Jianhui Zhao 563ec0ff42 Update .gitignore
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-12 10:39:06 +08:00
Jianhui Zhao edb1721c4a Bump version 3.8.0
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-11 21:41:47 +08:00
Jianhui Zhao 293a39f201 fix compile error for 32bit os
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-09 22:06:23 +08:00
Jianhui Zhao c28eaa2bb7 Multi-process operation are not directly integrated
The multi-process model is presented as sample code.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-09 00:04:50 +08:00
Jianhui Zhao 808bb3785b Improve code
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-08 23:58:08 +08:00
Jianhui Zhao 33339863b5 clean debug code
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-08 23:27:15 +08:00
Jianhui Zhao 6914be6bb0
Merge pull request #14 from ffontaine/master
CMakeLists.txt: add BUILD_EXAMPLE
2021-01-08 18:13:30 +08:00
Fabrice Fontaine a1a43f8370 CMakeLists.txt: add BUILD_EXAMPLE
Allow the user to disable example

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-01-08 08:01:26 +01:00
Jianhui Zhao d53a954794 check the arguments like printf
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-06 23:02:25 +08:00
Jianhui Zhao e7f5ca114c fix bug: format number abnormal on some platform
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-06 01:43:05 +08:00
Jianhui Zhao de6bd1bf92 improve conn_send_file
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-06 01:02:59 +08:00
Jianhui Zhao b0bed67434 Add some api
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-06 00:51:23 +08:00
Jianhui Zhao 8c2e9c3a57 Fix bug: Parent process exits but child process didn't
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-04 15:48:09 +08:00
Jianhui Zhao db85c135cb Use SO_REUSEPORT
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 21:53:20 +08:00
Jianhui Zhao b2ce003bcc Improve variable name
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 19:58:35 +08:00
Jianhui Zhao f044dc97a9 Watching worker processes
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 18:36:29 +08:00
Jianhui Zhao 9ae7b25f84 example.c: Worker processes number is configurable
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 18:19:44 +08:00
Jianhui Zhao d6868b6ab3 multi-process model: Improve
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 18:15:06 +08:00
Jianhui Zhao c11052e302 uh_start_worker: Improve
The child process is only created when the number of workers is greater than 1

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 17:38:36 +08:00
Jianhui Zhao 143e0d8abe Update README
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 17:25:00 +08:00
Jianhui Zhao 8070cc20c9 README: Add benchmark
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 16:54:31 +08:00
Jianhui Zhao ffa199a647 Support multi-process model
The same multi-process model as Nginx

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-03 16:22:47 +08:00
Jianhui Zhao 55a9b04d31 fix bug: response large(> 4294967295) file fail
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-02 23:31:51 +08:00
Jianhui Zhao 0755e549ff file: support range requests
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-02 23:30:39 +08:00
Jianhui Zhao f767b6cd5f conn_send_file: improve
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2021-01-02 20:41:59 +08:00