aboutsummaryrefslogtreecommitdiff
path: root/src/testspdy/test_request_response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testspdy/test_request_response.c')
-rw-r--r--src/testspdy/test_request_response.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/testspdy/test_request_response.c b/src/testspdy/test_request_response.c
index 6c311be3..07ed236b 100644
--- a/src/testspdy/test_request_response.c
+++ b/src/testspdy/test_request_response.c
@@ -23,7 +23,7 @@
23 * @author Andrey Uzunov 23 * @author Andrey Uzunov
24 * @author Tatsuhiro Tsujikawa 24 * @author Tatsuhiro Tsujikawa
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "microspdy.h" 28#include "microspdy.h"
29#include <sys/wait.h> 29#include <sys/wait.h>
@@ -202,6 +202,9 @@ static ssize_t send_callback(spdylay_session *session,
202 const uint8_t *data, size_t length, int flags, 202 const uint8_t *data, size_t length, int flags,
203 void *user_data) 203 void *user_data)
204{ 204{
205 (void)session;
206 (void)flags;
207
205 struct Connection *connection; 208 struct Connection *connection;
206 ssize_t rv; 209 ssize_t rv;
207 connection = (struct Connection*)user_data; 210 connection = (struct Connection*)user_data;
@@ -231,6 +234,9 @@ static ssize_t recv_callback(spdylay_session *session,
231 uint8_t *buf, size_t length, int flags, 234 uint8_t *buf, size_t length, int flags,
232 void *user_data) 235 void *user_data)
233{ 236{
237 (void)session;
238 (void)flags;
239
234 struct Connection *connection; 240 struct Connection *connection;
235 ssize_t rv; 241 ssize_t rv;
236 connection = (struct Connection*)user_data; 242 connection = (struct Connection*)user_data;
@@ -263,6 +269,8 @@ static void before_ctrl_send_callback(spdylay_session *session,
263 spdylay_frame *frame, 269 spdylay_frame *frame,
264 void *user_data) 270 void *user_data)
265{ 271{
272 (void)user_data;
273
266 if(type == SPDYLAY_SYN_STREAM) { 274 if(type == SPDYLAY_SYN_STREAM) {
267 struct Request *req; 275 struct Request *req;
268 int stream_id = frame->syn_stream.stream_id; 276 int stream_id = frame->syn_stream.stream_id;
@@ -278,6 +286,8 @@ static void on_ctrl_send_callback(spdylay_session *session,
278 spdylay_frame_type type, 286 spdylay_frame_type type,
279 spdylay_frame *frame, void *user_data) 287 spdylay_frame *frame, void *user_data)
280{ 288{
289 (void)user_data;
290
281 char **nv; 291 char **nv;
282 const char *name = NULL; 292 const char *name = NULL;
283 int32_t stream_id; 293 int32_t stream_id;
@@ -303,6 +313,8 @@ static void on_ctrl_recv_callback(spdylay_session *session,
303 spdylay_frame_type type, 313 spdylay_frame_type type,
304 spdylay_frame *frame, void *user_data) 314 spdylay_frame *frame, void *user_data)
305{ 315{
316 (void)user_data;
317
306 struct Request *req; 318 struct Request *req;
307 char **nv; 319 char **nv;
308 const char *name = NULL; 320 const char *name = NULL;
@@ -346,6 +358,9 @@ static void on_stream_close_callback(spdylay_session *session,
346 spdylay_status_code status_code, 358 spdylay_status_code status_code,
347 void *user_data) 359 void *user_data)
348{ 360{
361 (void)user_data;
362 (void)status_code;
363
349 struct Request *req; 364 struct Request *req;
350 req = spdylay_session_get_stream_user_data(session, stream_id); 365 req = spdylay_session_get_stream_user_data(session, stream_id);
351 if(req) { 366 if(req) {
@@ -368,6 +383,9 @@ static void on_data_chunk_recv_callback(spdylay_session *session, uint8_t flags,
368 const uint8_t *data, size_t len, 383 const uint8_t *data, size_t len,
369 void *user_data) 384 void *user_data)
370{ 385{
386 (void)user_data;
387 (void)flags;
388
371 struct Request *req; 389 struct Request *req;
372 req = spdylay_session_get_stream_user_data(session, stream_id); 390 req = spdylay_session_get_stream_user_data(session, stream_id);
373 if(req) { 391 if(req) {
@@ -433,6 +451,8 @@ static int select_next_proto_cb(SSL* ssl,
433 const unsigned char *in, unsigned int inlen, 451 const unsigned char *in, unsigned int inlen,
434 void *arg) 452 void *arg)
435{ 453{
454 (void)ssl;
455
436 int rv; 456 int rv;
437 uint16_t *spdy_proto_version; 457 uint16_t *spdy_proto_version;
438 /* spdylay_select_next_protocol() selects SPDY protocol version the 458 /* spdylay_select_next_protocol() selects SPDY protocol version the
@@ -795,15 +815,30 @@ standard_request_handler(void *cls,
795 const char *version, 815 const char *version,
796 const char *host, 816 const char *host,
797 const char *scheme, 817 const char *scheme,
798 struct SPDY_NameValue * headers) 818 struct SPDY_NameValue * headers,
819 bool more)
799{ 820{
821 (void)cls;
822 (void)request;
823 (void)priority;
824 (void)host;
825 (void)scheme;
826 (void)headers;
827 (void)method;
828 (void)version;
829
800 struct SPDY_Response *response=NULL; 830 struct SPDY_Response *response=NULL;
801 831
802 if(strcmp(CLS,cls)!=0) 832 if(strcmp(CLS,cls)!=0)
803 { 833 {
804 killchild(child,"wrong cls"); 834 killchild(child,"wrong cls");
805 } 835 }
806 836
837 if(false != more){
838 fprintf(stdout,"more has wrong value\n");
839 exit(5);
840 }
841
807 response = SPDY_build_response(200,NULL,SPDY_HTTP_VERSION_1_1,NULL,RESPONSE_BODY,strlen(RESPONSE_BODY)); 842 response = SPDY_build_response(200,NULL,SPDY_HTTP_VERSION_1_1,NULL,RESPONSE_BODY,strlen(RESPONSE_BODY));
808 843
809 if(NULL==response){ 844 if(NULL==response){
@@ -961,7 +996,7 @@ parentproc( int port)
961 return WEXITSTATUS(childstatus); 996 return WEXITSTATUS(childstatus);
962} 997}
963 998
964int main(int argc, char **argv) 999int main()
965{ 1000{
966 int port = get_port(12123); 1001 int port = get_port(12123);
967 parent = getpid(); 1002 parent = getpid();