| 341 LOG_FAILURE, |
341 LOG_FAILURE, |
| 342 "uri unescape failed: {%.*s}", |
342 "uri unescape failed: {%.*s}", |
| 343 (int)absPath.length, |
343 (int)absPath.length, |
| 344 absPath.ptr); |
344 absPath.ptr); |
| 345 request->status = 400; |
345 request->status = 400; |
| 346 return 1; |
|
| 347 //pblock_kvinsert(pb_key_uri, "/", 1, rq->rq.reqpb); |
346 //pblock_kvinsert(pb_key_uri, "/", 1, rq->rq.reqpb); |
| 348 |
347 |
| 349 // TODO: remove this debug code |
348 // TODO: remove this debug code |
| 350 char tmp_file_path[128]; |
349 char tmp_file_path[128]; |
| 351 snprintf(tmp_file_path, 128, "logs/req_uri_fail_%lld", (long long int)time(NULL)); |
350 snprintf(tmp_file_path, 128, "logs/req_uri_fail_%lld", (long long int)time(NULL)); |
| |
351 log_ereport(LOG_FAILURE, "uri unescape req file: %s\n", tmp_file_path); |
| 352 FILE *f = fopen(tmp_file_path, "w"); |
352 FILE *f = fopen(tmp_file_path, "w"); |
| 353 fwrite(request->netbuf->inbuf, 1, request->netbuf->pos, f); |
353 if(f) { |
| 354 fclose(f); |
354 fwrite(request->netbuf->inbuf, 1, request->netbuf->pos, f); |
| |
355 fclose(f); |
| |
356 } else { |
| |
357 log_ereport(LOG_FAILURE, "Cannot write req uri fail file\n"); |
| |
358 } |
| |
359 |
| |
360 |
| |
361 return 1; |
| 355 } |
362 } |
| 356 |
363 |
| 357 // pass http header to the NSAPI request structure |
364 // pass http header to the NSAPI request structure |
| 358 int hlen = request->headers->len; |
365 int hlen = request->headers->len; |
| 359 HeaderArray *ha = request->headers; |
366 HeaderArray *ha = request->headers; |