| 580 | } |
| 581 | |
| 582 | static void |
| 583 | getClientRequest(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc hdr_loc, TSMLoc url_loc, ClientRequest &creq) |
| 584 | { |
| 585 | int query_len; |
| 586 | const char *query = TSUrlHttpQueryGet(bufp, url_loc, &query_len); |
| 587 | |
| 588 | if (!query) { |
| 589 | LOG_ERROR("Could not get query from request URL"); |
| 590 | creq.status = TS_HTTP_STATUS_BAD_REQUEST; |
| 591 | return; |
| 592 | } else { |
| 593 | if (!getDefaultBucket(txnp, bufp, hdr_loc, creq)) { |
| 594 | LOG_ERROR("failed getting Default Bucket for the request"); |
| 595 | return; |
| 596 | } |
| 597 | if (query_len > MAX_QUERY_LENGTH) { |
| 598 | creq.status = TS_HTTP_STATUS_BAD_REQUEST; |
| 599 | LOG_ERROR("querystring too long"); |
| 600 | return; |
| 601 | } |
| 602 | parseQueryParameters(query, query_len, creq); |
| 603 | creq.client_addr = TSHttpTxnClientAddrGet(txnp); |
| 604 | checkGzipAcceptance(bufp, hdr_loc, creq); |
| 605 | } |
| 606 | } |
| 607 | |
| 608 | static void |
| 609 | parseQueryParameters(const char *query, int query_len, ClientRequest &creq) |
no test coverage detected