| 6269 | } |
| 6270 | |
| 6271 | void |
| 6272 | HttpSM::do_drain_request_body(HTTPHdr &response) |
| 6273 | { |
| 6274 | int64_t content_length = t_state.hdr_info.client_request.get_content_length(); |
| 6275 | int64_t avail = _ua.get_txn()->get_remote_reader()->read_avail(); |
| 6276 | |
| 6277 | if (t_state.client_info.transfer_encoding == HttpTransact::CHUNKED_ENCODING) { |
| 6278 | SMDbg(dbg_ctl_http, "Chunked body, setting the response to non-keepalive"); |
| 6279 | goto close_connection; |
| 6280 | } |
| 6281 | |
| 6282 | if (content_length > 0) { |
| 6283 | if (avail >= content_length) { |
| 6284 | SMDbg(dbg_ctl_http, "entire body is in the buffer, consuming"); |
| 6285 | int64_t act_on = (avail < content_length) ? avail : content_length; |
| 6286 | client_request_body_bytes = act_on; |
| 6287 | _ua.get_txn()->get_remote_reader()->consume(act_on); |
| 6288 | } else { |
| 6289 | SMDbg(dbg_ctl_http, "entire body is not in the buffer, setting the response to non-keepalive"); |
| 6290 | goto close_connection; |
| 6291 | } |
| 6292 | } |
| 6293 | return; |
| 6294 | |
| 6295 | close_connection: |
| 6296 | t_state.client_info.keep_alive = HTTP_NO_KEEPALIVE; |
| 6297 | _ua.get_txn()->set_close_connection(response); |
| 6298 | } |
| 6299 | |
| 6300 | void |
| 6301 | HttpSM::do_setup_client_request_body_tunnel(HttpVC_t to_vc_type) |
nothing calls this directly
no test coverage detected