diff options
author | Ladar Levison <ladar@lavabit.com> | 2017-04-15 04:32:47 +0300 |
---|---|---|
committer | Ladar Levison <ladar@lavabit.com> | 2017-04-15 04:32:47 +0300 |
commit | 93c0d486026769abe3a82140130b932b307771bb (patch) | |
tree | 6a686d374f249366cfa7cce49f4d005f989bda39 /check | |
parent | 4afb6a2a1edca154812ccb9d26c3fa411515fb6c (diff) |
Minor code cleanup, and a magma detection in bash fix.
Diffstat (limited to 'check')
-rw-r--r-- | check/magma/servers/camel/camel_check.c | 7 | ||||
-rw-r--r-- | check/magma/servers/camel/camel_check_network.c | 6 | ||||
-rw-r--r-- | check/magma/servers/http/http_check_network.c | 3 |
3 files changed, 8 insertions, 8 deletions
diff --git a/check/magma/servers/camel/camel_check.c b/check/magma/servers/camel/camel_check.c index 6dd5254a..01677fec 100644 --- a/check/magma/servers/camel/camel_check.c +++ b/check/magma/servers/camel/camel_check.c @@ -6,8 +6,6 @@ #include "magma_check.h" -// LOW: Refactor for both HTTP and HTTPS. - START_TEST (check_camel_auth_s) { log_disable(); @@ -29,6 +27,7 @@ START_TEST (check_camel_basic_s) { stringer_t *errmsg = MANAGEDBUF(1024); if (status() && !check_camel_basic_sthread(false, errmsg)) outcome = false; + else if (status() && outcome && !check_camel_basic_sthread(true, errmsg)) outcome = false; log_test("HTTP / NETWORK / CAMEL / BASIC / SINGLE THREADED:", errmsg); ck_assert_msg(outcome, st_char_get(errmsg)); @@ -39,8 +38,8 @@ Suite * suite_check_camel(void) { Suite *s = suite_create("\tCAMEL"); - suite_check_testcase(s, "CAMEL", "HTTP Network Camel Auth/S", check_camel_auth_s); - suite_check_testcase(s, "CAMEL", "HTTP Network Camel Basic/S", check_camel_basic_s); + suite_check_testcase(s, "HTTP CAMEL", "HTTP Network Camel Auth/S", check_camel_auth_s); + suite_check_testcase(s, "HTTP CAMEL", "HTTP Network Camel Basic/S", check_camel_basic_s); return s; } diff --git a/check/magma/servers/camel/camel_check_network.c b/check/magma/servers/camel/camel_check_network.c index 047f4e76..108039f9 100644 --- a/check/magma/servers/camel/camel_check_network.c +++ b/check/magma/servers/camel/camel_check_network.c @@ -436,9 +436,9 @@ bool_t check_camel_basic_sthread(bool_t secure, stringer_t *errmsg) { } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Test config.edit : commands[0] - // JSON Command : {"id":2,"method":"config.edit","params":{<rand_strs[0]>:<rand_strs[1]>}}" - // Expected Response : {"jsonrpc":"2.0","result":{"config.edit":"success"},"id":2} + /// Test config.edit : commands[0] /// + /// JSON Command : {"id":2,"method":"config.edit","params":{<rand_strs[0]>:<rand_strs[1]>}}" /// + /// Expected Response : {"jsonrpc":"2.0","result":{"config.edit":"success"},"id":2} /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Generate the random inputs for "key" and "value". diff --git a/check/magma/servers/http/http_check_network.c b/check/magma/servers/http/http_check_network.c index 5d823c4f..a6f56107 100644 --- a/check/magma/servers/http/http_check_network.c +++ b/check/magma/servers/http/http_check_network.c @@ -35,8 +35,9 @@ size_t check_http_content_length_get(client_t *client) { placer_t cl_placer = pl_null(); size_t location = 0, content_length = 0; + /// HIGH: This logic is wrong. while (st_cmp_ci_starts(&(client->line), NULLER("Content-Length:")) != 0) { - if (client_read_line(client) <= 2) return content_length; + if (client_read_line(client) <= 2) return 0; } if (!st_search_chr(&(client->line), ' ', &location)) { |