diff options
author | Andrey Uzunov <andrey.uzunov@gmail.com> | 2013-09-19 09:52:52 +0000 |
---|---|---|
committer | Andrey Uzunov <andrey.uzunov@gmail.com> | 2013-09-19 09:52:52 +0000 |
commit | f5d96db320aed70f77e29cf9551a76c7cafd649e (patch) | |
tree | efe90b9065510b0175db3e67363c6a196b3749e1 | |
parent | 89bdb4449fb859c6bd4d1b73f9f0c5992c8f41ad (diff) | |
download | libmicrohttpd-f5d96db320aed70f77e29cf9551a76c7cafd649e.tar.gz libmicrohttpd-f5d96db320aed70f77e29cf9551a76c7cafd649e.zip |
testspdy fixes
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/testspdy/Makefile.am | 19 | ||||
-rw-r--r-- | src/testspdy/test_notls.c | 6 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 2948d440..6916b6cf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -12,9 +12,9 @@ microspdy = microspdy | |||
12 | if HAVE_CURL | 12 | if HAVE_CURL |
13 | microspdy += spdy2http | 13 | microspdy += spdy2http |
14 | endif | 14 | endif |
15 | if HAVE_SPDYLAY | 15 | #if HAVE_SPDYLAY |
16 | microspdy += testspdy | 16 | microspdy += testspdy |
17 | endif | 17 | #endif |
18 | endif | 18 | endif |
19 | endif | 19 | endif |
20 | 20 | ||
diff --git a/src/testspdy/Makefile.am b/src/testspdy/Makefile.am index cbad3389..cedf37a1 100644 --- a/src/testspdy/Makefile.am +++ b/src/testspdy/Makefile.am | |||
@@ -21,19 +21,23 @@ if !HAVE_W32 | |||
21 | PERF_GET_CONCURRENT=perf_get_concurrent | 21 | PERF_GET_CONCURRENT=perf_get_concurrent |
22 | endif | 22 | endif |
23 | 23 | ||
24 | if HAVE_SPDYLAY | ||
25 | SPDYLAY_CHECKS = test_new_connection test_request_response test_notls | ||
26 | endif | ||
27 | 24 | ||
28 | check_PROGRAMS = \ | 25 | check_PROGRAMS = \ |
29 | test_daemon_start_stop \ | 26 | test_daemon_start_stop \ |
30 | test_daemon_start_stop_many \ | 27 | test_daemon_start_stop_many \ |
31 | test_struct_namevalue \ | 28 | test_struct_namevalue |
29 | |||
30 | if HAVE_SPDYLAY | ||
31 | check_PROGRAMS += \ | ||
32 | test_new_connection \ | ||
33 | test_request_response \ | ||
34 | test_notls \ | ||
32 | test_request_response_with_callback \ | 35 | test_request_response_with_callback \ |
33 | $(SPDYLAY_CHECKS) | ||
34 | #test_requests_with_assets \ | ||
35 | test_misc \ | 36 | test_misc \ |
36 | test_session_timeout | 37 | test_session_timeout |
38 | #test_requests_with_assets | ||
39 | endif | ||
40 | |||
37 | 41 | ||
38 | TESTS = $(check_PROGRAMS) | 42 | TESTS = $(check_PROGRAMS) |
39 | 43 | ||
@@ -81,7 +85,6 @@ test_notls_SOURCES = \ | |||
81 | $(SPDY_SOURCES) | 85 | $(SPDY_SOURCES) |
82 | test_notls_LDADD = $(SPDY_LDADD) \ | 86 | test_notls_LDADD = $(SPDY_LDADD) \ |
83 | -lspdylay | 87 | -lspdylay |
84 | endif | ||
85 | 88 | ||
86 | test_request_response_with_callback_SOURCES = \ | 89 | test_request_response_with_callback_SOURCES = \ |
87 | test_request_response_with_callback.c \ | 90 | test_request_response_with_callback.c \ |
@@ -112,3 +115,5 @@ test_proxies_SOURCES = \ | |||
112 | $(SPDY_SOURCES) | 115 | $(SPDY_SOURCES) |
113 | test_proxies_LDADD = $(SPDY_LDADD) | 116 | test_proxies_LDADD = $(SPDY_LDADD) |
114 | endif | 117 | endif |
118 | |||
119 | endif | ||
diff --git a/src/testspdy/test_notls.c b/src/testspdy/test_notls.c index 566f0a74..69a6c8db 100644 --- a/src/testspdy/test_notls.c +++ b/src/testspdy/test_notls.c | |||
@@ -488,6 +488,7 @@ static int connect_to(const char *host, uint16_t port) | |||
488 | } | 488 | } |
489 | close(fd); | 489 | close(fd); |
490 | fd = -1; | 490 | fd = -1; |
491 | dief("connect", strerror(errno)); | ||
491 | } | 492 | } |
492 | freeaddrinfo(res); | 493 | freeaddrinfo(res); |
493 | return fd; | 494 | return fd; |
@@ -498,11 +499,11 @@ static void make_non_block(int fd) | |||
498 | int flags, rv; | 499 | int flags, rv; |
499 | while((flags = fcntl(fd, F_GETFL, 0)) == -1 && errno == EINTR); | 500 | while((flags = fcntl(fd, F_GETFL, 0)) == -1 && errno == EINTR); |
500 | if(flags == -1) { | 501 | if(flags == -1) { |
501 | dief("fcntl", strerror(errno)); | 502 | dief("fcntl1", strerror(errno)); |
502 | } | 503 | } |
503 | while((rv = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1 && errno == EINTR); | 504 | while((rv = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1 && errno == EINTR); |
504 | if(rv == -1) { | 505 | if(rv == -1) { |
505 | dief("fcntl", strerror(errno)); | 506 | dief("fcntl2", strerror(errno)); |
506 | } | 507 | } |
507 | } | 508 | } |
508 | 509 | ||
@@ -843,6 +844,7 @@ childproc(int port) | |||
843 | act.sa_handler = SIG_IGN; | 844 | act.sa_handler = SIG_IGN; |
844 | sigaction(SIGPIPE, &act, 0); | 845 | sigaction(SIGPIPE, &act, 0); |
845 | 846 | ||
847 | usleep(10000); | ||
846 | asprintf(&uristr, "https://127.0.0.1:%i/",port); | 848 | asprintf(&uristr, "https://127.0.0.1:%i/",port); |
847 | if(NULL == (rcvbuf = malloc(strlen(RESPONSE_BODY)+1))) | 849 | if(NULL == (rcvbuf = malloc(strlen(RESPONSE_BODY)+1))) |
848 | killparent(parent,"no memory"); | 850 | killparent(parent,"no memory"); |