-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec29e7c
commit 59338a0
Showing
39 changed files
with
4,438 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule http-parser
deleted from
335850
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/out/ | ||
core | ||
tags | ||
*.o | ||
test | ||
test_g | ||
test_fast | ||
bench | ||
url_parser | ||
parsertrace | ||
parsertrace_g | ||
*.mk | ||
*.Makefile | ||
*.so.* | ||
*.exe.* | ||
*.exe | ||
*.a | ||
|
||
|
||
# Visual Studio uglies | ||
*.suo | ||
*.sln | ||
*.vcxproj | ||
*.vcxproj.filters | ||
*.vcxproj.user | ||
*.opensdf | ||
*.ncrunchsolution* | ||
*.sdf | ||
*.vsp | ||
*.psess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# update AUTHORS with: | ||
# git log --all --reverse --format='%aN <%aE>' | perl -ne 'BEGIN{print "# Authors ordered by first contribution.\n"} print unless $h{$_}; $h{$_} = 1' > AUTHORS | ||
Ryan Dahl <[email protected]> | ||
Salman Haq <[email protected]> | ||
Simon Zimmermann <[email protected]> | ||
Thomas LE ROUX <[email protected]> LE ROUX Thomas <[email protected]> | ||
Thomas LE ROUX <[email protected]> Thomas LE ROUX <[email protected]> | ||
Fedor Indutny <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: c | ||
|
||
compiler: | ||
- clang | ||
- gcc | ||
|
||
script: | ||
- "make" | ||
|
||
notifications: | ||
email: false | ||
irc: | ||
- "irc.freenode.net#node-ci" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Authors ordered by first contribution. | ||
Ryan Dahl <[email protected]> | ||
Jeremy Hinegardner <[email protected]> | ||
Sergey Shepelev <[email protected]> | ||
Joe Damato <[email protected]> | ||
tomika <[email protected]> | ||
Phoenix Sol <[email protected]> | ||
Cliff Frey <[email protected]> | ||
Ewen Cheslack-Postava <[email protected]> | ||
Santiago Gala <[email protected]> | ||
Tim Becker <[email protected]> | ||
Jeff Terrace <[email protected]> | ||
Ben Noordhuis <[email protected]> | ||
Nathan Rajlich <[email protected]> | ||
Mark Nottingham <[email protected]> | ||
Aman Gupta <[email protected]> | ||
Tim Becker <[email protected]> | ||
Sean Cunningham <[email protected]> | ||
Peter Griess <[email protected]> | ||
Salman Haq <[email protected]> | ||
Cliff Frey <[email protected]> | ||
Jon Kolb <[email protected]> | ||
Fouad Mardini <[email protected]> | ||
Paul Querna <[email protected]> | ||
Felix Geisendörfer <[email protected]> | ||
koichik <[email protected]> | ||
Andre Caron <[email protected]> | ||
Ivo Raisr <[email protected]> | ||
James McLaughlin <[email protected]> | ||
David Gwynne <[email protected]> | ||
Thomas LE ROUX <[email protected]> | ||
Randy Rizun <[email protected]> | ||
Andre Louis Caron <[email protected]> | ||
Simon Zimmermann <[email protected]> | ||
Erik Dubbelboer <[email protected]> | ||
Martell Malone <[email protected]> | ||
Bertrand Paquet <[email protected]> | ||
BogDan Vatra <[email protected]> | ||
Peter Faiman <[email protected]> | ||
Corey Richardson <[email protected]> | ||
Tóth Tamás <[email protected]> | ||
Cam Swords <[email protected]> | ||
Chris Dickinson <[email protected]> | ||
Uli Köhler <[email protected]> | ||
Charlie Somerville <[email protected]> | ||
Patrik Stutz <[email protected]> | ||
Fedor Indutny <[email protected]> | ||
runner <[email protected]> | ||
Alexis Campailla <[email protected]> | ||
David Wragg <[email protected]> | ||
Vinnie Falco <[email protected]> | ||
Alex Butum <[email protected]> | ||
Rex Feng <[email protected]> | ||
Alex Kocharin <[email protected]> | ||
Mark Koopman <[email protected]> | ||
Helge Heß <[email protected]> | ||
Alexis La Goutte <[email protected]> | ||
George Miroshnykov <[email protected]> | ||
Maciej Małecki <[email protected]> | ||
Marc O'Morain <[email protected]> | ||
Jeff Pinner <[email protected]> | ||
Timothy J Fontaine <[email protected]> | ||
Akagi201 <[email protected]> | ||
Romain Giraud <[email protected]> | ||
Jay Satiro <[email protected]> | ||
Arne Steen <[email protected]> | ||
Kjell Schubert <[email protected]> | ||
Olivier Mengué <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright | ||
Igor Sysoev. | ||
|
||
Additional changes are licensed under the same terms as NGINX and | ||
copyright Joyent, Inc. and other Node contributors. All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to | ||
deal in the Software without restriction, including without limitation the | ||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
sell copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Copyright Joyent, Inc. and other Node contributors. All rights reserved. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to | ||
# deal in the Software without restriction, including without limitation the | ||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
# sell copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
# IN THE SOFTWARE. | ||
|
||
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') | ||
HELPER ?= | ||
BINEXT ?= | ||
ifeq (darwin,$(PLATFORM)) | ||
SONAME ?= libhttp_parser.2.7.1.dylib | ||
SOEXT ?= dylib | ||
else ifeq (wine,$(PLATFORM)) | ||
CC = winegcc | ||
BINEXT = .exe.so | ||
HELPER = wine | ||
else | ||
SONAME ?= libhttp_parser.so.2.7.1 | ||
SOEXT ?= so | ||
endif | ||
|
||
CC?=gcc | ||
AR?=ar | ||
|
||
CPPFLAGS ?= | ||
LDFLAGS ?= | ||
|
||
CPPFLAGS += -I. | ||
CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1 | ||
CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA) | ||
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0 | ||
CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA) | ||
CPPFLAGS_BENCH = $(CPPFLAGS_FAST) | ||
|
||
CFLAGS += -Wall -Wextra -Werror | ||
CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA) | ||
CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA) | ||
CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter | ||
CFLAGS_LIB = $(CFLAGS_FAST) -fPIC | ||
|
||
LDFLAGS_LIB = $(LDFLAGS) -shared | ||
|
||
INSTALL ?= install | ||
PREFIX ?= $(DESTDIR)/usr/local | ||
LIBDIR = $(PREFIX)/lib | ||
INCLUDEDIR = $(PREFIX)/include | ||
|
||
ifneq (darwin,$(PLATFORM)) | ||
# TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname... | ||
LDFLAGS_LIB += -Wl,-soname=$(SONAME) | ||
endif | ||
|
||
test: test_g test_fast | ||
$(HELPER) ./test_g$(BINEXT) | ||
$(HELPER) ./test_fast$(BINEXT) | ||
|
||
test_g: http_parser_g.o test_g.o | ||
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@ | ||
|
||
test_g.o: test.c http_parser.h Makefile | ||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c test.c -o $@ | ||
|
||
http_parser_g.o: http_parser.c http_parser.h Makefile | ||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c http_parser.c -o $@ | ||
|
||
test_fast: http_parser.o test.o http_parser.h | ||
$(CC) $(CFLAGS_FAST) $(LDFLAGS) http_parser.o test.o -o $@ | ||
|
||
test.o: test.c http_parser.h Makefile | ||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@ | ||
|
||
bench: http_parser.o bench.o | ||
$(CC) $(CFLAGS_BENCH) $(LDFLAGS) http_parser.o bench.o -o $@ | ||
|
||
bench.o: bench.c http_parser.h Makefile | ||
$(CC) $(CPPFLAGS_BENCH) $(CFLAGS_BENCH) -c bench.c -o $@ | ||
|
||
http_parser.o: http_parser.c http_parser.h Makefile | ||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c | ||
|
||
test-run-timed: test_fast | ||
while(true) do time $(HELPER) ./test_fast$(BINEXT) > /dev/null; done | ||
|
||
test-valgrind: test_g | ||
valgrind ./test_g | ||
|
||
libhttp_parser.o: http_parser.c http_parser.h Makefile | ||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o | ||
|
||
library: libhttp_parser.o | ||
$(CC) $(LDFLAGS_LIB) -o $(SONAME) $< | ||
|
||
package: http_parser.o | ||
$(AR) rcs libhttp_parser.a http_parser.o | ||
|
||
url_parser: http_parser.o contrib/url_parser.c | ||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o $@ | ||
|
||
url_parser_g: http_parser_g.o contrib/url_parser.c | ||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@ | ||
|
||
parsertrace: http_parser.o contrib/parsertrace.c | ||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace$(BINEXT) | ||
|
||
parsertrace_g: http_parser_g.o contrib/parsertrace.c | ||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g$(BINEXT) | ||
|
||
tags: http_parser.c http_parser.h test.c | ||
ctags $^ | ||
|
||
install: library | ||
$(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h | ||
$(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME) | ||
ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) | ||
|
||
install-strip: library | ||
$(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h | ||
$(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME) | ||
ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) | ||
|
||
uninstall: | ||
rm $(INCLUDEDIR)/http_parser.h | ||
rm $(LIBDIR)/$(SONAME) | ||
rm $(LIBDIR)/libhttp_parser.so | ||
|
||
clean: | ||
rm -f *.o *.a tags test test_fast test_g \ | ||
http_parser.tar libhttp_parser.so.* \ | ||
url_parser url_parser_g parsertrace parsertrace_g \ | ||
*.exe *.exe.so | ||
|
||
contrib/url_parser.c: http_parser.h | ||
contrib/parsertrace.c: http_parser.h | ||
|
||
.PHONY: clean package test-run test-run-timed test-valgrind install install-strip uninstall |
Oops, something went wrong.