Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lavabit/magma.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjpadkins <jacobpadkins@gmail.com>2017-03-22 21:08:00 +0300
committerjpadkins <jacobpadkins@gmail.com>2017-03-22 21:08:00 +0300
commit7f7a85f1b5fd957fb9fd884328ea09bd4d151834 (patch)
treef4b850a3a27183212518cd954aad6c67893df1e3
parentf29465b02df9d9cee3d2344bdc312fde113c70ce (diff)
Fixed the HTTP tests
-rw-r--r--check/magma/servers/http/http_check_network.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/check/magma/servers/http/http_check_network.c b/check/magma/servers/http/http_check_network.c
index 67f393d7..bb996427 100644
--- a/check/magma/servers/http/http_check_network.c
+++ b/check/magma/servers/http/http_check_network.c
@@ -66,18 +66,10 @@ bool_t check_http_content_length_test(client_t *client, uint32_t content_length,
uint32_t total = 0;
- if (!check_http_read_to_empty(client)) {
- st_sprint(errmsg, "Failed to read to first empty line.");
- }
-
while (total < content_length) {
total += client_read_line(client);
}
- if (!check_http_read_to_empty(client)) {
- st_sprint(errmsg, "Failed to read to last empty line.");
- }
-
return (total == content_length);
}
@@ -96,13 +88,14 @@ bool_t check_http_network_basic_sthread(stringer_t *errmsg, uint32_t port, bool_
}
// Test submitting a GET request.
else if (client_print(client, "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n") != 35 || client_status(client) != 1 ||
- (content_length = check_http_content_length_get(client, errmsg))) {
+ !(content_length = check_http_content_length_get(client, errmsg))) {
if (!errmsg) st_sprint(errmsg, "Failed to return a valid GET response.");
return false;
}
// Test the response.
else if (check_http_content_length_test(client, content_length, errmsg)) {
+ if (!errmsg) st_sprint(errmsg, "The content length and actual body length of the GET response did not match.");
return false;
}