From 58d88b96617e2e494894dad648f924c6e834baa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Wed, 28 Mar 2018 16:18:05 +0200 Subject: [PATCH 1/4] Add http-parser license and authors Motivation: Quote: > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. Just linking is not enough. Modifications: Added the http-parser license. Added the AUTHORS file. Not required by the license, but the right thing to do. Result: Proper license inclusion for http-parser. --- Sources/CNIOHTTPParser/AUTHORS | 68 ++++++++++++++++++++++++++++++ Sources/CNIOHTTPParser/LICENSE-MIT | 19 +++++++++ 2 files changed, 87 insertions(+) create mode 100644 Sources/CNIOHTTPParser/AUTHORS create mode 100644 Sources/CNIOHTTPParser/LICENSE-MIT diff --git a/Sources/CNIOHTTPParser/AUTHORS b/Sources/CNIOHTTPParser/AUTHORS new file mode 100644 index 00000000000..5323b685cae --- /dev/null +++ b/Sources/CNIOHTTPParser/AUTHORS @@ -0,0 +1,68 @@ +# Authors ordered by first contribution. +Ryan Dahl +Jeremy Hinegardner +Sergey Shepelev +Joe Damato +tomika +Phoenix Sol +Cliff Frey +Ewen Cheslack-Postava +Santiago Gala +Tim Becker +Jeff Terrace +Ben Noordhuis +Nathan Rajlich +Mark Nottingham +Aman Gupta +Tim Becker +Sean Cunningham +Peter Griess +Salman Haq +Cliff Frey +Jon Kolb +Fouad Mardini +Paul Querna +Felix Geisendörfer +koichik +Andre Caron +Ivo Raisr +James McLaughlin +David Gwynne +Thomas LE ROUX +Randy Rizun +Andre Louis Caron +Simon Zimmermann +Erik Dubbelboer +Martell Malone +Bertrand Paquet +BogDan Vatra +Peter Faiman +Corey Richardson +Tóth Tamás +Cam Swords +Chris Dickinson +Uli Köhler +Charlie Somerville +Patrik Stutz +Fedor Indutny +runner +Alexis Campailla +David Wragg +Vinnie Falco +Alex Butum +Rex Feng +Alex Kocharin +Mark Koopman +Helge Heß +Alexis La Goutte +George Miroshnykov +Maciej Małecki +Marc O'Morain +Jeff Pinner +Timothy J Fontaine +Akagi201 +Romain Giraud +Jay Satiro +Arne Steen +Kjell Schubert +Olivier Mengué diff --git a/Sources/CNIOHTTPParser/LICENSE-MIT b/Sources/CNIOHTTPParser/LICENSE-MIT new file mode 100644 index 00000000000..1ec0ab4e174 --- /dev/null +++ b/Sources/CNIOHTTPParser/LICENSE-MIT @@ -0,0 +1,19 @@ +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. From f1b7b80f62d02a227399e06c9dfcbc450bc730f1 Mon Sep 17 00:00:00 2001 From: Helge Hess Date: Mon, 30 Apr 2018 21:52:27 +0200 Subject: [PATCH 2/4] Pull LICENSE/AUTHORS file alongside sources Motivation: When the sources are updated from upstream, we also need to update the license/authors files. Modifications: Curl the files, output to current directory. Result: Related files are updated alongside the sources. Note: I couldn't fully test, because neither me nor brew have `gsed`. --- Sources/CNIOHTTPParser/update_and_patch_http_parser.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh b/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh index e4b3a0271e0..e51b2a9a60d 100755 --- a/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh +++ b/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh @@ -26,6 +26,16 @@ case "$(uname -s)" in ;; esac +if ! hash ${sed} 2>/dev/null; then + echo "You need sed \"${sed}\" to run this script ..." + exit 42 +fi + +for f in LICENSE-MIT AUTHORS; do + curl -o "${f}" \ + -Ls "https://raw.githubusercontent.com/nodejs/http-parser/master/${f}" +done + for f in http_parser.c http_parser.h; do ( echo "/* Additional changes for SwiftNIO:" echo " - prefixed all symbols by 'c_nio_'" From 51e75ebce860c0f3b6c9bd36c4c4864d200f9d49 Mon Sep 17 00:00:00 2001 From: Helge Hess Date: Tue, 1 May 2018 11:18:40 +0200 Subject: [PATCH 3/4] Add a note on how to get gsed Motivation: If the user misses gsed, let him know how to get it. Modifications: Added an echo pointing the user to brew install gnu-sed Result: User will have a way to run this script. --- Sources/CNIOHTTPParser/update_and_patch_http_parser.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh b/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh index e51b2a9a60d..88a8c022d32 100755 --- a/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh +++ b/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh @@ -28,6 +28,8 @@ esac if ! hash ${sed} 2>/dev/null; then echo "You need sed \"${sed}\" to run this script ..." + echo + echo "On macOS: brew install gnu-sed" exit 42 fi From 911127825bda57cd1d6b51b68549ca0f74f86849 Mon Sep 17 00:00:00 2001 From: Helge Hess Date: Tue, 1 May 2018 11:26:30 +0200 Subject: [PATCH 4/4] Fix bugs in update script Motivation: Would be nice if the script would actually work. Modifications: Put the script calls in the proper sequence. Result: The update script can be called and it actually worx. --- Sources/CNIOHTTPParser/update_and_patch_http_parser.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh b/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh index 88a8c022d32..a9dc28ec897 100755 --- a/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh +++ b/Sources/CNIOHTTPParser/update_and_patch_http_parser.sh @@ -61,6 +61,9 @@ for f in http_parser.c http_parser.h; do -e 's/\b\(http_parser_version\)/c_nio_\1/g' \ -e 's/\b\(http_should_keep_alive\)/c_nio_\1/g' \ "$here/c_nio_$f" +done + +mv "$here/c_nio_http_parser.h" "$here/include/c_nio_http_parser.h" tmp=$(mktemp -d /tmp/.test_compile_XXXXXX) @@ -73,6 +76,4 @@ test 0 -eq $num_non_nio || { } rm -rf "$tmp" -done -mv "$here/c_nio_http_parser.h" "$here/include/c_nio_http_parser.h"