Compare commits
271 Commits
event_stre
...
master
Author | SHA1 | Date |
---|---|---|
Ben Noordhuis | 2343fd6b52 | 5 years ago |
Ben Noordhuis | 714cbb2dfb | 5 years ago |
Sam Roberts | 1c02cb97fa | 5 years ago |
Fedor Indutny | a0c034c0c7 | 5 years ago |
Fedor Indutny | 7d5c99d09f | 5 years ago |
Fabrice Fontaine | 28f3c35c21 | 5 years ago |
Ben Noordhuis | 5c17dad400 | 6 years ago |
Ben Noordhuis | c7d49252a8 | 6 years ago |
Ben Noordhuis | b6866a7619 | 6 years ago |
Fedor Indutny | c5c45636b8 | 6 years ago |
Fedor Indutny | 2a0d1065d4 | 6 years ago |
Ben Noordhuis | 0d0a24e19e | 6 years ago |
Sergey Zolotarev | 73f4442aae | 6 years ago |
Olga Batyshkina | 3502589659 | 6 years ago |
Olga Batyshkina | cd88eef772 | 6 years ago |
cjihrig | 0ae8d93f73 | 6 years ago |
Ben Noordhuis | 4dae120015 | 6 years ago |
Welling Guzmán | 77310eeb83 | 7 years ago |
dnartz | 13ca674540 | 7 years ago |
Matt Klein | 25de6ed8e4 | 7 years ago |
Matthias Loy | 5b76466c6b | 7 years ago |
Brian Pane | cf69c8eda9 | 7 years ago |
Welling Guzman | 31232735c6 | 7 years ago |
Stefano Sambi | 2ed7527795 | 7 years ago |
Ben Noordhuis | a7c2e8626b | 7 years ago |
Ben Noordhuis | a1e0c3a2da | 7 years ago |
Ben Noordhuis | 54f55a2f02 | 7 years ago |
Ben Noordhuis | 01da95fead | 7 years ago |
Ben Noordhuis | 214fa6fb0d | 7 years ago |
Ben Noordhuis | 705e519bf5 | 7 years ago |
Fedor Indutny | edeedb1b4d | 7 years ago |
Fedor Indutny | dd74753cf5 | 7 years ago |
Ben Noordhuis | 921d558551 | 7 years ago |
Fedor Indutny | 9ce7316de3 | 7 years ago |
Jon Moss | b11de0f5c6 | 7 years ago |
ShaRose | 652b0153c5 | 7 years ago |
ShaRose | 4cefc0fb83 | 7 years ago |
Fabian Groffen | fd3850c048 | 7 years ago |
Ben Noordhuis | 89279ab613 | 7 years ago |
Pierce Lopez | 1b79abab34 | 8 years ago |
André Klitzing | 0852bea482 | 8 years ago |
Fabian Groffen | 8ea9532378 | 8 years ago |
Stephan Gatzka | 291a32cc51 | 8 years ago |
Ben Noordhuis | 05525c5fde | 8 years ago |
Ben Noordhuis | 260c522330 | 8 years ago |
Thomas 'fake' Jakobi | 3b0da34d83 | 8 years ago |
Brian White | 9f489a474d | 8 years ago |
Nathaniel McCallum | 335850f6b8 | 8 years ago |
Fedor Indutny | feae95a3a6 | 9 years ago |
Ben Noordhuis | cacb07d2b4 | 9 years ago |
Guo Xiao | b2cc8e49f3 | 9 years ago |
oldratlee | 737627b2b2 | 9 years ago |
Jonathan Marler | f2c26ee500 | 9 years ago |
Fedor Indutny | 9b0d5b33eb | 9 years ago |
Fedor Indutny | 04d28a7377 | 9 years ago |
Johan Bergström | 5651aea804 | 9 years ago |
Johan Bergström | dbcda1961c | 9 years ago |
Olivier Mengué | fd65b0fbbd | 9 years ago |
Johan Bergström | 678a9e21f1 | 9 years ago |
James M Snell | e2e467b912 | 9 years ago |
Wyatt Preul | 4e382f96e6 | 9 years ago |
James M Snell | bee4817ebe | 9 years ago |
Fedor Indutny | 777ba4eded | 9 years ago |
Lucas Berezy | 483eca7989 | 9 years ago |
Olivier Mengué | e557b62744 | 9 years ago |
Sebastian Philipp | e01811e7f4 | 10 years ago |
Andrew Udvare | b36c2a9ece | 10 years ago |
Ivan Enderlin | eb5e9928b4 | 10 years ago |
Ivan Enderlin | 4f69be2221 | 10 years ago |
Ivan Enderlin | b5bcca8f92 | 10 years ago |
Ivan Enderlin | 8b1d652322 | 10 years ago |
Tatsuhiro Tsujikawa | 7d75dd7325 | 10 years ago |
dlmeetei@gmail.com | ab0b162ef6 | 10 years ago |
Jan Schär | 39ff0975c2 | 10 years ago |
Daniel Knoppel (Phusion) | f6f436a12e | 10 years ago |
Guo Xiao | 2896229a13 | 10 years ago |
Fedor Indutny | 39c2c1e573 | 10 years ago |
Kjell Schubert | dff604db20 | 10 years ago |
Kjell Schubert | d7675453a6 | 10 years ago |
Kjell Schubert | 2872cb7e6a | 10 years ago |
Umorrian | 5d414fcb4b | 10 years ago |
Jay Satiro | d547f3b1a9 | 10 years ago |
Fedor Indutny | 7ecf775d71 | 10 years ago |
Fedor Indutny | 7ba312397c | 10 years ago |
Romain Giraud | 53063b780b | 10 years ago |
Fedor Indutny | 1b31580893 | 10 years ago |
Fedor Indutny | 59569f2125 | 10 years ago |
Fedor Indutny | 36f107fa2e | 10 years ago |
Fedor Indutny | 280af6984c | 10 years ago |
Fedor Indutny | 956c8a054a | 10 years ago |
Akagi201 | 167dcdfc06 | 10 years ago |
Fedor Indutny | 3f7ef500bd | 10 years ago |
Fedor Indutny | 265f9d0edc | 10 years ago |
Jon Kolb | 091ebb8778 | 10 years ago |
Fedor Indutny | 959f4cb127 | 10 years ago |
Fedor Indutny | 0097de5895 | 10 years ago |
Fedor Indutny | c6097e1d76 | 10 years ago |
Fedor Indutny | 263006044a | 10 years ago |
Fedor Indutny | 0cb0ee672c | 10 years ago |
Fedor Indutny | 6132d1fefa | 10 years ago |
Fedor Indutny | 3f1a05a24c | 10 years ago |
Timothy J Fontaine | 94a55d1b38 | 10 years ago |
Alexis La Goutte | 5fd51fd59d | 10 years ago |
Jeff Pinner | 0b43367131 | 11 years ago |
Marc O'Morain | 11ecb42061 | 11 years ago |
Maciej Małecki | 7bbb77467f | 11 years ago |
George Miroshnykov | 17ed7deb7c | 11 years ago |
Alexis La Goutte | 5b951d74bd | 11 years ago |
Helge Heß | 1317eeca43 | 11 years ago |
Mark Koopman | 08a2cc36eb | 11 years ago |
Alex Kocharin | 158dd3bb22 | 11 years ago |
Rex Feng | 8d9e5db981 | 11 years ago |
Alex Butum | d19e12911a | 11 years ago |
Vinnie Falco | 24e2d2d43f | 11 years ago |
Fedor Indutny | 56f7ad0e2e | 11 years ago |
David Wragg | 76f0f1690f | 11 years ago |
David Wragg | 5d9c382172 | 11 years ago |
Fedor Indutny | cba704cb2d | 11 years ago |
Alexis Campailla | a252d4eebc | 11 years ago |
runner | 42d6541577 | 11 years ago |
Fedor Indutny | fd609ab272 | 11 years ago |
Fedor Indutny | efcf75d837 | 11 years ago |
Fedor Indutny | 9ca484d4c6 | 11 years ago |
Patrik Stutz | d7b938bdca | 11 years ago |
Charlie Somerville | 11419c8e41 | 11 years ago |
Uli Köhler | c4079e7c38 | 11 years ago |
Ben Noordhuis | f5c779bb85 | 11 years ago |
Ben Noordhuis | 3cbd13daca | 11 years ago |
Ben Noordhuis | 547553b090 | 12 years ago |
Chris Dickinson | c6ee6ada69 | 12 years ago |
Ben Noordhuis | d3264312e1 | 12 years ago |
Ben Noordhuis | 6df37aa52d | 12 years ago |
Ben Noordhuis | 8081938445 | 12 years ago |
Ben Noordhuis | e77957a091 | 12 years ago |
Corey Richardson | fa7455081a | 12 years ago |
Ben Noordhuis | 120a2c5c9b | 12 years ago |
Ben Noordhuis | fe9fb34e53 | 12 years ago |
Tóth Tamás | 0938fe599f | 12 years ago |
Corey Richardson | 798eb9012e | 12 years ago |
Thomas LE ROUX | 769db22859 | 12 years ago |
James McLaughlin | 2b77aba93a | 12 years ago |
Corey Richardson | 54f6c78530 | 12 years ago |
Ben Noordhuis | 43ccd6aa76 | 12 years ago |
Corey Richardson | 1c7f8cac9e | 12 years ago |
Ben Noordhuis | cd01361819 | 12 years ago |
Ben Noordhuis | 14d42be21a | 12 years ago |
Ben Noordhuis | 245f6f0078 | 12 years ago |
Peter Faiman | b4fc777dc6 | 12 years ago |
Ben Noordhuis | 02f06ff290 | 12 years ago |
Ben Noordhuis | a0fd3323dd | 12 years ago |
Ben Noordhuis | ce6d7efff7 | 12 years ago |
Ben Noordhuis | 3fb4e061ec | 12 years ago |
Ben Noordhuis | 0e67f6b532 | 12 years ago |
BogDan Vatra | 1ca7de5258 | 13 years ago |
Ben Noordhuis | ad3b631d4f | 13 years ago |
Ben Noordhuis | 4e1a6ab655 | 13 years ago |
Ben Noordhuis | add3018ce7 | 13 years ago |
Ben Noordhuis | 9f92347851 | 13 years ago |
Ben Noordhuis | 2b7e87cc77 | 13 years ago |
Peter Griess | ba5acd532f | 13 years ago |
Peter Griess | fb3eeb7d05 | 13 years ago |
Bertrand Paquet | a828edaf6a | 13 years ago |
Bertrand Paquet | 50faa793f4 | 13 years ago |
Bertrand Paquet | 148984cd8d | 13 years ago |
Bertrand Paquet | 7f1b191d6f | 13 years ago |
Bertrand Paquet | 1d3a0ec752 | 13 years ago |
Bertrand Paquet | d2ce562338 | 13 years ago |
Bertrand Paquet | bb29f43741 | 13 years ago |
James McLaughlin | 8ee3b0dc93 | 13 years ago |
Bertrand Paquet | e42aa93b52 | 13 years ago |
Bertrand Paquet | f6f761596e | 13 years ago |
Bertrand Paquet | fe31fe8bf0 | 13 years ago |
Bertrand Paquet | 7965096276 | 13 years ago |
Bertrand Paquet | ed8475d49f | 13 years ago |
Bertrand Paquet | 624a4b44a9 | 13 years ago |
Bertrand Paquet | 9dfaa67f2b | 13 years ago |
Martell Malone | 9852e5d048 | 13 years ago |
Peter Griess | 2ec48fd65d | 13 years ago |
Erik Dubbelboer | 4d7b5dcb9a | 13 years ago |
Erik Dubbelboer | 4c1e785a04 | 13 years ago |
Peter Griess | 26f508a289 | 13 years ago |
Erik Dubbelboer | 0067f54dbe | 13 years ago |
Ben Noordhuis | b97fdb0513 | 13 years ago |
Simon | 905e959130 | 13 years ago |
Ben Noordhuis | 8bec3ea459 | 13 years ago |
Nathan Rajlich | a3373d7627 | 13 years ago |
Nathan Rajlich | 5a1e556239 | 13 years ago |
Ben Noordhuis | 36808f4fad | 13 years ago |
Ben Noordhuis | 99c0850240 | 13 years ago |
Ben Noordhuis | efb72f175c | 13 years ago |
Ben Noordhuis | c6e10e98e3 | 13 years ago |
Andre Louis Caron | 9db90de9fc | 13 years ago |
Ben Noordhuis | f4053c719c | 13 years ago |
Ben Noordhuis | 62110efe7a | 13 years ago |
David Gwynne | 662e523a92 | 13 years ago |
David Gwynne | 67568421e9 | 13 years ago |
David Gwynne | 8da60bc423 | 13 years ago |
Ben Noordhuis | 7bc668c5f4 | 13 years ago |
Randy Rizun | b215eaa749 | 13 years ago |
LE ROUX Thomas | f1fe50e0c5 | 13 years ago |
David Gwynne | 0499525110 | 13 years ago |
Ben Noordhuis | c3153bd1a9 | 13 years ago |
Ben Noordhuis | 4898606826 | 13 years ago |
Ben Noordhuis | 89a9da0560 | 13 years ago |
Ben Noordhuis | f668e72380 | 13 years ago |
James McLaughlin | 03e0d5292a | 13 years ago |
Ben Noordhuis | 3e626c6cb6 | 13 years ago |
Ben Noordhuis | e4c13a8784 | 13 years ago |
Ivo Raisr | 2a2f99f9cd | 13 years ago |
Ben Noordhuis | 7f89b91314 | 13 years ago |
Andre Caron | 051d6fe219 | 13 years ago |
Peter Griess | eb04bbe1fa | 13 years ago |
Peter Griess | cd9404ad93 | 13 years ago |
Peter Griess | d0bb867d1b | 13 years ago |
Peter Griess | b115d110a3 | 13 years ago |
Peter Griess | 248fbc3ab4 | 13 years ago |
Peter Griess | c48351fbde | 13 years ago |
Peter Griess | d7675cd9a6 | 13 years ago |
Peter Griess | c4ae661afc | 13 years ago |
Peter Griess | 48a4364fdd | 13 years ago |
koichik | b47c44d7a6 | 13 years ago |
Ryan Dahl | 3cf68f9a70 | 13 years ago |
Felix Geisendörfer | 2498961231 | 13 years ago |
Paul Querna | f1d48aa31c | 13 years ago |
Cliff Frey | c0ecab0516 | 14 years ago |
Ben Noordhuis | 75dc103fd0 | 14 years ago |
Ryan Dahl | 918a071542 | 14 years ago |
Ryan Dahl | 965f91bc76 | 14 years ago |
Ryan Dahl | ec74d9294c | 14 years ago |
Peter Griess | f832bf3b21 | 14 years ago |
Fouad Mardini | 2b2ba2da1a | 14 years ago |
Peter Griess | 31ee648709 | 14 years ago |
Peter Griess | 6bc88cc6e9 | 14 years ago |
Peter Griess | 53adfacad1 | 14 years ago |
Peter Griess | 49faf2e9cd | 14 years ago |
Peter Griess | 1e071a5087 | 14 years ago |
Peter Griess | 5469827542 | 14 years ago |
Peter Griess | 761a5eaeb1 | 14 years ago |
Peter Griess | 1786fdae36 | 14 years ago |
Jon Kolb | 8153466643 | 14 years ago |
Peter Griess | 8e8344518e | 14 years ago |
Peter Griess | 0aa3e522eb | 14 years ago |
Peter Griess | 9114e58a77 | 14 years ago |
Peter Griess | ddbbc07c10 | 14 years ago |
Peter Griess | 056bcd3672 | 14 years ago |
Peter Griess | d4ca280af5 | 14 years ago |
Cliff Frey | d5f0312eee | 14 years ago |
Cliff Frey | 5bb958a9f4 | 14 years ago |
Jon Kolb | a6934445e8 | 14 years ago |
Peter Griess | f684abdcc5 | 14 years ago |
Peter Griess | e1d79e1940 | 14 years ago |
Jon Kolb | dc314a3cb9 | 14 years ago |
Cliff Frey | d34a2ad26c | 14 years ago |
Sean Cunningham | b89f94414e | 14 years ago |
Cliff Frey | 3258e4a455 | 14 years ago |
Ryan Dahl | eee60127c0 | 14 years ago |
Ryan Dahl | 1efd9ac6a0 | 14 years ago |
Peter Griess | 3bd18a779e | 14 years ago |
Salman | fb23d15ace | 14 years ago |
Ryan Dahl | 2839784927 | 14 years ago |
Peter Griess | b1c2cf83fd | 14 years ago |
Ryan Dahl | 8dabce6ec7 | 14 years ago |
Ryan Dahl | 32c0e11583 | 14 years ago |
Peter Griess | 9639c7c21c | 14 years ago |
Peter Griess | 50b9bec552 | 14 years ago |
Ryan Dahl | 63daf22f2c | 14 years ago |
Sean Cunningham | 10270007bc | 14 years ago |
Sean Cunningham | 81ca70aec1 | 14 years ago |
Ryan Dahl | 1c3624a963 | 14 years ago |
Ryan Dahl | fcdbc2629f | 14 years ago |
Tim Becker | 9656fd73de | 14 years ago |
@ -1,4 +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
|
||||
|
@ -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 <ry@tinyclouds.org>
|
||||
Salman Haq <salman.haq@asti-usa.com>
|
||||
Simon Zimmermann <simonz05@gmail.com>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr> LE ROUX Thomas <thomas@procheo.fr>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr> Thomas LE ROUX <thomas@procheo.fr>
|
||||
Fedor Indutny <fedor@indutny.com>
|
@ -0,0 +1,13 @@
|
||||
language: c
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
script:
|
||||
- "make"
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc:
|
||||
- "irc.freenode.net#node-ci"
|
@ -0,0 +1,68 @@
|
||||
# Authors ordered by first contribution.
|
||||
Ryan Dahl <ry@tinyclouds.org>
|
||||
Jeremy Hinegardner <jeremy@hinegardner.org>
|
||||
Sergey Shepelev <temotor@gmail.com>
|
||||
Joe Damato <ice799@gmail.com>
|
||||
tomika <tomika_nospam@freemail.hu>
|
||||
Phoenix Sol <phoenix@burninglabs.com>
|
||||
Cliff Frey <cliff@meraki.com>
|
||||
Ewen Cheslack-Postava <ewencp@cs.stanford.edu>
|
||||
Santiago Gala <sgala@apache.org>
|
||||
Tim Becker <tim.becker@syngenio.de>
|
||||
Jeff Terrace <jterrace@gmail.com>
|
||||
Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Nathan Rajlich <nathan@tootallnate.net>
|
||||
Mark Nottingham <mnot@mnot.net>
|
||||
Aman Gupta <aman@tmm1.net>
|
||||
Tim Becker <tim.becker@kuriositaet.de>
|
||||
Sean Cunningham <sean.cunningham@mandiant.com>
|
||||
Peter Griess <pg@std.in>
|
||||
Salman Haq <salman.haq@asti-usa.com>
|
||||
Cliff Frey <clifffrey@gmail.com>
|
||||
Jon Kolb <jon@b0g.us>
|
||||
Fouad Mardini <f.mardini@gmail.com>
|
||||
Paul Querna <pquerna@apache.org>
|
||||
Felix Geisendörfer <felix@debuggable.com>
|
||||
koichik <koichik@improvement.jp>
|
||||
Andre Caron <andre.l.caron@gmail.com>
|
||||
Ivo Raisr <ivosh@ivosh.net>
|
||||
James McLaughlin <jamie@lacewing-project.org>
|
||||
David Gwynne <loki@animata.net>
|
||||
Thomas LE ROUX <thomas@november-eleven.fr>
|
||||
Randy Rizun <rrizun@ortivawireless.com>
|
||||
Andre Louis Caron <andre.louis.caron@usherbrooke.ca>
|
||||
Simon Zimmermann <simonz05@gmail.com>
|
||||
Erik Dubbelboer <erik@dubbelboer.com>
|
||||
Martell Malone <martellmalone@gmail.com>
|
||||
Bertrand Paquet <bpaquet@octo.com>
|
||||
BogDan Vatra <bogdan@kde.org>
|
||||
Peter Faiman <peter@thepicard.org>
|
||||
Corey Richardson <corey@octayn.net>
|
||||
Tóth Tamás <tomika_nospam@freemail.hu>
|
||||
Cam Swords <cam.swords@gmail.com>
|
||||
Chris Dickinson <christopher.s.dickinson@gmail.com>
|
||||
Uli Köhler <ukoehler@btronik.de>
|
||||
Charlie Somerville <charlie@charliesomerville.com>
|
||||
Patrik Stutz <patrik.stutz@gmail.com>
|
||||
Fedor Indutny <fedor.indutny@gmail.com>
|
||||
runner <runner.mei@gmail.com>
|
||||
Alexis Campailla <alexis@janeasystems.com>
|
||||
David Wragg <david@wragg.org>
|
||||
Vinnie Falco <vinnie.falco@gmail.com>
|
||||
Alex Butum <alexbutum@linux.com>
|
||||
Rex Feng <rexfeng@gmail.com>
|
||||
Alex Kocharin <alex@kocharin.ru>
|
||||
Mark Koopman <markmontymark@yahoo.com>
|
||||
Helge Heß <me@helgehess.eu>
|
||||
Alexis La Goutte <alexis.lagoutte@gmail.com>
|
||||
George Miroshnykov <george.miroshnykov@gmail.com>
|
||||
Maciej Małecki <me@mmalecki.com>
|
||||
Marc O'Morain <github.com@marcomorain.com>
|
||||
Jeff Pinner <jpinner@twitter.com>
|
||||
Timothy J Fontaine <tjfontaine@gmail.com>
|
||||
Akagi201 <akagi201@gmail.com>
|
||||
Romain Giraud <giraud.romain@gmail.com>
|
||||
Jay Satiro <raysatiro@yahoo.com>
|
||||
Arne Steen <Arne.Steen@gmx.de>
|
||||
Kjell Schubert <kjell.schubert@gmail.com>
|
||||
Olivier Mengué <dolmen@cpan.org>
|
@ -1,4 +0,0 @@
|
||||
Contributors must agree to the Contributor License Agreement before patches
|
||||
can be accepted.
|
||||
|
||||
http://spreadsheets2.google.com/viewform?hl=en&formkey=dDJXOGUwbzlYaWM4cHN1MERwQS1CSnc6MQ
|
@ -1,41 +1,160 @@
|
||||
OPT_DEBUG=-O0 -g -Wall -Wextra -Werror -I.
|
||||
OPT_FAST=-O3 -DHTTP_PARSER_STRICT=0 -I.
|
||||
# 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 ?=
|
||||
SOLIBNAME = libhttp_parser
|
||||
SOMAJOR = 2
|
||||
SOMINOR = 9
|
||||
SOREV = 4
|
||||
ifeq (darwin,$(PLATFORM))
|
||||
SOEXT ?= dylib
|
||||
SONAME ?= $(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOEXT)
|
||||
LIBNAME ?= $(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOREV).$(SOEXT)
|
||||
else ifeq (wine,$(PLATFORM))
|
||||
CC = winegcc
|
||||
BINEXT = .exe.so
|
||||
HELPER = wine
|
||||
else
|
||||
SOEXT ?= so
|
||||
SONAME ?= $(SOLIBNAME).$(SOEXT).$(SOMAJOR).$(SOMINOR)
|
||||
LIBNAME ?= $(SOLIBNAME).$(SOEXT).$(SOMAJOR).$(SOMINOR).$(SOREV)
|
||||
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 ?= /usr/local
|
||||
LIBDIR = $(PREFIX)/lib
|
||||
INCLUDEDIR = $(PREFIX)/include
|
||||
|
||||
ifeq (darwin,$(PLATFORM))
|
||||
LDFLAGS_LIB += -Wl,-install_name,$(LIBDIR)/$(SONAME)
|
||||
else
|
||||
# TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname...
|
||||
LDFLAGS_LIB += -Wl,-soname=$(SONAME)
|
||||
endif
|
||||
|
||||
test: test_g
|
||||
./test_g
|
||||
test: test_g test_fast
|
||||
$(HELPER) ./test_g$(BINEXT)
|
||||
$(HELPER) ./test_fast$(BINEXT)
|
||||
|
||||
test_g: http_parser_g.o test_g.o
|
||||
$(CC) $(OPT_DEBUG) http_parser_g.o test_g.o -o $@
|
||||
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@
|
||||
|
||||
test_g.o: test.c http_parser.h Makefile
|
||||
$(CC) $(OPT_DEBUG) -c test.c -o $@
|
||||
$(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) $(OPT_FAST) -c test.c -o $@
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@
|
||||
|
||||
http_parser_g.o: http_parser.c http_parser.h Makefile
|
||||
$(CC) $(OPT_DEBUG) -c http_parser.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
|
||||
|
||||
http_parser.o: http_parser.c http_parser.h Makefile
|
||||
$(CC) $(OPT_FAST) -c http_parser.c
|
||||
libhttp_parser.o: http_parser.c http_parser.h Makefile
|
||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o
|
||||
|
||||
test_fast: http_parser.o test.c http_parser.h
|
||||
$(CC) $(OPT_FAST) http_parser.o test.c -o $@
|
||||
library: libhttp_parser.o
|
||||
$(CC) $(LDFLAGS_LIB) -o $(LIBNAME) $<
|
||||
|
||||
test-run-timed: test_fast
|
||||
while(true) do time ./test_fast > /dev/null; done
|
||||
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 $(DESTDIR)$(INCLUDEDIR)/http_parser.h
|
||||
$(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
|
||||
ln -sf $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
|
||||
ln -sf $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
|
||||
|
||||
install-strip: library
|
||||
$(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h
|
||||
$(INSTALL) -D -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
|
||||
ln -sf $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
|
||||
ln -sf $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
|
||||
|
||||
uninstall:
|
||||
rm $(DESTDIR)$(INCLUDEDIR)/http_parser.h
|
||||
rm $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
|
||||
rm $(DESTDIR)$(LIBDIR)/$(SONAME)
|
||||
rm $(DESTDIR)$(LIBDIR)/$(LIBNAME)
|
||||
|
||||
clean:
|
||||
rm -f *.o test test_fast test_g http_parser.tar tags
|
||||
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
|
||||
.PHONY: clean package test-run test-run-timed test-valgrind install install-strip uninstall
|
||||
|
@ -0,0 +1,128 @@
|
||||
/* Copyright Fedor Indutny. 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.
|
||||
*/
|
||||
#include "http_parser.h"
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/* 8 gb */
|
||||
static const int64_t kBytes = 8LL << 30;
|
||||
|
||||
static const char data[] =
|
||||
"POST /joyent/http-parser HTTP/1.1\r\n"
|
||||
"Host: github.com\r\n"
|
||||
"DNT: 1\r\n"
|
||||
"Accept-Encoding: gzip, deflate, sdch\r\n"
|
||||
"Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n"
|
||||
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) "
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
||||
"Chrome/39.0.2171.65 Safari/537.36\r\n"
|
||||
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,"
|
||||
"image/webp,*/*;q=0.8\r\n"
|
||||
"Referer: https://github.com/joyent/http-parser\r\n"
|
||||
"Connection: keep-alive\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n";
|
||||
static const size_t data_len = sizeof(data) - 1;
|
||||
|
||||
static int on_info(http_parser* p) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int on_data(http_parser* p, const char *at, size_t length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static http_parser_settings settings = {
|
||||
.on_message_begin = on_info,
|
||||
.on_headers_complete = on_info,
|
||||
.on_message_complete = on_info,
|
||||
.on_header_field = on_data,
|
||||
.on_header_value = on_data,
|
||||
.on_url = on_data,
|
||||
.on_status = on_data,
|
||||
.on_body = on_data
|
||||
};
|
||||
|
||||
int bench(int iter_count, int silent) {
|
||||
struct http_parser parser;
|
||||
int i;
|
||||
int err;
|
||||
struct timeval start;
|
||||
struct timeval end;
|
||||
|
||||
if (!silent) {
|
||||
err = gettimeofday(&start, NULL);
|
||||
assert(err == 0);
|
||||
}
|
||||
|
||||
fprintf(stderr, "req_len=%d\n", (int) data_len);
|
||||
for (i = 0; i < iter_count; i++) {
|
||||
size_t parsed;
|
||||
http_parser_init(&parser, HTTP_REQUEST);
|
||||
|
||||
parsed = http_parser_execute(&parser, &settings, data, data_len);
|
||||
assert(parsed == data_len);
|
||||
}
|
||||
|
||||
if (!silent) {
|
||||
double elapsed;
|
||||
double bw;
|
||||
double total;
|
||||
|
||||
err = gettimeofday(&end, NULL);
|
||||
assert(err == 0);
|
||||
|
||||
fprintf(stdout, "Benchmark result:\n");
|
||||
|
||||
elapsed = (double) (end.tv_sec - start.tv_sec) +
|
||||
(end.tv_usec - start.tv_usec) * 1e-6f;
|
||||
|
||||
total = (double) iter_count * data_len;
|
||||
bw = (double) total / elapsed;
|
||||
|
||||
fprintf(stdout, "%.2f mb | %.2f mb/s | %.2f req/sec | %.2f s\n",
|
||||
(double) total / (1024 * 1024),
|
||||
bw / (1024 * 1024),
|
||||
(double) iter_count / elapsed,
|
||||
elapsed);
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int64_t iterations;
|
||||
|
||||
iterations = kBytes / (int64_t) data_len;
|
||||
if (argc == 2 && strcmp(argv[1], "infinite") == 0) {
|
||||
for (;;)
|
||||
bench(iterations, 1);
|
||||
return 0;
|
||||
} else {
|
||||
return bench(iterations, 0);
|
||||
}
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
/* Copyright Joyent, Inc. and other Node contributors.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* Dump what the parser finds to stdout as it happen */
|
||||
|
||||
#include "http_parser.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int on_message_begin(http_parser* _) {
|
||||
(void)_;
|
||||
printf("\n***MESSAGE BEGIN***\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_headers_complete(http_parser* _) {
|
||||
(void)_;
|
||||
printf("\n***HEADERS COMPLETE***\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_message_complete(http_parser* _) {
|
||||
(void)_;
|
||||
printf("\n***MESSAGE COMPLETE***\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_url(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Url: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_header_field(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Header field: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_header_value(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Header value: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int on_body(http_parser* _, const char* at, size_t length) {
|
||||
(void)_;
|
||||
printf("Body: %.*s\n", (int)length, at);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usage(const char* name) {
|
||||
fprintf(stderr,
|
||||
"Usage: %s $type $filename\n"
|
||||
" type: -x, where x is one of {r,b,q}\n"
|
||||
" parses file as a Response, reQuest, or Both\n",
|
||||
name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
enum http_parser_type file_type;
|
||||
|
||||
if (argc != 3) {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
char* type = argv[1];
|
||||
if (type[0] != '-') {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
switch (type[1]) {
|
||||
/* in the case of "-", type[1] will be NUL */
|
||||
case 'r':
|
||||
file_type = HTTP_RESPONSE;
|
||||
break;
|
||||
case 'q':
|
||||
file_type = HTTP_REQUEST;
|
||||
break;
|
||||
case 'b':
|
||||
file_type = HTTP_BOTH;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
char* filename = argv[2];
|
||||
FILE* file = fopen(filename, "r");
|
||||
if (file == NULL) {
|
||||
perror("fopen");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
long file_length = ftell(file);
|
||||
if (file_length == -1) {
|
||||
perror("ftell");
|
||||
goto fail;
|
||||
}
|
||||
fseek(file, 0, SEEK_SET);
|
||||
|
||||
char* data = malloc(file_length);
|
||||
if (fread(data, 1, file_length, file) != (size_t)file_length) {
|
||||
fprintf(stderr, "couldn't read entire file\n");
|
||||
free(data);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
http_parser_settings settings;
|
||||
memset(&settings, 0, sizeof(settings));
|
||||
settings.on_message_begin = on_message_begin;
|
||||
settings.on_url = on_url;
|
||||
settings.on_header_field = on_header_field;
|
||||
settings.on_header_value = on_header_value;
|
||||
settings.on_headers_complete = on_headers_complete;
|
||||
settings.on_body = on_body;
|
||||
settings.on_message_complete = on_message_complete;
|
||||
|
||||
http_parser parser;
|
||||
http_parser_init(&parser, file_type);
|
||||
size_t nparsed = http_parser_execute(&parser, &settings, data, file_length);
|
||||
free(data);
|
||||
|
||||
if (nparsed != (size_t)file_length) {
|
||||
fprintf(stderr,
|
||||
"Error: %s (%s)\n",
|
||||
http_errno_description(HTTP_PARSER_ERRNO(&parser)),
|
||||
http_errno_name(HTTP_PARSER_ERRNO(&parser)));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
fail:
|
||||
fclose(file);
|
||||
return EXIT_FAILURE;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
#include "http_parser.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void
|
||||
dump_url (const char *url, const struct http_parser_url *u)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
printf("\tfield_set: 0x%x, port: %u\n", u->field_set, u->port);
|
||||
for (i = 0; i < UF_MAX; i++) {
|
||||
if ((u->field_set & (1 << i)) == 0) {
|
||||
printf("\tfield_data[%u]: unset\n", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("\tfield_data[%u]: off: %u, len: %u, part: %.*s\n",
|
||||
i,
|
||||
u->field_data[i].off,
|
||||
u->field_data[i].len,
|
||||
u->field_data[i].len,
|
||||
url + u->field_data[i].off);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
struct http_parser_url u;
|
||||
int len, connect, result;
|
||||
|
||||
if (argc != 3) {
|
||||
printf("Syntax : %s connect|get url\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
len = strlen(argv[2]);
|
||||
connect = strcmp("connect", argv[1]) == 0 ? 1 : 0;
|
||||
printf("Parsing %s, connect %d\n", argv[2], connect);
|
||||
|
||||
http_parser_url_init(&u);
|
||||
result = http_parser_parse_url(argv[2], len, connect, &u);
|
||||
if (result != 0) {
|
||||
printf("Parse error : %d\n", result);
|
||||
return result;
|
||||
}
|
||||
printf("Parse ok, result : \n");
|
||||
dump_url(argv[2], &u);
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,111 @@
|
||||
# This file is used with the GYP meta build system.
|
||||
# http://code.google.com/p/gyp/
|
||||
# To build try this:
|
||||
# svn co http://gyp.googlecode.com/svn/trunk gyp
|
||||
# ./gyp/gyp -f make --depth=`pwd` http_parser.gyp
|
||||
# ./out/Debug/test
|
||||
{
|
||||
'target_defaults': {
|
||||
'default_configuration': 'Debug',
|
||||
'configurations': {
|
||||
# TODO: hoist these out and put them somewhere common, because
|
||||
# RuntimeLibrary MUST MATCH across the entire project
|
||||
'Debug': {
|
||||
'defines': [ 'DEBUG', '_DEBUG' ],
|
||||
'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': 1, # static debug
|
||||
},
|
||||
},
|
||||
},
|
||||
'Release': {
|
||||
'defines': [ 'NDEBUG' ],
|
||||
'cflags': [ '-Wall', '-Wextra', '-O3' ],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': 0, # static release
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
},
|
||||
'VCLibrarianTool': {
|
||||
},
|
||||
'VCLinkerTool': {
|
||||
'GenerateDebugInformation': 'true',
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'defines': [
|
||||
'WIN32'
|
||||
],
|
||||
}]
|
||||
],
|
||||
},
|
||||
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'http_parser',
|
||||
'type': 'static_library',
|
||||
'include_dirs': [ '.' ],
|
||||
'direct_dependent_settings': {
|
||||
'defines': [ 'HTTP_PARSER_STRICT=0' ],
|
||||
'include_dirs': [ '.' ],
|
||||
},
|
||||
'defines': [ 'HTTP_PARSER_STRICT=0' ],
|
||||
'sources': [ './http_parser.c', ],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
# Compile as C++. http_parser.c is actually C99, but C++ is
|
||||
# close enough in this case.
|
||||
'CompileAs': 2,
|
||||
},
|
||||
},
|
||||
}]
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
'target_name': 'http_parser_strict',
|
||||
'type': 'static_library',
|
||||
'include_dirs': [ '.' ],
|
||||
'direct_dependent_settings': {
|
||||
'defines': [ 'HTTP_PARSER_STRICT=1' ],
|
||||
'include_dirs': [ '.' ],
|
||||
},
|
||||
'defines': [ 'HTTP_PARSER_STRICT=1' ],
|
||||
'sources': [ './http_parser.c', ],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
# Compile as C++. http_parser.c is actually C99, but C++ is
|
||||
# close enough in this case.
|
||||
'CompileAs': 2,
|
||||
},
|
||||
},
|
||||
}]
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
'target_name': 'test-nonstrict',
|
||||
'type': 'executable',
|
||||
'dependencies': [ 'http_parser' ],
|
||||
'sources': [ 'test.c' ]
|
||||
},
|
||||
|
||||
{
|
||||
'target_name': 'test-strict',
|
||||
'type': 'executable',
|
||||
'dependencies': [ 'http_parser_strict' ],
|
||||
'sources': [ 'test.c' ]
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in new issue