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-04-03 20:08:07 +0300
committerjpadkins <jacobpadkins@gmail.com>2017-04-03 20:08:07 +0300
commit5a438a9d0a7a0f58a827184af64bd1cfabc8b7c1 (patch)
tree9a1be610914fae50ffa5a4abc6f54316aac6ca16 /check/magma/servers/http/http_check_network.c
parent629c94ff079176dd7f124e2ba519b72ce1ca6361 (diff)
parentf1bb314aba2d5c0f51e6c299c370d8e8b434181f (diff)
Merge branch 'develop' of https://github.com/lavabit/magma into feature/more-camel-tests
Diffstat (limited to 'check/magma/servers/http/http_check_network.c')
-rw-r--r--check/magma/servers/http/http_check_network.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/check/magma/servers/http/http_check_network.c b/check/magma/servers/http/http_check_network.c
index b4928eb0..5675d664 100644
--- a/check/magma/servers/http/http_check_network.c
+++ b/check/magma/servers/http/http_check_network.c
@@ -111,31 +111,26 @@ bool_t check_http_network_basic_sthread(stringer_t *errmsg, uint32_t port, bool_
client_t *client = NULL;
// Test the connection.
- if (!(client = client_connect("localhost", port)) || (secure && (client_secure(client) == -1)) ||
- client_status(client) != 1) {
-
+ if (!(client = client_connect("localhost", port)) || (secure && (client_secure(client) == -1)) || client_status(client) != 1) {
st_sprint(errmsg, "Failed to connect with the HTTP server.");
client_close(client);
return false;
}
// Test submitting a GET request.
- else if (client_write(client, PLACER("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n", 35)) != 35 || client_status(client) != 1 ||
- !(content_length = check_http_content_length_get(client, errmsg))) {
-
+ else if (client_write(client, PLACER("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n", 35)) != 35 ||
+ client_status(client) != 1 || !(content_length = check_http_content_length_get(client, errmsg))) {
if (st_empty(errmsg)) st_sprint(errmsg, "Failed to return a valid GET response.");
client_close(client);
return false;
}
// Test the response.
else if (check_http_content_length_test(client, content_length, errmsg)) {
-
if (st_empty(errmsg)) st_sprint(errmsg, "The content length and actual body length of the GET response did not match.");
client_close(client);
return false;
}
client_close(client);
-
return true;
}
@@ -153,17 +148,14 @@ bool_t check_http_network_options_sthread(stringer_t *errmsg, uint32_t port, boo
};
// Test the connection.
- if (!(client = client_connect("localhost", port)) || (secure && (client_secure(client) == -1)) ||
- client_status(client) != 1) {
-
+ if (!(client = client_connect("localhost", port)) || (secure && (client_secure(client) == -1)) || client_status(client) != 1) {
st_sprint(errmsg, "Failed to connect with the HTTP server.");
client_close(client);
return false;
}
- // Test OPTIONS
- else if (client_write(client, PLACER("OPTIONS /portal/camel HTTP/1.1\r\n\r\n", 34)) != 34 || client_status(client) != 1 ||
- !check_http_options(client, options, errmsg)) {
-
+ // Test OPTIONS.
+ else if (client_write(client, PLACER("OPTIONS /portal/camel HTTP/1.1\r\n\r\n", 34)) != 34 ||
+ client_status(client) != 1 || !check_http_options(client, options, errmsg)) {
client_close(client);
return false;
}