Skip to content

Commit 1cf1e51

Browse files
committed
Synchronize with the latest archived http-parser
http-parser is not actively maintained. We should migrate to llhttp or alternatives.
1 parent 19e5454 commit 1cf1e51

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.o.cmd
44
.tmp_versions
55
*.symvers
6+
*.symvers.cmd
67
*.mod*
78
*.order
89
*.o

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ clean:
3232
# with "compat/string.h", which is just a wrapper to Linux kernel headers.
3333
# TODO: rewrite with elegant scripts
3434
http_parser.c:
35-
wget -q https://raw.githubusercontent.com/nodejs/http-parser/master/http_parser.c
35+
wget -q https://raw.githubusercontent.com/nodejs/http-parser/main/http_parser.c
3636
@sed -i 's/#include <assert.h>/#include "compat\/assert.h"/' $@
3737
@sed -i 's/#include <stddef.h>/#include "compat\/stddef.h"/' $@
3838
@sed -i 's/#include <ctype.h>/#include "compat\/ctype.h"/' $@
3939
@sed -i 's/#include <string.h>/#include "compat\/string.h"/' $@
4040
@sed -i 's/#include <limits.h>/#include "compat\/limits.h"/' $@
4141
@echo "File $@ was patched."
42-
wget -q https://raw.githubusercontent.com/nodejs/http-parser/master/http_parser.h
42+
wget -q https://raw.githubusercontent.com/nodejs/http-parser/main/http_parser.h
4343
@sed -i 's/#include <stddef.h>/#include "compat\/stddef.h"/' http_parser.h
4444
@sed -i 's/#include <stdint.h>/#include "compat\/stdint.h"/' http_parser.h
4545
@echo "File http_parser.h was patched."

htstress.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static void print_usage()
369369
int main(int argc, char *argv[])
370370
{
371371
pthread_t useless_thread;
372-
char *host = NULL;
372+
const char *host = NULL;
373373
char *node = NULL;
374374
char *port = "http";
375375
struct sockaddr_in *ssin = (struct sockaddr_in *) &sss;

scripts/pre-commit.hook

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
CPPCHECK_suppresses="--suppress=missingIncludeSystem \
55
--suppress=unusedFunction:http_parser.c \
66
--suppress=duplicateBreak:http_parser.c \
7-
--suppress=shadowVariable:http_parser.c"
7+
--suppress=shadowVariable:http_parser.c \
8+
--suppress=unknownMacro:http_server.c \
9+
--suppress=unusedStructMember:http_parser.h \
10+
--suppress=unusedStructMember:http_server.h"
811
CPPCHECK_OPTS="-I. --enable=all --error-exitcode=1 --force $CPPCHECK_suppresses"
912

1013
RETURN=0

0 commit comments

Comments
 (0)