summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristopher Davis <chrisd@torproject.org>2010-11-29 18:25:04 -0800
committerChristopher Davis <chrisd@torproject.org>2010-11-29 18:25:04 -0800
commitfa9305f8f5a9641bf7edf7577b186455b6c43ac6 (patch)
treec1c4b03fc6a4f3d96aa12420cd9565c6bc555383 /test
parenta12839b0838cb6b24f6993b17b2a284a3944d1c5 (diff)
downloadlibevent-fa9305f8f5a9641bf7edf7577b186455b6c43ac6.tar.gz
Preliminary support for Continue expectation in evhttp.
Diffstat (limited to 'test')
-rw-r--r--test/regress_http.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/regress_http.c b/test/regress_http.c
index f959b832..0d8395bc 100644
--- a/test/regress_http.c
+++ b/test/regress_http.c
@@ -1503,10 +1503,31 @@ http_post_test(void *arg)
event_base_dispatch(data->base);
+ tt_int_op(test_ok, ==, 1);
+
+ test_ok = 0;
+
+ req = evhttp_request_new(http_postrequest_done, data->base);
+ tt_assert(req);
+
+ /* Now try with 100-continue. */
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), POST_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
evhttp_connection_free(evcon);
evhttp_free(http);
- tt_int_op(test_ok, ==, 1);
end:
;
}