diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-27 14:41:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-27 14:41:35 +0000 |
commit | fe8202d39c32032b68a7a6760651c843b2e3e16d (patch) | |
tree | cc92301b6c92767d65912c24d5b9accb4361efc1 /src/examples/spdy_event_loop.c | |
parent | 79f2eea2629367ca402671cf7d033e52de0f9e8a (diff) | |
download | libmicrohttpd-fe8202d39c32032b68a7a6760651c843b2e3e16d.tar.gz libmicrohttpd-fe8202d39c32032b68a7a6760651c843b2e3e16d.zip |
-fixing misc minor bugs and compiler warnings in libmicrospdy
Diffstat (limited to 'src/examples/spdy_event_loop.c')
-rw-r--r-- | src/examples/spdy_event_loop.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/examples/spdy_event_loop.c b/src/examples/spdy_event_loop.c index e5bac293..a716028f 100644 --- a/src/examples/spdy_event_loop.c +++ b/src/examples/spdy_event_loop.c | |||
@@ -41,15 +41,17 @@ | |||
41 | //#include "../framinglayer/structures.h" | 41 | //#include "../framinglayer/structures.h" |
42 | //#include "../applicationlayer/alstructures.h" | 42 | //#include "../applicationlayer/alstructures.h" |
43 | 43 | ||
44 | int run = 1; | 44 | static int run = 1; |
45 | int run2 = 1; | 45 | |
46 | static int run2 = 1; | ||
46 | 47 | ||
47 | 48 | ||
48 | uint64_t loops; | 49 | static uint64_t loops; |
49 | time_t start; | ||
50 | 50 | ||
51 | static time_t start; | ||
51 | 52 | ||
52 | void | 53 | |
54 | static void | ||
53 | new_session_callback (void *cls, | 55 | new_session_callback (void *cls, |
54 | struct SPDY_Session * session) | 56 | struct SPDY_Session * session) |
55 | { | 57 | { |
@@ -88,7 +90,8 @@ new_session_callback (void *cls, | |||
88 | } | 90 | } |
89 | } | 91 | } |
90 | 92 | ||
91 | void | 93 | |
94 | static void | ||
92 | session_closed_handler (void *cls, | 95 | session_closed_handler (void *cls, |
93 | struct SPDY_Session * session, | 96 | struct SPDY_Session * session, |
94 | int by_client) | 97 | int by_client) |
@@ -108,7 +111,8 @@ session_closed_handler (void *cls, | |||
108 | //session_closed_called = 1; | 111 | //session_closed_called = 1; |
109 | } | 112 | } |
110 | 113 | ||
111 | void | 114 | |
115 | static void | ||
112 | response_done_callback(void *cls, | 116 | response_done_callback(void *cls, |
113 | struct SPDY_Response *response, | 117 | struct SPDY_Response *response, |
114 | struct SPDY_Request *request, | 118 | struct SPDY_Request *request, |
@@ -135,7 +139,8 @@ response_done_callback(void *cls, | |||
135 | free(cls); | 139 | free(cls); |
136 | } | 140 | } |
137 | 141 | ||
138 | int | 142 | |
143 | static int | ||
139 | print_headers (void *cls, | 144 | print_headers (void *cls, |
140 | const char *name, const char *value) | 145 | const char *name, const char *value) |
141 | { | 146 | { |
@@ -163,11 +168,12 @@ new_request_cb (void *cls, | |||
163 | } | 168 | } |
164 | */ | 169 | */ |
165 | 170 | ||
166 | int | 171 | |
172 | static int | ||
167 | append_headers_to_data (void *cls, | 173 | append_headers_to_data (void *cls, |
168 | const char *name, const char **value, int num_values) | 174 | const char *name, const char * const *value, int num_values) |
169 | { | 175 | { |
170 | char **data = (char **)cls; | 176 | char **data = cls; |
171 | void *tofree = *data; | 177 | void *tofree = *data; |
172 | int i; | 178 | int i; |
173 | 179 | ||
@@ -183,7 +189,8 @@ append_headers_to_data (void *cls, | |||
183 | return SPDY_YES; | 189 | return SPDY_YES; |
184 | } | 190 | } |
185 | 191 | ||
186 | void | 192 | |
193 | static void | ||
187 | standard_request_handler(void *cls, | 194 | standard_request_handler(void *cls, |
188 | struct SPDY_Request * request, | 195 | struct SPDY_Request * request, |
189 | uint8_t priority, | 196 | uint8_t priority, |
@@ -251,11 +258,14 @@ standard_request_handler(void *cls, | |||
251 | } | 258 | } |
252 | } | 259 | } |
253 | 260 | ||
254 | void sig_handler(int signo) | 261 | |
262 | static void | ||
263 | sig_handler(int signo) | ||
255 | { | 264 | { |
256 | printf("received signal\n"); | 265 | printf("received signal\n"); |
257 | } | 266 | } |
258 | 267 | ||
268 | |||
259 | int | 269 | int |
260 | main (int argc, char *const *argv) | 270 | main (int argc, char *const *argv) |
261 | { | 271 | { |