diff options
Diffstat (limited to 'src/examples/mhd2spdy_spdy.c')
-rw-r--r-- | src/examples/mhd2spdy_spdy.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/examples/mhd2spdy_spdy.c b/src/examples/mhd2spdy_spdy.c index 93cad507..99b2a3a1 100644 --- a/src/examples/mhd2spdy_spdy.c +++ b/src/examples/mhd2spdy_spdy.c | |||
@@ -236,6 +236,9 @@ void spdy_cb_on_ctrl_recv(spdylay_session *session, | |||
236 | //name = "SYN_REPLY"; | 236 | //name = "SYN_REPLY"; |
237 | stream_id = frame->syn_reply.stream_id; | 237 | stream_id = frame->syn_reply.stream_id; |
238 | break; | 238 | break; |
239 | case SPDYLAY_RST_STREAM: | ||
240 | stream_id = frame->rst_stream.stream_id; | ||
241 | break; | ||
239 | case SPDYLAY_HEADERS: | 242 | case SPDYLAY_HEADERS: |
240 | nv = frame->headers.nv; | 243 | nv = frame->headers.nv; |
241 | //name = "HEADERS"; | 244 | //name = "HEADERS"; |
@@ -247,9 +250,26 @@ void spdy_cb_on_ctrl_recv(spdylay_session *session, | |||
247 | } | 250 | } |
248 | 251 | ||
249 | proxy = spdylay_session_get_stream_user_data(session, stream_id); | 252 | proxy = spdylay_session_get_stream_user_data(session, stream_id); |
250 | PRINT_INFO2("received headers for %s", proxy->url); | 253 | if(NULL == proxy) |
254 | DIE("no proxy obj"); | ||
251 | 255 | ||
256 | switch(type) { | ||
257 | case SPDYLAY_SYN_REPLY: | ||
258 | PRINT_INFO2("received headers for %s", proxy->url); | ||
252 | http_create_response(proxy, nv); | 259 | http_create_response(proxy, nv); |
260 | break; | ||
261 | case SPDYLAY_RST_STREAM: | ||
262 | PRINT_INFO2("received reset stream for %s", proxy->url); | ||
263 | proxy->error = true; | ||
264 | break; | ||
265 | case SPDYLAY_HEADERS: | ||
266 | PRINT_INFO2("received headers for %s", proxy->url); | ||
267 | http_create_response(proxy, nv); | ||
268 | break; | ||
269 | default: | ||
270 | return; | ||
271 | break; | ||
272 | } | ||
253 | glob_opt.spdy_data_received = true; | 273 | glob_opt.spdy_data_received = true; |
254 | } | 274 | } |
255 | 275 | ||