aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Uzunov <andrey.uzunov@gmail.com>2013-09-19 09:52:52 +0000
committerAndrey Uzunov <andrey.uzunov@gmail.com>2013-09-19 09:52:52 +0000
commitf5d96db320aed70f77e29cf9551a76c7cafd649e (patch)
treeefe90b9065510b0175db3e67363c6a196b3749e1
parent89bdb4449fb859c6bd4d1b73f9f0c5992c8f41ad (diff)
downloadlibmicrohttpd-f5d96db320aed70f77e29cf9551a76c7cafd649e.tar.gz
libmicrohttpd-f5d96db320aed70f77e29cf9551a76c7cafd649e.zip
testspdy fixes
-rw-r--r--src/Makefile.am4
-rw-r--r--src/testspdy/Makefile.am19
-rw-r--r--src/testspdy/test_notls.c6
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
12if HAVE_CURL 12if HAVE_CURL
13microspdy += spdy2http 13microspdy += spdy2http
14endif 14endif
15if HAVE_SPDYLAY 15#if HAVE_SPDYLAY
16microspdy += testspdy 16microspdy += testspdy
17endif 17#endif
18endif 18endif
19endif 19endif
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
21PERF_GET_CONCURRENT=perf_get_concurrent 21PERF_GET_CONCURRENT=perf_get_concurrent
22endif 22endif
23 23
24if HAVE_SPDYLAY
25 SPDYLAY_CHECKS = test_new_connection test_request_response test_notls
26endif
27 24
28check_PROGRAMS = \ 25check_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
30if 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
39endif
40
37 41
38TESTS = $(check_PROGRAMS) 42TESTS = $(check_PROGRAMS)
39 43
@@ -81,7 +85,6 @@ test_notls_SOURCES = \
81 $(SPDY_SOURCES) 85 $(SPDY_SOURCES)
82test_notls_LDADD = $(SPDY_LDADD) \ 86test_notls_LDADD = $(SPDY_LDADD) \
83 -lspdylay 87 -lspdylay
84endif
85 88
86test_request_response_with_callback_SOURCES = \ 89test_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)
113test_proxies_LDADD = $(SPDY_LDADD) 116test_proxies_LDADD = $(SPDY_LDADD)
114endif 117endif
118
119endif
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");