98 } |
98 } |
99 |
99 |
100 int test_service(pblock *pb, Session *sn, Request *rq) { |
100 int test_service(pblock *pb, Session *sn, Request *rq) { |
101 printf("test_service\n"); |
101 printf("test_service\n"); |
102 |
102 |
|
103 // request body test begin |
|
104 char *ctval = pblock_findkeyval(pb_key_content_length, rq->headers); |
|
105 if(ctval != NULL) { |
|
106 printf("read request body\n"); |
|
107 |
|
108 printf("netbuf{%d}\n", sn->inbuf); |
|
109 |
|
110 int c; |
|
111 while((c = netbuf_getc(sn->inbuf)) != IO_EOF) { |
|
112 putchar(c); |
|
113 } |
|
114 printf("\n"); |
|
115 } |
|
116 |
|
117 |
|
118 // end test |
|
119 |
103 int fd = prepare_service_file(sn, rq); |
120 int fd = prepare_service_file(sn, rq); |
104 if(fd < 0) { |
121 if(fd < 0) { |
105 /* TODO: service error */ |
122 /* TODO: service error */ |
106 http_start_response(sn, rq); |
123 http_start_response(sn, rq); |
107 return REQ_PROCEED; |
124 return REQ_PROCEED; |