diff --git a/third_party/happyhttp/README.packager b/third_party/happyhttp/README.packager new file mode 100644 index 0000000000..28f8b0122a --- /dev/null +++ b/third_party/happyhttp/README.packager @@ -0,0 +1,20 @@ +Name: happyhttp +URL: http://scumways.com/happyhttp/happyhttp.html +Version: 0.1 SHA 7306b1606a09063ac38c264afe59f0ad0b441750 +License: zlib/libpng +License File: http://opensource.org/licenses/zlib-license.php + +Description: +The src/ directory contains a snapshot of the happyhttp library +with the patches in the patches/ directories applied. +See the files in that directory for discussion of their effects. + +Modifications: +- Fix _stricmp undefined problem in linux. Use strcasecmp instead. +- "www.scumways.com" should be "scumways.com" in test.cpp. + +To import a new snapshot of libxml: +- Git clone from https://github.com/Zintinio/HappyHTTP. +- Copy the files into src/ directory +- Apply the patches in patches/ and fix any problems. +- Update this README to reflect the new version number. diff --git a/third_party/happyhttp/happyhttp.gyp b/third_party/happyhttp/happyhttp.gyp new file mode 100644 index 0000000000..7f8b93e917 --- /dev/null +++ b/third_party/happyhttp/happyhttp.gyp @@ -0,0 +1,26 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'happyhttp_lib', + 'type': 'static_library', + 'sources': [ + 'src/happyhttp.cpp', + 'src/happyhttp.h', + ], + }, + { + 'target_name': 'happyhttp_lib_test', + 'type': 'executable', + 'sources': [ + 'src/test.cpp', + ], + 'dependencies': [ + 'happyhttp_lib', + ], + }, + ], +} diff --git a/third_party/happyhttp/patches/_stricmp b/third_party/happyhttp/patches/_stricmp new file mode 100644 index 0000000000..80143f93b6 --- /dev/null +++ b/third_party/happyhttp/patches/_stricmp @@ -0,0 +1,13 @@ +diff --git a/third_party/happyhttp/src/happyhttp.cpp b/third_party/happyhttp/src/happyhttp.cpp +index 9e56673..8c8548f 100644 +--- a/third_party/happyhttp/src/happyhttp.cpp ++++ b/third_party/happyhttp/src/happyhttp.cpp +@@ -49,7 +49,7 @@ + #include + #include + +-#ifdef __APPLE__ ++#ifndef _WIN32 + #define _stricmp strcasecmp + #endif + diff --git a/third_party/happyhttp/patches/server_url b/third_party/happyhttp/patches/server_url new file mode 100644 index 0000000000..ab38e9218b --- /dev/null +++ b/third_party/happyhttp/patches/server_url @@ -0,0 +1,31 @@ +diff --git a/third_party/happyhttp/src/test.cpp b/third_party/happyhttp/src/test.cpp +index f3d39d1..3ce74b4 100644 +--- a/third_party/happyhttp/src/test.cpp ++++ b/third_party/happyhttp/src/test.cpp +@@ -31,7 +31,7 @@ void Test1() + { + puts("-----------------Test1------------------------" ); + // simple simple GET +- happyhttp::Connection conn( "www.scumways.com", 80 ); ++ happyhttp::Connection conn( "scumways.com", 80 ); + conn.setcallbacks( OnBegin, OnData, OnComplete, 0 ); + + conn.request( "GET", "/happyhttp/test.php", 0, 0,0 ); +@@ -57,7 +57,7 @@ void Test2() + + const char* body = "answer=42&name=Bubba"; + +- happyhttp::Connection conn( "www.scumways.com", 80 ); ++ happyhttp::Connection conn( "scumways.com", 80 ); + conn.setcallbacks( OnBegin, OnData, OnComplete, 0 ); + conn.request( "POST", + "/happyhttp/test.php", +@@ -77,7 +77,7 @@ void Test3() + const char* params = "answer=42&foo=bar"; + int l = strlen(params); + +- happyhttp::Connection conn( "www.scumways.com", 80 ); ++ happyhttp::Connection conn( "scumways.com", 80 ); + conn.setcallbacks( OnBegin, OnData, OnComplete, 0 ); + + conn.putrequest( "POST", "/happyhttp/test.php" ); diff --git a/third_party/happyhttp/src/happyhttp.cpp b/third_party/happyhttp/src/happyhttp.cpp index 9e566735f6..8c8548f47c 100644 --- a/third_party/happyhttp/src/happyhttp.cpp +++ b/third_party/happyhttp/src/happyhttp.cpp @@ -49,7 +49,7 @@ #include #include -#ifdef __APPLE__ +#ifndef _WIN32 #define _stricmp strcasecmp #endif diff --git a/third_party/happyhttp/src/test.cpp b/third_party/happyhttp/src/test.cpp index f3d39d1424..3ce74b47d9 100644 --- a/third_party/happyhttp/src/test.cpp +++ b/third_party/happyhttp/src/test.cpp @@ -31,7 +31,7 @@ void Test1() { puts("-----------------Test1------------------------" ); // simple simple GET - happyhttp::Connection conn( "www.scumways.com", 80 ); + happyhttp::Connection conn( "scumways.com", 80 ); conn.setcallbacks( OnBegin, OnData, OnComplete, 0 ); conn.request( "GET", "/happyhttp/test.php", 0, 0,0 ); @@ -57,7 +57,7 @@ void Test2() const char* body = "answer=42&name=Bubba"; - happyhttp::Connection conn( "www.scumways.com", 80 ); + happyhttp::Connection conn( "scumways.com", 80 ); conn.setcallbacks( OnBegin, OnData, OnComplete, 0 ); conn.request( "POST", "/happyhttp/test.php", @@ -77,7 +77,7 @@ void Test3() const char* params = "answer=42&foo=bar"; int l = strlen(params); - happyhttp::Connection conn( "www.scumways.com", 80 ); + happyhttp::Connection conn( "scumways.com", 80 ); conn.setcallbacks( OnBegin, OnData, OnComplete, 0 ); conn.putrequest( "POST", "/happyhttp/test.php" );