http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/78.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/78.png b/thirdparty/civetweb-1.9.1/test/imagetest/78.png deleted file mode 100644 index 110277d..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/78.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/79.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/79.png b/thirdparty/civetweb-1.9.1/test/imagetest/79.png deleted file mode 100644 index 145d580..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/79.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/80.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/80.png b/thirdparty/civetweb-1.9.1/test/imagetest/80.png deleted file mode 100644 index 414c12a..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/80.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/81.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/81.png b/thirdparty/civetweb-1.9.1/test/imagetest/81.png deleted file mode 100644 index acdc06f..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/81.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/82.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/82.png b/thirdparty/civetweb-1.9.1/test/imagetest/82.png deleted file mode 100644 index 0fa4b88..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/82.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/83.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/83.png b/thirdparty/civetweb-1.9.1/test/imagetest/83.png deleted file mode 100644 index 26bcb19..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/83.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/84.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/84.png b/thirdparty/civetweb-1.9.1/test/imagetest/84.png deleted file mode 100644 index 9b883da..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/84.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/85.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/85.png b/thirdparty/civetweb-1.9.1/test/imagetest/85.png deleted file mode 100644 index 481069e..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/85.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/86.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/86.png b/thirdparty/civetweb-1.9.1/test/imagetest/86.png deleted file mode 100644 index b1c4c44..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/86.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/87.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/87.png b/thirdparty/civetweb-1.9.1/test/imagetest/87.png deleted file mode 100644 index 266b2eb..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/87.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/88.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/88.png b/thirdparty/civetweb-1.9.1/test/imagetest/88.png deleted file mode 100644 index cbcdd26..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/88.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/89.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/89.png b/thirdparty/civetweb-1.9.1/test/imagetest/89.png deleted file mode 100644 index 90dc196..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/89.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/90.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/90.png b/thirdparty/civetweb-1.9.1/test/imagetest/90.png deleted file mode 100644 index f7c7994..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/90.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/91.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/91.png b/thirdparty/civetweb-1.9.1/test/imagetest/91.png deleted file mode 100644 index 756c548..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/91.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/92.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/92.png b/thirdparty/civetweb-1.9.1/test/imagetest/92.png deleted file mode 100644 index 4c5abd7..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/92.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/93.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/93.png b/thirdparty/civetweb-1.9.1/test/imagetest/93.png deleted file mode 100644 index f6e0660..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/93.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/94.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/94.png b/thirdparty/civetweb-1.9.1/test/imagetest/94.png deleted file mode 100644 index c5b1ca1..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/94.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/95.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/95.png b/thirdparty/civetweb-1.9.1/test/imagetest/95.png deleted file mode 100644 index 1a7c3dd..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/95.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/96.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/96.png b/thirdparty/civetweb-1.9.1/test/imagetest/96.png deleted file mode 100644 index 36b01c3..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/96.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/97.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/97.png b/thirdparty/civetweb-1.9.1/test/imagetest/97.png deleted file mode 100644 index 75ca62c..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/97.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/98.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/98.png b/thirdparty/civetweb-1.9.1/test/imagetest/98.png deleted file mode 100644 index 22094b8..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/98.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/imagetest/99.png ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/imagetest/99.png b/thirdparty/civetweb-1.9.1/test/imagetest/99.png deleted file mode 100644 index 9a97ff5..0000000 Binary files a/thirdparty/civetweb-1.9.1/test/imagetest/99.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/linux.cgi ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/linux.cgi b/thirdparty/civetweb-1.9.1/test/linux.cgi deleted file mode 100755 index f65fc7a..0000000 --- a/thirdparty/civetweb-1.9.1/test/linux.cgi +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -printf "Content-Type: text/plain\r\n" -printf "\r\n" - -echo "This is a shell script called by CGI:" -echo -set - http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/linux_fail.cgi ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/linux_fail.cgi b/thirdparty/civetweb-1.9.1/test/linux_fail.cgi deleted file mode 100644 index 885dff2..0000000 --- a/thirdparty/civetweb-1.9.1/test/linux_fail.cgi +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - ->&2 echo "Some error sent to stderr" - http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/linux_fail_silent.cgi ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/linux_fail_silent.cgi b/thirdparty/civetweb-1.9.1/test/linux_fail_silent.cgi deleted file mode 100644 index 0cc08c7..0000000 --- a/thirdparty/civetweb-1.9.1/test/linux_fail_silent.cgi +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -echo not a complete header -echo and nothing sent to stderr - http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/lua_preload_file.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/lua_preload_file.lua b/thirdparty/civetweb-1.9.1/test/lua_preload_file.lua deleted file mode 100644 index 7761f47..0000000 --- a/thirdparty/civetweb-1.9.1/test/lua_preload_file.lua +++ /dev/null @@ -1,7 +0,0 @@ ---[[ -Load this test file by adding - lua_preload_file ./lua_preload_file.lua -to the civetweb.conf file -]] - -mg.preload = "lua_preload_file successfully loaded" http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/main.c ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/main.c b/thirdparty/civetweb-1.9.1/test/main.c deleted file mode 100644 index ce2de5f..0000000 --- a/thirdparty/civetweb-1.9.1/test/main.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) 2015-2017 the Civetweb developers - * - * 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 "civetweb_check.h" -#include "shared.h" -#include "public_func.h" -#include "public_server.h" -#include "private.h" -#include "timertest.h" -#include "private_exe.h" - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -/* This unit test file uses the excellent Check unit testing library. - * The API documentation is available here: - * http://check.sourceforge.net/doc/check_html/index.html - */ - -int -main(const int argc, char *argv[]) -{ - // Determine what tests to run - const char *suite = NULL; - const char *const suite_arg = "--suite="; - const size_t suite_arg_size = strlen(suite_arg); - const char *test_case = NULL; - const char *const test_case_arg = "--test-case="; - const size_t test_case_arg_size = strlen(test_case_arg); - const char *const test_dir_arg = "--test-dir="; - const size_t test_dir_arg_size = strlen(test_dir_arg); - for (int i = 1; i < argc; ++i) { - if (0 == strncmp(suite_arg, argv[i], suite_arg_size) - && (strlen(argv[i]) > suite_arg_size)) { - suite = &argv[i][suite_arg_size]; - } else if (0 == strncmp(test_case_arg, argv[i], test_case_arg_size) - && (strlen(argv[i]) > test_case_arg_size)) { - test_case = &argv[i][test_case_arg_size]; - } else if (0 == strncmp(test_dir_arg, argv[i], test_dir_arg_size) - && (strlen(argv[i]) > test_dir_arg_size)) { - set_test_directory(&argv[i][test_dir_arg_size]); - } else if (0 == strcmp("--help", argv[i])) { - printf( - "Usage: %s [options]\n" - " --suite=Suite Determines the suite to run\n" - " --test-case='Test Case' Determines the test case to run\n" - " --test-dir='folder/path' The location of the test directory " - "with the \n" - " 'fixtures' and 'expected\n", - argv[0]); - exit(EXIT_SUCCESS); - } else { - fprintf(stderr, "Invalid argument: %s\n", argv[i]); - exit(EXIT_FAILURE); - } - } - - /* Run up the tests */ - SRunner *const srunner = srunner_create(make_public_func_suite()); - srunner_add_suite(srunner, make_public_server_suite()); - srunner_add_suite(srunner, make_private_suite()); - srunner_add_suite(srunner, make_private_exe_suite()); - srunner_add_suite(srunner, make_timertest_suite()); - - /* Write test logs to a file */ - srunner_set_log(srunner, "test.log"); - srunner_set_xml(srunner, "test.xml"); - - /* CK_NORMAL offers not enough diagnosis during setup phase*/ - srunner_run(srunner, suite, test_case, CK_VERBOSE); - - const int number_run = srunner_ntests_run(srunner); - const int number_failed = srunner_ntests_failed(srunner); - srunner_free(srunner); - return (number_failed == 0) && (number_run != 0) ? EXIT_SUCCESS - : EXIT_FAILURE; -} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page.lp ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page.lp b/thirdparty/civetweb-1.9.1/test/page.lp deleted file mode 100644 index ffd12f1..0000000 --- a/thirdparty/civetweb-1.9.1/test/page.lp +++ /dev/null @@ -1,71 +0,0 @@ -HTTP/1.0 200 OK -Content-Type: text/html - -<html><body> - - -<p>This is another example of a Lua server page, served by -<a href="http://sourceforge.net/projects/civetweb/">Civetweb web server</a>. -</p><p> -The following features are available: -<ul> -<? - mg.write("<li>" .. _VERSION .. " server pages</li>") - if sqlite3 then - mg.write("<li>sqlite3 binding</li>") - end - if lfs then - mg.write("<li>lua file system</li>") - end -?> -</ul></p> -<p> Today is <? mg.write(os.date("%A")) ?></p> -<p> URI is <? mg.write(mg.request_info.uri) ?></p> -<p> URI is <?=mg.request_info.uri?></p> - -<p>Database example: -<pre> -<? - -- Open database - local db = sqlite3.open('requests.db') - -- Note that the data base is located in the current working directory - -- of the process if no other path is given here. - - -- Setup a trace callback, to show SQL statements we'll be executing. - -- db:trace(function(data, sql) mg.write('Executing: ', sql: '\n') end, nil) - - -- Create a table if it is not created already - db:exec([[ - CREATE TABLE IF NOT EXISTS requests ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - timestamp NOT NULL, - method NOT NULL, - uri NOT NULL, - addr - ); - ]]) - - -- Add entry about this request - local stmt = db:prepare( - 'INSERT INTO requests VALUES(NULL, datetime("now"), ?, ?, ?);'); - stmt:bind_values(mg.request_info.request_method, - mg.request_info.uri, - mg.request_info.remote_port) - stmt:step() - stmt:finalize() - - -- Show all previous records - mg.write('Previous requests:\n') - stmt = db:prepare('SELECT * FROM requests ORDER BY id DESC;') - while stmt:step() == sqlite3.ROW do - local v = stmt:get_values() - mg.write(v[1] .. ' ' .. v[2] .. ' ' .. v[3] .. ' ' - .. v[4] .. ' ' .. v[5] .. '\n') - end - - -- Close database - db:close() -?> -</pre></p> - -</body></html> http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page.lua b/thirdparty/civetweb-1.9.1/test/page.lua deleted file mode 100644 index fc18316..0000000 --- a/thirdparty/civetweb-1.9.1/test/page.lua +++ /dev/null @@ -1,71 +0,0 @@ -mg.write("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n") - -mg.write([[ -<html><body> -<p>This is another example of a Lua script, creating a web page served by the -<a href="http://sourceforge.net/projects/civetweb/">Civetweb web server</a>. -</p><p> -The following features are available: -<ul> -]]) - - mg.write("<li>" .. _VERSION .. " server pages</li>") - if sqlite3 then - mg.write("<li>sqlite3 binding</li>") - end - if lfs then - mg.write("<li>lua file system</li>") - end - - -mg.write("</ul></p>\r\n") -mg.write("<p> Today is " .. os.date("%A") .. "</p>\r\n") -mg.write("<p> URI is " .. mg.request_info.uri .. "</p>\r\n") - -mg.write("<p>Database example:\r\n<pre>\r\n") - - -- Open database - local db = sqlite3.open('requests.db') - -- Note that the data base is located in the current working directory - -- of the process if no other path is given here. - - -- Setup a trace callback, to show SQL statements we'll be executing. - -- db:trace(function(data, sql) mg.write('Executing: ', sql: '\n') end, nil) - - -- Create a table if it is not created already - db:exec([[ - CREATE TABLE IF NOT EXISTS requests ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - timestamp NOT NULL, - method NOT NULL, - uri NOT NULL, - addr - ); - ]]) - - -- Add entry about this request - local stmt = db:prepare( - 'INSERT INTO requests VALUES(NULL, datetime("now"), ?, ?, ?);'); - stmt:bind_values(mg.request_info.request_method, - mg.request_info.uri, - mg.request_info.remote_port) - stmt:step() - stmt:finalize() - - -- Show all previous records - mg.write('Previous requests:\n') - stmt = db:prepare('SELECT * FROM requests ORDER BY id DESC;') - while stmt:step() == sqlite3.ROW do - local v = stmt:get_values() - mg.write(v[1] .. ' ' .. v[2] .. ' ' .. v[3] .. ' ' - .. v[4] .. ' ' .. v[5] .. '\n') - end - - -- Close database - db:close() - -mg.write([[ -</pre> -</p> -</body></html> -]]) http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page.ssjs ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page.ssjs b/thirdparty/civetweb-1.9.1/test/page.ssjs deleted file mode 100644 index d4465a6..0000000 --- a/thirdparty/civetweb-1.9.1/test/page.ssjs +++ /dev/null @@ -1,19 +0,0 @@ -print = conn.write || print - -// send a header -print('HTTP/1.0 200 OK\r\n'); -print('Content-Type: text/html\r\n'); -print('\r\n'); - -print("<html><body>\n"); -print("<p>This example page is generated by the "); -print('<a href="https://github.com/civetweb/civetweb">CivetWeb web server</a>'); -print(" with server side javascript.</p>\n"); - -var d = new Date(); -var n = d.toString(); - -print("<p>Server time: " + n + "</p>\n"); - -print("</body></html>\n"); - http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page2.lp ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page2.lp b/thirdparty/civetweb-1.9.1/test/page2.lp deleted file mode 100644 index c98b940..0000000 --- a/thirdparty/civetweb-1.9.1/test/page2.lp +++ /dev/null @@ -1,72 +0,0 @@ -<? mg.write("HTTP/1.0 200 OK") ?> -<? mg.write("Content-Type: text/html") ?> - -<html><body> - -<p>This is another example of a Lua server page, served by -<a href="https://github.com/civetweb/civetweb">CivetWeb web server</a>. -</p><p> -The following features are available: -<ul> -<? - -- functions defubed in one Lua tag should still be available in the next one - function print_if_available(tab, name) - if tab then - mg.write("<li>" .. name .. "</li>\n") - end - end - - function recurse(tab) - mg.write("<ul>\n") - for k,v in pairs(tab) do - if type(v) == "table" then - mg.write("<li>" .. tostring(k) .. ":</li>\n") - recurse(v) - else - mg.write("<li>" .. tostring(k) .. " = " .. tostring(v) .. "</li>\n") - end - end - mg.write("</ul>\n") - end -?> -<? - -- Print Lua version and available libraries - mg.write("<li>" .. _VERSION .. " with the following standard libraries</li>\n") - mg.write("<ul>") - libs = {"string", "math", "table", "io", "os", "bit32", "utf8", "package", "coroutine", "debug"}; - for _,n in ipairs(libs) do - print_if_available(_G[n], n); - end - mg.write("</ul>\n") - print_if_available(sqlite3, "sqlite3 binding") - print_if_available(lfs,"lua file system") - - -- Print mg library - libname = "mg" - print_if_available(_G[libname], libname .. " library") - recurse(_G[libname]) - - -- Print connect function - print_if_available(connect, "connect function") - -?> -</ul></p> -<p> Today is <? mg.write(os.date("%A")) ?> - -<p> -<? - -- for k,v in pairs(_G) do mg.write(k, '\n') end - - if lfs then - mg.write("Files in " .. lfs.currentdir()) - mg.write("\n<ul>\n") - for f in lfs.dir(".") do - mg.write("<li>" .. f .. "</li>\n") - local at = lfs.attributes(f); - recurse(at) - end - mg.write("</ul>\n") - end -?> -</p> -</body></html> http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page2.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page2.lua b/thirdparty/civetweb-1.9.1/test/page2.lua deleted file mode 100644 index 4557dd5..0000000 --- a/thirdparty/civetweb-1.9.1/test/page2.lua +++ /dev/null @@ -1,87 +0,0 @@ -mg.write("HTTP/1.0 200 OK\r\n") -mg.write("Content-Type: text/html\r\n") -mg.write("\r\n") -mg.write([[<html><body> - -<p>This is another example of a Lua server page, served by -<a href="https://github.com/civetweb/civetweb">CivetWeb web server</a>. -</p><p> -The following features are available: -<ul> -]]) - -function print_if_available(tab, name) - if tab then - mg.write("<li>" .. name .. "</li>\n") - end -end - -function recurse(tab, excl) - excl = excl or {} - mg.write("<ul>\n") - for k,v in pairs(tab) do - if type(v) == "table" then - mg.write("<li>" .. tostring(k) .. ":</li>\n") - if excl[v] then - -- cyclic - else - excl[v] = true - recurse(v, excl) - excl[v] = false - end - else - mg.write("<li>" .. tostring(k) .. " = " .. tostring(v) .. "</li>\n") - end - end - mg.write("</ul>\n") -end - --- Print Lua version and available libraries -mg.write("<li>" .. _VERSION .. " with the following standard libraries</li>\n") -mg.write("<ul>\n") -libs = {"string", "math", "table", "io", "os", "bit32", "utf8", "package", "coroutine", "debug"}; -for _,n in ipairs(libs) do - print_if_available(_G[n], n); -end -mg.write("</ul>\n") -print_if_available(sqlite3, "sqlite3 binding") -print_if_available(lfs, "lua file system") - ---recurse(_G) - --- Print mg library -libname = "mg" -print_if_available(_G[libname], libname .. " library") -recurse(_G[libname]) - --- Print connect function -print_if_available(connect, "connect function") - -mg.write("</ul></p>\n"); -mg.write("<p> Today is " .. os.date("%A") .. "</p>\n"); - -l = mg.request_info.content_length -if l then - mg.write("<p>Content-Length = "..l..":<br>\n<pre>\n") - mg.write(mg.read()) - mg.write("\n</pre>\n</p>\n") -end - -mg.write("<p>\n"); - - if lfs then - mg.write("Files in " .. lfs.currentdir()) - mg.write("\n<ul>\n") - for f in lfs.dir(".") do - local mime = mg.get_mime_type(f) - mg.write("<li>" .. f .. " (" .. mime .. ")</li>\n") - local at = lfs.attributes(f); - recurse(at) - end - mg.write("</ul>\n") -end - -mg.write([[ -</p> -</body></html> -]]) http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page2.ssjs ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page2.ssjs b/thirdparty/civetweb-1.9.1/test/page2.ssjs deleted file mode 100644 index 66e0c83..0000000 --- a/thirdparty/civetweb-1.9.1/test/page2.ssjs +++ /dev/null @@ -1,30 +0,0 @@ -conn.write("HTTP/1.0 200 OK\r\n") -conn.write("Content-Type: text/html\r\n") -conn.write("\r\n") -conn.write("<html><body>\r\n") -conn.write("<p>This is an example of a server side JavaScript, served by the ") -conn.write('<a href="https://github.com/civetweb/civetweb/">CivetWeb web server</a>.') -conn.write("</p>\r\n") - - -function print_elements(title, obj) -{ - conn.write("<p>\r\n"); - conn.write("<b>" + title + "</b><br>\r\n"); - elms = Object.getOwnPropertyNames(obj) - - for (var i = 0; i < elms.length; i++) { - conn.write(JSON.stringify(elms[i]) + ":<br>\r\n") - conn.write("Type: " + typeof(obj[elms[i]]) + "<br>\r\n") - conn.write(JSON.stringify(Object.getOwnPropertyDescriptor(obj, elms[i])) + "<br>\r\n") - conn.write("<br>\r\n") - } - conn.write('<br></p>\r\n') -} - - -print_elements("conn", conn) -print_elements("civetweb", civetweb) - - -conn.write('</body></html>\r\n') http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page3.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page3.lua b/thirdparty/civetweb-1.9.1/test/page3.lua deleted file mode 100644 index fec6899..0000000 --- a/thirdparty/civetweb-1.9.1/test/page3.lua +++ /dev/null @@ -1,34 +0,0 @@ --- This test checks if a query string has been given. --- It sends the file identified by the query string. --- Do not use it in a real server in this way! - -if not mg.request_info.query_string then - mg.write("HTTP/1.0 200 OK\r\n") - mg.write("Connection: close\r\n") - mg.write("Content-Type: text/html; charset=utf-8\r\n") - mg.write("\r\n") - mg.write("<html><head><title>Civetweb Lua script test page 3</title></head>\r\n") - mg.write("<body>No query string!</body></html>\r\n") -elseif mg.request_info.query_string:match("/") or mg.request_info.query_string:match("\\") then - mg.write("HTTP/1.0 403 Forbidden\r\n") - mg.write("Connection: close\r\n") - mg.write("Content-Type: text/html; charset=utf-8\r\n") - mg.write("\r\n") - mg.write("<html><head><title>Civetweb Lua script test page 3</title></head>\r\n") - mg.write("<body>No access!</body></html>\r\n") -else - file = mg.get_var(mg.request_info.query_string, "file"); - if not file then - mg.write("HTTP/1.0 400 Bad Request\r\n") - mg.write("Connection: close\r\n") - mg.write("Content-Type: text/html; charset=utf-8\r\n") - mg.write("\r\n") - mg.write("<html>\r\n<head><title>Civetweb Lua script test page 3</title></head>\r\n") - mg.write("<body>\r\nQuery string does not contain a 'file' variable.<br>\r\n") - mg.write("Try <a href=\"?file=page3.lua&somevar=something\">?file=page3.lua&somevar=something</a>\r\n") - mg.write("</body>\r\n</html>\r\n") - else - filename = mg.document_root .. "/" .. file - mg.send_file(filename) - end -end http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page3.ssjs ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page3.ssjs b/thirdparty/civetweb-1.9.1/test/page3.ssjs deleted file mode 100644 index 71e55e3..0000000 --- a/thirdparty/civetweb-1.9.1/test/page3.ssjs +++ /dev/null @@ -1,61 +0,0 @@ -print = conn.write || print - -opts = [ -"cgi_pattern", -"cgi_environment", -"put_delete_auth_file", -"cgi_interpreter", -"protect_uri", -"authentication_domain", -"ssi_pattern", -"throttle", -"access_log_file", -"enable_directory_listing", -"error_log_file", -"global_auth_file", -"index_files", -"enable_keep_alive", -"access_control_list", -"extra_mime_types", -"listening_ports", -"document_root", -"ssl_certificate", -"num_threads", -"run_as_user", -"url_rewrite_patterns", -"hide_files_patterns", -"request_timeout_ms", -"websocket_timeout_ms", -"decode_url", -"lua_preload_file", -"lua_script_pattern", -"lua_server_page_pattern", -"_experimental_duktape_script_pattern", -"websocket_root", -"lua_websocket_pattern", -"access_control_allow_origin", -"error_pages", -"_unknown__option" -] - -// send a header -print('HTTP/1.0 200 OK\r\n'); -print('Content-Type: text/html\r\n'); -print('\r\n'); - -print("<html><body>\n"); -print("<p>This example page is generated by the "); -print('<a href="https://github.com/civetweb/civetweb">CivetWeb web server</a>'); -print(" with server side javascript.</p>\n"); - -for (var i=0; i < opts.length; i++) { - var o = opts[i]; - var n = civetweb.getoption(o); - if (typeof(n) == "string") { - print("<p>Option " + o + " = " + n + "</p>\n"); - } else { - print("<p>Option " + o + " not known</p>\n"); - } -} - -print("</body></html>\n"); http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page4.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page4.lua b/thirdparty/civetweb-1.9.1/test/page4.lua deleted file mode 100644 index e2b84d7..0000000 --- a/thirdparty/civetweb-1.9.1/test/page4.lua +++ /dev/null @@ -1,180 +0,0 @@ --- This test checks the Lua functions: --- get_var, get_cookie, md5, url_encode - -now = os.time() -cookie_name = "civetweb-test-page4" - -if mg.request_info.http_headers.Cookie then - cookie_value = tonumber(mg.get_cookie(mg.request_info.http_headers.Cookie, cookie_name)) -end - -mg.write("HTTP/1.0 200 OK\r\n") -mg.write("Connection: close\r\n") -mg.write("Content-Type: text/html; charset=utf-8\r\n") -mg.write("Cache-Control: max-age=0, must-revalidate\r\n") -if not cookie_value then - mg.write("Set-Cookie: " .. cookie_name .. "=" .. tostring(now) .. "\r\n") -end -mg.write("\r\n") - -mg.write("<html>\r\n<head><title>Civetweb Lua script test page 4</title></head>\r\n<body>\r\n") -mg.write("<p>Test of Civetweb Lua Functions:</p>\r\n"); -mg.write("<pre>\r\n"); - --- get_var of query_string -mg.write("get_var test (check query string):\r\n") -if not mg.request_info.query_string then - mg.write(" No query string. You may try <a href='?a=a1&junk&b=b2&cc=cNotSet&d=a, b and d should be set&z=z'>this example</a>.\r\n") -else - for _,var in ipairs({'a','b','c','d'}) do - value = mg.get_var(mg.request_info.query_string, var); - if value then - mg.write(" Variable " .. var .. ": value " .. value .. "\r\n"); - else - mg.write(" Variable " .. var .. " not set\r\n"); - end - end -end -mg.write("\r\n") - --- md5 -mg.write("MD5 test:\r\n") -test_string = "abcd\0efgh" -mg.write(" String with embedded 0, length " .. string.len(test_string)) -test_md5 = mg.md5(test_string) -mg.write(", MD5 " .. test_md5 .. "\r\n") -if mg.md5("") == "d41d8cd98f00b204e9800998ecf8427e" then - mg.write(" MD5 of empty string OK\r\n") -else - mg.write(" Error: MD5 of empty string NOT OK\r\n") -end -if mg.md5("The quick brown fox jumps over the lazy dog.") == "e4d909c290d0fb1ca068ffaddf22cbd0" then - mg.write(" MD5 of test string OK\r\n") -else - mg.write(" Error: MD5 of test string NOT OK\r\n") -end -mg.write("\r\n") - --- get_cookie -mg.write("Cookie test:\r\n") -if not cookie_value then - mg.write(" Cookie not set yet. Please reload the page.\r\n") -else - mg.write(" Cookie set to " .. cookie_value .. "\r\n") - mg.write(" You visited this page " .. os.difftime(now, cookie_value) .. " seconds before.\r\n") -end -mg.write("\r\n") - --- test 'require' of other Lua scripts -mg.write("require test\r\n") -script_path = mg.script_name:match("(.*)page%d*.lua") -if type(script_path)=='string' then - package.path = script_path .. "?.lua;" .. package.path - mg.write(" Lua search path: " .. package.path .. "\r\n") - require "html_esc" - require "require_test" - if htmlEscape then - for i=0,15 do - mg.write(" ") - for j=0,15 do - mg.write(tostring(htmlEscape[16*i+j])) - end - mg.write("\r\n") - end - else - mg.write(" 'require' test failed (htmlEscape)\r\n") - end - if HugeText then - mg.write("\r\n") - local ht = HugeText(os.date("%a %b. %d")) - for i=1,#ht do - mg.write(" " .. ht[i] .. "\r\n") - end - else - mg.write(" 'require' test failed (HugeText)\r\n") - end -else - mg.write(" name match failed\r\n") -end -mg.write("\r\n") - --- test get_response_code_text -mg.write("HTTP helper methods test:\r\n") -if (htmlEscape("<a b & c d>") == "<a b & c d>") then - mg.write(" htmlEscape test OK\r\n") -else - mg.write(" Error: htmlEscape test NOT OK\r\n") -end -if (mg.get_response_code_text(200) == "OK") then - mg.write(" get_response_code_text test OK\r\n") -else - mg.write(" Error: get_response_code_text test NOT OK\r\n") -end -mg.write("\r\n") - --- url_encode -mg.write("URL encode/decode test:\r\n") -if mg.url_encode("") == "" then - mg.write(" url_encode of empty string OK\r\n") -else - mg.write(" Error: url_encode of empty string NOT OK\r\n") -end -raw_string = [[ !"#$%&'()*+,-./0123456789:;<=>?@]] -mg.write(" original string: " .. htmlEscape(raw_string) .. "\r\n") -mg_string = mg.url_encode(raw_string):upper() -ref_string = "%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40" -- from http://www.w3schools.com/tags/ref_urlencode.asp -mg.write(" mg-url: " .. htmlEscape(mg_string) .. "\r\n") -mg.write(" reference url: " .. htmlEscape(ref_string) .. "\r\n") -dec_mg_string = mg.url_decode(mg_string) -dec_ref_string = mg.url_decode(ref_string) -mg.write(" decoded mg-url: " .. htmlEscape(dec_mg_string) .. "\r\n") -mg.write(" decoded reference url: " .. htmlEscape(dec_ref_string) .. "\r\n") -dec_mg_string = mg.url_decode(mg_string, false) -dec_ref_string = mg.url_decode(ref_string, false) -mg.write(" decoded mg-url: " .. htmlEscape(dec_mg_string) .. "\r\n") -mg.write(" decoded reference url: " .. htmlEscape(dec_ref_string) .. "\r\n") -dec_mg_string = mg.url_decode(mg_string, true) -dec_ref_string = mg.url_decode(ref_string, true) -mg.write(" decoded mg-url: " .. htmlEscape(dec_mg_string) .. "\r\n") -mg.write(" decoded reference url: " .. htmlEscape(dec_ref_string) .. "\r\n") -mg.write("\r\n") - --- base64_encode -mg.write("BASE64 encode/decode test:\r\n") -raw_string = [[ !"#$%&'()*+,-./0123456789:;<=>?@]] -mg.write(" original string: " .. htmlEscape(raw_string) .. "\r\n") -mg_string = mg.base64_encode(raw_string) -ref_string = "ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9A" -- from http://www.base64encode.org/ -mg.write(" mg-base64: " .. htmlEscape(mg_string) .. "\r\n") -mg.write(" reference base64: " .. htmlEscape(ref_string) .. "\r\n") -dec_mg_string = mg.base64_decode(mg_string) -dec_ref_string = mg.base64_decode(ref_string) -mg.write(" decoded mg-base64: " .. htmlEscape(dec_mg_string) .. "\r\n") -mg.write(" decoded reference base64: " .. htmlEscape(dec_ref_string) .. "\r\n") -mg.write("\r\n") -raw_string = [[<?> -?-]] -mg.write(" original string: " .. htmlEscape(raw_string) .. "\r\n") -mg_string = mg.base64_encode(raw_string) -ref_string = "PD8+IC0/LQ==" -- from http://www.base64encode.org/ -mg.write(" mg-base64: " .. htmlEscape(mg_string) .. "\r\n") -mg.write(" reference base64: " .. htmlEscape(ref_string) .. "\r\n") -dec_mg_string = mg.base64_decode(mg_string) -dec_ref_string = mg.base64_decode(ref_string) -mg.write(" decoded mg-base64: " .. htmlEscape(dec_mg_string) .. "\r\n") -mg.write(" decoded reference base64: " .. htmlEscape(dec_ref_string) .. "\r\n") -mg.write("\r\n") - --- random -mg.write("Random numbers:\r\n") -for i=1,10 do mg.write(string.format("%18u\r\n", mg.random())) end -mg.write("\r\n") - --- uuid -if mg.uuid then -mg.write("UUIDs:\r\n") -for i=1,10 do mg.write(string.format("%40s\r\n", mg.uuid())) end -mg.write("\r\n") -end - --- end of page -mg.write("</pre>\r\n</body>\r\n</html>\r\n") http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page5.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page5.lua b/thirdparty/civetweb-1.9.1/test/page5.lua deleted file mode 100644 index dcf7f9f..0000000 --- a/thirdparty/civetweb-1.9.1/test/page5.lua +++ /dev/null @@ -1,8 +0,0 @@ -mg.write("HTTP/1.0 200 OK\r\n") -mg.write("Content-Type: text/html\r\n") -mg.write("\r\n") -mg.write([[<html><body><p> -Hello world! -</p> -</body></html> -]]) http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page_keep_alive.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page_keep_alive.lua b/thirdparty/civetweb-1.9.1/test/page_keep_alive.lua deleted file mode 100644 index 8ec5ac5..0000000 --- a/thirdparty/civetweb-1.9.1/test/page_keep_alive.lua +++ /dev/null @@ -1,32 +0,0 @@ --- Set keep_alive. The return value specifies if this is possible at all. -canKeepAlive = mg.keep_alive(true) - -if canKeepAlive then - -- Create the entire response in a string variable first. Content-Length will be set to the length of this string. - reply = [[ - <html><body> - <p>This is a Lua script supporting html keep-alive with the <a href="http://sourceforge.net/projects/civetweb/">Civetweb web server</a>.</p> - <p>It works by setting the Content-Length header field properly. - </body></html> - ]] -else - reply = "<html><body>Keep alive not possible!</body></html>" -end - --- First send the http headers -mg.write("HTTP/1.1 200 OK\r\n") -mg.write("Content-Type: text/html\r\n") -mg.write("Date: " .. os.date("!%a, %d %b %Y %H:%M:%S") .. " GMT\r\n") -mg.write("Cache-Control: no-cache\r\n") - -if canKeepAlive then - mg.write("Content-Length: " .. tostring(string.len(reply)) .. "\r\n") - mg.write("Connection: keep-alive\r\n") -else - mg.write("Connection: close\r\n") -end -mg.write("\r\n") - --- Finally send the content -mg.write(reply) - http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/page_keep_alive_chunked.lua ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/page_keep_alive_chunked.lua b/thirdparty/civetweb-1.9.1/test/page_keep_alive_chunked.lua deleted file mode 100644 index 28ac7d1..0000000 --- a/thirdparty/civetweb-1.9.1/test/page_keep_alive_chunked.lua +++ /dev/null @@ -1,66 +0,0 @@ --- Set keep_alive. The return value specifies if this is possible at all. -canKeepAlive = mg.keep_alive(true) -now = os.date("!%a, %d %b %Y %H:%M:%S") - --- First send the http headers -mg.write("HTTP/1.1 200 OK\r\n") -mg.write("Content-Type: text/html\r\n") -mg.write("Date: " .. now .. " GMT\r\n") -mg.write("Cache-Control: no-cache\r\n") -mg.write("Last-Modified: " .. now .. " GMT\r\n") -if not canKeepAlive then - mg.write("Connection: close\r\n") - mg.write("\r\n") - mg.write("<html><body>Keep alive not possible!</body></html>") - return -end -if mg.request_info.http_version ~= "1.1" then - -- wget will use HTTP/1.0 and Connection: keep-alive, so chunked transfer is not possible - mg.write("Connection: close\r\n") - mg.write("\r\n") - mg.write("<html><body>Chunked transfer is only possible for HTTP/1.1 requests!</body></html>") - mg.keep_alive(false) - return -end - --- use chunked encoding (http://www.jmarshall.com/easy/http/#http1.1c2) -mg.write("Cache-Control: max-age=0, must-revalidate\r\n") ---mg.write("Cache-Control: no-cache\r\n") ---mg.write("Cache-Control: no-store\r\n") -mg.write("Connection: keep-alive\r\n") -mg.write("Transfer-Encoding: chunked\r\n") -mg.write("\r\n") - --- function to send a chunk -function send(str) - local len = string.len(str) - mg.write(string.format("%x\r\n", len)) - mg.write(str.."\r\n") -end - --- send the chunks -send("<html>") -send("<head><title>Civetweb Lua script chunked transfer test page</title></head>") -send("<body>\n") - -fileCnt = 0 -if lfs then - send("Files in " .. lfs.currentdir()) - send('\n<table border="1">\n') - send('<tr><th>name</th><th>type</th><th>size</th></tr>\n') - for f in lfs.dir(".") do - local at = lfs.attributes(f); - if at then - send('<tr><td>' .. f .. '</td><td>' .. at.mode .. '</td><td>' .. at.size .. '</td></tr>\n') - end - fileCnt = fileCnt + 1 - end - send("</table>\n") -end - -send(fileCnt .. " entries (" .. now .. " GMT)\n") -send("</body>") -send("</html>") - --- end -send("") http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/passfile ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/passfile b/thirdparty/civetweb-1.9.1/test/passfile deleted file mode 100644 index 58c313a..0000000 --- a/thirdparty/civetweb-1.9.1/test/passfile +++ /dev/null @@ -1,3 +0,0 @@ -guest:mydomain.com:485264dcc977a1925370b89d516a1477 -Administrator:mydomain.com:e32daa3028eba04dc53e2d781e6fc983 - http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/prime.ssjs ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/prime.ssjs b/thirdparty/civetweb-1.9.1/test/prime.ssjs deleted file mode 100644 index 6dc3243..0000000 --- a/thirdparty/civetweb-1.9.1/test/prime.ssjs +++ /dev/null @@ -1,36 +0,0 @@ -// prime.js - -// Pure Ecmascript version of low level helper -function primeCheckEcmascript(val, limit) { - for (var i = 2; i <= limit; i++) { - if ((val % i) == 0) { return false; } - } - return true; -} - -// Select available helper at load time -var primeCheckHelper = (this.primeCheckNative || primeCheckEcmascript); - -// Check 'val' for primality -function primeCheck(val) { - if (val == 1 || val == 2) { return true; } - var limit = Math.ceil(Math.sqrt(val)); - while (limit * limit < val) { limit += 1; } - return primeCheckHelper(val, limit); -} - -function primeTest() { - var res = []; - - print('Have native helper: ' + (primeCheckHelper !== primeCheckEcmascript) + '\n'); - for (var i = 2; i <= 1000; i++) { - if (primeCheck(i)) { res.push(i); } - } - print(res.join(' ')); -} - -print = this.send || conn.write - -print('HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\n'); - -primeTest(); http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/private.c ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/private.c b/thirdparty/civetweb-1.9.1/test/private.c deleted file mode 100644 index fde48df..0000000 --- a/thirdparty/civetweb-1.9.1/test/private.c +++ /dev/null @@ -1,819 +0,0 @@ -/* Copyright (c) 2015-2017 the Civetweb developers - * - * 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. - */ - -/** - * We include the source file so that we have access to the internal private - * static functions - */ -#ifdef _MSC_VER -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS -#endif -#define CIVETWEB_API static -#endif - -#ifdef REPLACE_CHECK_FOR_LOCAL_DEBUGGING -#undef MEMORY_DEBUGGING -#endif - -#include "../src/civetweb.c" - -#include <stdlib.h> -#include <time.h> - -#include "private.h" - - -/* This unit test file uses the excellent Check unit testing library. - * The API documentation is available here: - * http://check.sourceforge.net/doc/check_html/index.html - */ - - -START_TEST(test_parse_http_message) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - struct mg_request_info ri; - char empty[] = ""; - char req1[] = "GET / HTTP/1.1\r\n\r\n"; - char req2[] = "BLAH / HTTP/1.1\r\n\r\n"; - char req3[] = "GET / HTTP/1.1\r\nBah\r\n"; - char req4[] = - "GET / HTTP/1.1\r\nA: foo bar\r\nB: bar\r\nskip\r\nbaz:\r\n\r\n"; - char req5[] = "GET / HTTP/1.1\r\n\r\n"; - char req6[] = "G"; - char req7[] = " blah "; - char req8[] = " HTTP/1.1 200 OK \n\n"; - char req9[] = "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n"; - - char req10[] = "GET / HTTP/1.1\r\nA: foo bar\r\nB: bar\r\n\r\n"; - - ck_assert_int_eq(sizeof(req9) - 1, - parse_http_message(req9, sizeof(req9), &ri)); - ck_assert_int_eq(1, ri.num_headers); - - ck_assert_int_eq(sizeof(req1) - 1, - parse_http_message(req1, sizeof(req1), &ri)); - ck_assert_str_eq("1.1", ri.http_version); - ck_assert_int_eq(0, ri.num_headers); - - ck_assert_int_eq(-1, parse_http_message(req2, sizeof(req2), &ri)); - ck_assert_int_eq(0, parse_http_message(req3, sizeof(req3), &ri)); - ck_assert_int_eq(0, parse_http_message(req6, sizeof(req6), &ri)); - ck_assert_int_eq(0, parse_http_message(req7, sizeof(req7), &ri)); - ck_assert_int_eq(0, parse_http_message(empty, 0, &ri)); - ck_assert_int_eq(sizeof(req8) - 1, - parse_http_message(req8, sizeof(req8), &ri)); - - /* Multiline header are obsolete, so return an error - * (https://tools.ietf.org/html/rfc7230#section-3.2.4). */ - ck_assert_int_eq(-1, parse_http_message(req4, sizeof(req4), &ri)); - - ck_assert_int_eq(sizeof(req10) - 1, - parse_http_message(req10, sizeof(req10), &ri)); - ck_assert_str_eq("1.1", ri.http_version); - ck_assert_int_eq(2, ri.num_headers); - ck_assert_str_eq("A", ri.http_headers[0].name); - ck_assert_str_eq("foo bar", ri.http_headers[0].value); - ck_assert_str_eq("B", ri.http_headers[1].name); - ck_assert_str_eq("bar", ri.http_headers[1].value); - - - ck_assert_int_eq(sizeof(req5) - 1, - parse_http_message(req5, sizeof(req5), &ri)); - ck_assert_str_eq("GET", ri.request_method); - ck_assert_str_eq("1.1", ri.http_version); -} -END_TEST - - -START_TEST(test_should_keep_alive) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - struct mg_connection conn; - struct mg_context ctx; - char req1[] = "GET / HTTP/1.1\r\n\r\n"; - char req2[] = "GET / HTTP/1.0\r\n\r\n"; - char req3[] = "GET / HTTP/1.1\r\nConnection: close\r\n\r\n"; - char req4[] = "GET / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n"; - char yes[] = "yes"; - char no[] = "no"; - - memset(&conn, 0, sizeof(conn)); - conn.ctx = &ctx; - ck_assert_int_eq(parse_http_message(req1, sizeof(req1), &conn.request_info), - sizeof(req1) - 1); - - ctx.config[ENABLE_KEEP_ALIVE] = no; - ck_assert_int_eq(should_keep_alive(&conn), 0); - - ctx.config[ENABLE_KEEP_ALIVE] = yes; - ck_assert_int_eq(should_keep_alive(&conn), 1); - - conn.must_close = 1; - ck_assert_int_eq(should_keep_alive(&conn), 0); - - conn.must_close = 0; - parse_http_message(req2, sizeof(req2), &conn.request_info); - ck_assert_int_eq(should_keep_alive(&conn), 0); - - parse_http_message(req3, sizeof(req3), &conn.request_info); - ck_assert_int_eq(should_keep_alive(&conn), 0); - - parse_http_message(req4, sizeof(req4), &conn.request_info); - ck_assert_int_eq(should_keep_alive(&conn), 1); - - conn.status_code = 401; - ck_assert_int_eq(should_keep_alive(&conn), 0); - - conn.status_code = 200; - conn.must_close = 1; - ck_assert_int_eq(should_keep_alive(&conn), 0); -} -END_TEST - - -START_TEST(test_match_prefix) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - ck_assert_int_eq(4, match_prefix("/api", 4, "/api")); - ck_assert_int_eq(3, match_prefix("/a/", 3, "/a/b/c")); - ck_assert_int_eq(-1, match_prefix("/a/", 3, "/ab/c")); - ck_assert_int_eq(4, match_prefix("/*/", 3, "/ab/c")); - ck_assert_int_eq(6, match_prefix("**", 2, "/a/b/c")); - ck_assert_int_eq(2, match_prefix("/*", 2, "/a/b/c")); - ck_assert_int_eq(2, match_prefix("*/*", 3, "/a/b/c")); - ck_assert_int_eq(5, match_prefix("**/", 3, "/a/b/c")); - ck_assert_int_eq(5, match_prefix("**.foo|**.bar", 13, "a.bar")); - ck_assert_int_eq(2, match_prefix("a|b|cd", 6, "cdef")); - ck_assert_int_eq(2, match_prefix("a|b|c?", 6, "cdef")); - ck_assert_int_eq(1, match_prefix("a|?|cd", 6, "cdef")); - ck_assert_int_eq(-1, match_prefix("/a/**.cgi", 9, "/foo/bar/x.cgi")); - ck_assert_int_eq(12, match_prefix("/a/**.cgi", 9, "/a/bar/x.cgi")); - ck_assert_int_eq(5, match_prefix("**/", 3, "/a/b/c")); - ck_assert_int_eq(-1, match_prefix("**/$", 4, "/a/b/c")); - ck_assert_int_eq(5, match_prefix("**/$", 4, "/a/b/")); - ck_assert_int_eq(0, match_prefix("$", 1, "")); - ck_assert_int_eq(-1, match_prefix("$", 1, "x")); - ck_assert_int_eq(1, match_prefix("*$", 2, "x")); - ck_assert_int_eq(1, match_prefix("/$", 2, "/")); - ck_assert_int_eq(-1, match_prefix("**/$", 4, "/a/b/c")); - ck_assert_int_eq(5, match_prefix("**/$", 4, "/a/b/")); - ck_assert_int_eq(0, match_prefix("*", 1, "/hello/")); - ck_assert_int_eq(-1, match_prefix("**.a$|**.b$", 11, "/a/b.b/")); - ck_assert_int_eq(6, match_prefix("**.a$|**.b$", 11, "/a/b.b")); - ck_assert_int_eq(6, match_prefix("**.a$|**.b$", 11, "/a/B.A")); - ck_assert_int_eq(5, match_prefix("**o$", 4, "HELLO")); -} -END_TEST - - -START_TEST(test_remove_double_dots_and_double_slashes) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - struct { - char before[20], after[20]; - } data[] = { - {"////a", "/a"}, - {"/.....", "/."}, - {"/......", "/"}, - {"..", "."}, - {"...", "."}, - {"/...///", "/./"}, - {"/a...///", "/a.../"}, - {"/.x", "/.x"}, - {"/\\", "/"}, - {"/a\\", "/a\\"}, - {"/a\\\\...", "/a\\."}, - }; - size_t i; - - for (i = 0; i < ARRAY_SIZE(data); i++) { - remove_double_dots_and_double_slashes(data[i].before); - ck_assert_str_eq(data[i].before, data[i].after); - } -} -END_TEST - - -START_TEST(test_is_valid_uri) -{ - /* is_valid_uri is superseeded by get_uri_type */ - ck_assert_int_eq(2, get_uri_type("/api")); - ck_assert_int_eq(2, get_uri_type("/api/")); - ck_assert_int_eq(2, - get_uri_type("/some/long/path%20with%20space/file.xyz")); - ck_assert_int_eq(0, get_uri_type("api")); - ck_assert_int_eq(1, get_uri_type("*")); - ck_assert_int_eq(0, get_uri_type("*xy")); - ck_assert_int_eq(3, get_uri_type("http://somewhere/")); - ck_assert_int_eq(3, get_uri_type("https://somewhere/some/file.html")); - ck_assert_int_eq(4, get_uri_type("http://somewhere:8080/")); - ck_assert_int_eq(4, get_uri_type("https://somewhere:8080/some/file.html")); -} -END_TEST - - -START_TEST(test_next_option) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - const char *p, *list = "x/8,/y**=1;2k,z"; - struct vec a, b; - int i; - - ck_assert(next_option(NULL, &a, &b) == NULL); - for (i = 0, p = list; (p = next_option(p, &a, &b)) != NULL; i++) { - ck_assert(i != 0 || (a.ptr == list && a.len == 3 && b.len == 0)); - ck_assert(i != 1 - || (a.ptr == list + 4 && a.len == 4 && b.ptr == list + 9 - && b.len == 4)); - ck_assert(i != 2 || (a.ptr == list + 14 && a.len == 1 && b.len == 0)); - } -} -END_TEST - - -START_TEST(test_skip_quoted) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - char x[] = "a=1, b=2, c='hi \' there', d='here\\, there'", *s = x, *p; - - p = skip_quoted(&s, ", ", ", ", 0); - ck_assert(p != NULL && !strcmp(p, "a=1")); - - p = skip_quoted(&s, ", ", ", ", 0); - ck_assert(p != NULL && !strcmp(p, "b=2")); - - p = skip_quoted(&s, ",", " ", 0); - ck_assert(p != NULL && !strcmp(p, "c='hi \' there'")); - - p = skip_quoted(&s, ",", " ", '\\'); - ck_assert(p != NULL && !strcmp(p, "d='here, there'")); - ck_assert(*s == 0); -} -END_TEST - - -static int -alloc_printf(char **buf, size_t size, const char *fmt, ...) -{ - /* Test helper function - adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - va_list ap; - int ret = 0; - va_start(ap, fmt); - ret = alloc_vprintf(buf, *buf, size, fmt, ap); - va_end(ap); - return ret; -} - - -static int -alloc_printf2(char **buf, const char *fmt, ...) -{ - /* Test alternative implementation */ - va_list ap; - int ret = 0; - va_start(ap, fmt); - ret = alloc_vprintf2(buf, fmt, ap); - va_end(ap); - return ret; -} - - -START_TEST(test_alloc_vprintf) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - char buf[MG_BUF_LEN], *p = buf; - - ck_assert(alloc_printf(&p, sizeof(buf), "%s", "hi") == 2); - ck_assert(p == buf); - - ck_assert(alloc_printf(&p, sizeof(buf), "%s", "") == 0); - ck_assert(p == buf); - - ck_assert(alloc_printf(&p, sizeof(buf), "") == 0); - ck_assert(p == buf); - - /* Pass small buffer, make sure alloc_printf allocates */ - ck_assert(alloc_printf(&p, 1, "%s", "hello") == 5); - ck_assert(p != buf); - mg_free(p); - p = buf; - - /* Test alternative implementation */ - ck_assert(alloc_printf2(&p, "%s", "hello") == 5); - ck_assert(p != buf); - mg_free(p); - p = buf; -} -END_TEST - - -START_TEST(test_mg_vsnprintf) -{ - char buf[16]; - int is_trunc; - - memset(buf, 0, sizeof(buf)); - - is_trunc = 777; - mg_snprintf(NULL, &is_trunc, buf, 10, "%8i", 123); - ck_assert_str_eq(buf, " 123"); - ck_assert_int_eq(is_trunc, 0); - - is_trunc = 777; - mg_snprintf(NULL, &is_trunc, buf, 10, "%9i", 123); - ck_assert_str_eq(buf, " 123"); - ck_assert_int_eq(is_trunc, 0); - - is_trunc = 777; - mg_snprintf(NULL, &is_trunc, buf, 9, "%9i", 123); - ck_assert_str_eq(buf, " 12"); - ck_assert_int_eq(is_trunc, 1); - - is_trunc = 777; - mg_snprintf(NULL, &is_trunc, buf, 8, "%9i", 123); - ck_assert_str_eq(buf, " 1"); - ck_assert_int_eq(is_trunc, 1); - - is_trunc = 777; - mg_snprintf(NULL, &is_trunc, buf, 7, "%9i", 123); - ck_assert_str_eq(buf, " "); - ck_assert_int_eq(is_trunc, 1); - - strcpy(buf, "1234567890"); - mg_snprintf(NULL, &is_trunc, buf, 0, "%i", 543); - ck_assert_str_eq(buf, "1234567890"); -} -END_TEST - - -START_TEST(test_mg_strcasestr) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - static const char *big1 = "abcdef"; - ck_assert(mg_strcasestr("Y", "X") == NULL); - ck_assert(mg_strcasestr("Y", "y") != NULL); - ck_assert(mg_strcasestr(big1, "X") == NULL); - ck_assert(mg_strcasestr(big1, "CD") == big1 + 2); - ck_assert(mg_strcasestr("aa", "AAB") == NULL); -} -END_TEST - - -START_TEST(test_parse_port_string) -{ - /* Adapted from unit_test.c */ - /* Copyright (c) 2013-2015 the Civetweb developers */ - /* Copyright (c) 2004-2013 Sergey Lyubka */ - static const char *valid[] = - { "0", - "1", - "1s", - "1r", - "1.2.3.4:1", - "1.2.3.4:1s", - "1.2.3.4:1r", -#if defined(USE_IPV6) - "[::1]:123", - "[::]:80", - "[3ffe:2a00:100:7031::1]:900", - "+80", -#endif - NULL }; - static const char *invalid[] = { - "99999", "1k", "1.2.3", "1.2.3.4:", "1.2.3.4:2p", NULL}; - struct socket so; - struct vec vec; - int ip_family; - int i; - - for (i = 0; valid[i] != NULL; i++) { - vec.ptr = valid[i]; - vec.len = strlen(vec.ptr); - ip_family = 123; - ck_assert_int_ne(parse_port_string(&vec, &so, &ip_family), 0); - if (i < 7) { - ck_assert_int_eq(ip_family, 4); - } else if (i < 10) { - ck_assert_int_eq(ip_family, 6); - } else { - ck_assert_int_eq(ip_family, 4 + 6); - } - } - - for (i = 0; invalid[i] != NULL; i++) { - vec.ptr = invalid[i]; - vec.len = strlen(vec.ptr); - ip_family = 123; - ck_assert_int_eq(parse_port_string(&vec, &so, &ip_family), 0); - ck_assert_int_eq(ip_family, 0); - } -} -END_TEST - - -START_TEST(test_encode_decode) -{ - char buf[128]; - const char *alpha = "abcdefghijklmnopqrstuvwxyz"; - const char *nonalpha = " !\"#$%&'()*+,-./0123456789:;<=>?@"; - const char *nonalpha_url_enc1 = - "%20%21%22%23$%25%26%27()%2a%2b,-.%2f0123456789%3a;%3c%3d%3e%3f%40"; - const char *nonalpha_url_enc2 = - "%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40"; - int ret; - size_t len; - -#if defined(USE_WEBSOCKET) || defined(USE_LUA) - const char *alpha_b64_enc = "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="; - const char *nonalpha_b64_enc = - "ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9A"; - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)"a", 1, buf); - ck_assert_str_eq(buf, "YQ=="); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)"ab", 1, buf); - ck_assert_str_eq(buf, "YQ=="); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)"ab", 2, buf); - ck_assert_str_eq(buf, "YWI="); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)alpha, 3, buf); - ck_assert_str_eq(buf, "YWJj"); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)alpha, 4, buf); - ck_assert_str_eq(buf, "YWJjZA=="); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)alpha, 5, buf); - ck_assert_str_eq(buf, "YWJjZGU="); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)alpha, 6, buf); - ck_assert_str_eq(buf, "YWJjZGVm"); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)alpha, (int)strlen(alpha), buf); - ck_assert_str_eq(buf, alpha_b64_enc); - - memset(buf, 77, sizeof(buf)); - base64_encode((unsigned char *)nonalpha, (int)strlen(nonalpha), buf); - ck_assert_str_eq(buf, nonalpha_b64_enc); -#endif - -#if defined(USE_LUA) - memset(buf, 77, sizeof(buf)); - len = 9999; - ret = base64_decode((unsigned char *)alpha_b64_enc, - (int)strlen(alpha_b64_enc), - buf, - &len); - ck_assert_int_eq(ret, -1); - ck_assert_uint_eq((unsigned int)len, (unsigned int)strlen(alpha)); - ck_assert_str_eq(buf, alpha); - - memset(buf, 77, sizeof(buf)); - len = 9999; - ret = base64_decode((unsigned char *)"AAA*AAA", 7, buf, &len); - ck_assert_int_eq(ret, 3); -#endif - - memset(buf, 77, sizeof(buf)); - ret = mg_url_encode(alpha, buf, sizeof(buf)); - ck_assert_int_eq(ret, (int)strlen(buf)); - ck_assert_int_eq(ret, (int)strlen(alpha)); - ck_assert_str_eq(buf, alpha); - - memset(buf, 77, sizeof(buf)); - ret = mg_url_encode(nonalpha, buf, sizeof(buf)); - ck_assert_int_eq(ret, (int)strlen(buf)); - ck_assert_int_eq(ret, (int)strlen(nonalpha_url_enc1)); - ck_assert_str_eq(buf, nonalpha_url_enc1); - - memset(buf, 77, sizeof(buf)); - ret = mg_url_decode(alpha, (int)strlen(alpha), buf, sizeof(buf), 0); - ck_assert_int_eq(ret, (int)strlen(buf)); - ck_assert_int_eq(ret, (int)strlen(alpha)); - ck_assert_str_eq(buf, alpha); - - memset(buf, 77, sizeof(buf)); - ret = mg_url_decode( - nonalpha_url_enc1, (int)strlen(nonalpha_url_enc1), buf, sizeof(buf), 0); - ck_assert_int_eq(ret, (int)strlen(buf)); - ck_assert_int_eq(ret, (int)strlen(nonalpha)); - ck_assert_str_eq(buf, nonalpha); - - memset(buf, 77, sizeof(buf)); - ret = mg_url_decode( - nonalpha_url_enc2, (int)strlen(nonalpha_url_enc2), buf, sizeof(buf), 0); - ck_assert_int_eq(ret, (int)strlen(buf)); - ck_assert_int_eq(ret, (int)strlen(nonalpha)); - ck_assert_str_eq(buf, nonalpha); - - /* len could be unused, if base64_decode is not tested because USE_LUA is - * not defined */ - (void)len; -} -END_TEST - - -START_TEST(test_mask_data) -{ -#if defined(USE_WEBSOCKET) - char in[1024]; - char out[1024]; - int i; -#endif - - uint32_t mask = 0x61626364; - /* TODO: adapt test for big endian */ - ck_assert((*(unsigned char *)&mask) == 0x64u); - -#if defined(USE_WEBSOCKET) - memset(in, 0, sizeof(in)); - memset(out, 99, sizeof(out)); - - mask_data(in, sizeof(out), 0, out); - ck_assert(!memcmp(out, in, sizeof(out))); - - for (i = 0; i < 1024; i++) { - in[i] = (char)((unsigned char)i); - } - mask_data(in, 107, 0, out); - ck_assert(!memcmp(out, in, 107)); - - mask_data(in, 256, 0x01010101, out); - for (i = 0; i < 256; i++) { - ck_assert_int_eq((int)((unsigned char)out[i]), - (int)(((unsigned char)in[i]) ^ (char)1u)); - } - for (i = 256; i < (int)sizeof(out); i++) { - ck_assert_int_eq((int)((unsigned char)out[i]), (int)0); - } - - /* TODO: check this for big endian */ - mask_data(in, 5, 0x01020304, out); - ck_assert_uint_eq((unsigned char)out[0], 0u ^ 4u); - ck_assert_uint_eq((unsigned char)out[1], 1u ^ 3u); - ck_assert_uint_eq((unsigned char)out[2], 2u ^ 2u); - ck_assert_uint_eq((unsigned char)out[3], 3u ^ 1u); - ck_assert_uint_eq((unsigned char)out[4], 4u ^ 4u); -#endif -} -END_TEST - - -START_TEST(test_parse_date_string) -{ -#if !defined(NO_CACHING) - time_t now = time(0); - struct tm *tm = gmtime(&now); - char date[64] = {0}; - unsigned long i; - - ck_assert_uint_eq((unsigned long)parse_date_string("1/Jan/1970 00:01:02"), - 62ul); - ck_assert_uint_eq((unsigned long)parse_date_string("1 Jan 1970 00:02:03"), - 123ul); - ck_assert_uint_eq((unsigned long)parse_date_string("1-Jan-1970 00:03:04"), - 184ul); - ck_assert_uint_eq((unsigned long)parse_date_string( - "Xyz, 1 Jan 1970 00:04:05"), - 245ul); - - gmt_time_string(date, sizeof(date), &now); - ck_assert_uint_eq((uintmax_t)parse_date_string(date), (uintmax_t)now); - - sprintf(date, - "%02u %s %04u %02u:%02u:%02u", - tm->tm_mday, - month_names[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - ck_assert_uint_eq((uintmax_t)parse_date_string(date), (uintmax_t)now); - - gmt_time_string(date, 1, NULL); - ck_assert_str_eq(date, ""); - gmt_time_string(date, 6, NULL); - ck_assert_str_eq(date, - "Thu, "); /* part of "Thu, 01 Jan 1970 00:00:00 GMT" */ - gmt_time_string(date, sizeof(date), NULL); - ck_assert_str_eq(date, "Thu, 01 Jan 1970 00:00:00 GMT"); - - for (i = 2ul; i < 0x8000000ul; i += i / 2) { - now = (time_t)i; - - gmt_time_string(date, sizeof(date), &now); - ck_assert_uint_eq((uintmax_t)parse_date_string(date), (uintmax_t)now); - - tm = gmtime(&now); - sprintf(date, - "%02u-%s-%04u %02u:%02u:%02u", - tm->tm_mday, - month_names[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - ck_assert_uint_eq((uintmax_t)parse_date_string(date), (uintmax_t)now); - } -#endif -} -END_TEST - - -START_TEST(test_sha1) -{ -#ifdef SHA1_DIGEST_SIZE - SHA1_CTX sha_ctx; - uint8_t digest[SHA1_DIGEST_SIZE] = {0}; - char str[48] = {0}; - int i; - const char *test_str; - - ck_assert_uint_eq(sizeof(digest), 20); - ck_assert_uint_gt(sizeof(str), sizeof(digest) * 2 + 1); - - /* empty string */ - SHA1_Init(&sha_ctx); - SHA1_Final(&sha_ctx, digest); - bin2str(str, digest, sizeof(digest)); - ck_assert_uint_eq(strlen(str), 40); - ck_assert_str_eq(str, "da39a3ee5e6b4b0d3255bfef95601890afd80709"); - - /* empty string */ - SHA1_Init(&sha_ctx); - SHA1_Update(&sha_ctx, (uint8_t *)"abc", 0); - SHA1_Final(&sha_ctx, digest); - bin2str(str, digest, sizeof(digest)); - ck_assert_uint_eq(strlen(str), 40); - ck_assert_str_eq(str, "da39a3ee5e6b4b0d3255bfef95601890afd80709"); - - /* "abc" */ - SHA1_Init(&sha_ctx); - SHA1_Update(&sha_ctx, (uint8_t *)"abc", 3); - SHA1_Final(&sha_ctx, digest); - bin2str(str, digest, sizeof(digest)); - ck_assert_uint_eq(strlen(str), 40); - ck_assert_str_eq(str, "a9993e364706816aba3e25717850c26c9cd0d89d"); - - /* "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" */ - test_str = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; - SHA1_Init(&sha_ctx); - SHA1_Update(&sha_ctx, (uint8_t *)test_str, (uint32_t)strlen(test_str)); - SHA1_Final(&sha_ctx, digest); - bin2str(str, digest, sizeof(digest)); - ck_assert_uint_eq(strlen(str), 40); - ck_assert_str_eq(str, "84983e441c3bd26ebaae4aa1f95129e5e54670f1"); - - /* a million "a" */ - SHA1_Init(&sha_ctx); - for (i = 0; i < 1000000; i++) { - SHA1_Update(&sha_ctx, (uint8_t *)"a", 1); - } - SHA1_Final(&sha_ctx, digest); - bin2str(str, digest, sizeof(digest)); - ck_assert_uint_eq(strlen(str), 40); - ck_assert_str_eq(str, "34aa973cd4c4daa4f61eeb2bdbad27316534016f"); - - /* a million "a" in blocks of 10 */ - SHA1_Init(&sha_ctx); - for (i = 0; i < 100000; i++) { - SHA1_Update(&sha_ctx, (uint8_t *)"aaaaaaaaaa", 10); - } - SHA1_Final(&sha_ctx, digest); - bin2str(str, digest, sizeof(digest)); - ck_assert_uint_eq(strlen(str), 40); - ck_assert_str_eq(str, "34aa973cd4c4daa4f61eeb2bdbad27316534016f"); -#else - /* Can not test, if SHA1 is not included */ - ck_assert(1); -#endif -} -END_TEST - - -Suite * -make_private_suite(void) -{ - Suite *const suite = suite_create("Private"); - - TCase *const tcase_http_message = tcase_create("HTTP Message"); - TCase *const tcase_url_parsing = tcase_create("URL Parsing"); - TCase *const tcase_internal_parse = tcase_create("Internal Parsing"); - TCase *const tcase_encode_decode = tcase_create("Encode Decode"); - TCase *const tcase_mask_data = tcase_create("Mask Data"); - TCase *const tcase_parse_date_string = tcase_create("Date Parsing"); - TCase *const tcase_sha1 = tcase_create("SHA1"); - - tcase_add_test(tcase_http_message, test_parse_http_message); - tcase_add_test(tcase_http_message, test_should_keep_alive); - tcase_set_timeout(tcase_http_message, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_http_message); - - tcase_add_test(tcase_url_parsing, test_match_prefix); - tcase_add_test(tcase_url_parsing, - test_remove_double_dots_and_double_slashes); - tcase_add_test(tcase_url_parsing, test_is_valid_uri); - tcase_set_timeout(tcase_url_parsing, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_url_parsing); - - tcase_add_test(tcase_internal_parse, test_next_option); - tcase_add_test(tcase_internal_parse, test_skip_quoted); - tcase_add_test(tcase_internal_parse, test_mg_strcasestr); - tcase_add_test(tcase_internal_parse, test_alloc_vprintf); - tcase_add_test(tcase_internal_parse, test_mg_vsnprintf); - tcase_add_test(tcase_internal_parse, test_parse_port_string); - tcase_set_timeout(tcase_internal_parse, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_internal_parse); - - tcase_add_test(tcase_encode_decode, test_encode_decode); - tcase_set_timeout(tcase_encode_decode, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_encode_decode); - - tcase_add_test(tcase_mask_data, test_mask_data); - tcase_set_timeout(tcase_mask_data, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_mask_data); - - tcase_add_test(tcase_parse_date_string, test_parse_date_string); - tcase_set_timeout(tcase_parse_date_string, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_parse_date_string); - - tcase_add_test(tcase_sha1, test_sha1); - tcase_set_timeout(tcase_sha1, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_sha1); - - return suite; -} - - -#ifdef REPLACE_CHECK_FOR_LOCAL_DEBUGGING -/* Used to debug test cases without using the check framework */ - -void -MAIN_PRIVATE(void) -{ -#if defined(_WIN32) - /* test_parse_port_string requires WSAStartup for IPv6 */ - WSADATA data; - WSAStartup(MAKEWORD(2, 2), &data); -#endif - - test_alloc_vprintf(0); - test_mg_vsnprintf(0); - test_remove_double_dots_and_double_slashes(0); - test_parse_date_string(0); - test_parse_port_string(0); - test_parse_http_message(0); - test_sha1(0); - -#if defined(_WIN32) - WSACleanup(); -#endif -} - -#endif http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/private.h ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/private.h b/thirdparty/civetweb-1.9.1/test/private.h deleted file mode 100644 index 670b665..0000000 --- a/thirdparty/civetweb-1.9.1/test/private.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2015-2017 the Civetweb developers - * - * 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. - */ -#ifndef TEST_PRIVATE_H_ -#define TEST_PRIVATE_H_ - -#include "civetweb_check.h" - -Suite *make_private_suite(void); - -#endif /* TEST_PRIVATE_H_ */ http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/private_exe.c ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/private_exe.c b/thirdparty/civetweb-1.9.1/test/private_exe.c deleted file mode 100644 index a23b11c..0000000 --- a/thirdparty/civetweb-1.9.1/test/private_exe.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (c) 2015-2017 the Civetweb developers - * - * 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. - */ - -/** - * We include the source file so that we have access to the internal private - * static functions. - */ -#ifdef _MSC_VER -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS -#endif -#endif - -#include "private_exe.h" - -/* This is required for "realpath". According to - * http://man7.org/linux/man-pages/man3/realpath.3.html - * defining _XOPEN_SOURCE 600 should be enough, but in - * practice this does not work. */ -extern char *realpath(const char *path, char *resolved_path); - -/* main is already used in the test suite, - * so this define will rename main in main.c */ -#define main exe_main - -#include "../src/main.c" - -#include <stdlib.h> - -/* This unit test file uses the excellent Check unit testing library. - * The API documentation is available here: - * http://check.sourceforge.net/doc/check_html/index.html - */ - -START_TEST(test_helper_funcs) -{ - const char *psrc = "test str"; - char *pdst; - - /* test sdup */ - pdst = sdup(psrc); - ck_assert(pdst != NULL); - ck_assert_str_eq(pdst, psrc); - ck_assert_ptr_ne(pdst, psrc); - free(pdst); -} -END_TEST - -Suite * -make_private_exe_suite(void) -{ - Suite *const suite = suite_create("EXE"); - - TCase *const tcase_helper_funcs = tcase_create("Helper funcs"); - - tcase_add_test(tcase_helper_funcs, test_helper_funcs); - tcase_set_timeout(tcase_helper_funcs, civetweb_min_test_timeout); - suite_add_tcase(suite, tcase_helper_funcs); - - return suite; -} http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c1101f46/thirdparty/civetweb-1.9.1/test/private_exe.h ---------------------------------------------------------------------- diff --git a/thirdparty/civetweb-1.9.1/test/private_exe.h b/thirdparty/civetweb-1.9.1/test/private_exe.h deleted file mode 100644 index 5e8e9bf..0000000 --- a/thirdparty/civetweb-1.9.1/test/private_exe.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) 2015-2017 the Civetweb developers - * - * 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. - */ -#ifndef TEST_PRIVATE_EXE_H_ -#define TEST_PRIVATE_EXE_H_ - -#include "civetweb_check.h" - -Suite *make_private_exe_suite(void); - -/* This is a redefine for "main" in main.c */ -int exe_main(int argc, char *argv[]); - -#endif /* TEST_PRIVATE_H_ */
