139 |
139 |
140 return REQ_PROCEED; |
140 return REQ_PROCEED; |
141 } |
141 } |
142 |
142 |
143 int service_hello(pblock *pb, Session *sn, Request *rq) { |
143 int service_hello(pblock *pb, Session *sn, Request *rq) { |
|
144 pblock_removekey(pb_key_content_type, rq->srvhdrs); |
|
145 pblock_nvinsert("content-type", "text/plain", rq->srvhdrs); |
144 pblock_nninsert("content-length", 13, rq->srvhdrs); |
146 pblock_nninsert("content-length", 13, rq->srvhdrs); |
145 protocol_status(sn, rq, 200, NULL); |
147 protocol_status(sn, rq, 200, NULL); |
146 http_start_response(sn, rq); |
148 http_start_response(sn, rq); |
147 net_write(sn->csd, "Hello World!\n", 13); |
149 net_write(sn->csd, "Hello World!\n", 13); |
148 return REQ_PROCEED; |
150 return REQ_PROCEED; |
223 /* close */ |
225 /* close */ |
224 closedir(dir); |
226 closedir(dir); |
225 |
227 |
226 return REQ_PROCEED; |
228 return REQ_PROCEED; |
227 } |
229 } |
|
230 |
|
231 int send_options(pblock *pb, Session *sn, Request *rq) { |
|
232 char *allow = "HEAD, GET, PUT, DELETE, TRACE, OPTIONS, MOVE, COPY, " |
|
233 "PROPFIND, PROPPATCH, MKCOL, LOCK, UNLOCK, ACL, REPORT"; |
|
234 char *dav = "1,2,access-control"; |
|
235 |
|
236 pblock_removekey(pb_key_content_type, rq->srvhdrs); |
|
237 pblock_nvinsert("allow", allow, rq->srvhdrs); |
|
238 pblock_nvinsert("dav", dav, rq->srvhdrs); |
|
239 pblock_nninsert("content-length", 0, rq->srvhdrs); |
|
240 protocol_status(sn, rq, 200, NULL); |
|
241 http_start_response(sn, rq); |
|
242 |
|
243 return REQ_PROCEED; |
|
244 } |