Skip to content

H2 stream is closed by sending 100 Continue response #6202

Description

@masaori335

When the POST request on HTTP/2 connection has Expect: 100-continue header, the stream is closed right after the sending 100 Continue response.
The stream should not be closed until complete sending a final status code.

This is obviously violation of rfc7231 5.1.1. Expect

A server that sends a 100 (Continue) response MUST ultimately send a final status code, once the message body is received and processed, unless the connection is closed prematurely.

Affected version: 8.0.x, 9.0.x, master.

Below is debug log with head of 8.0.x branch

[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <HttpTransactHeaders.cc:1220 (add_server_header_to_response)> (http_trans) Adding Server: ATS/8.0.6
+++++++++ Proxy's Response +++++++++
-- State Machine Id: 2
HTTP/1.1 100 Continue
Date: Tue, 19 Nov 2019 03:00:12 GMT
Server: ATS/8.0.6

[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <HttpTransact.cc:3869 (handle_100_continue_response)> (http_trans) Next action SM_ACTION_INTERNAL_100_RESPONSE; HandleResponse
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <HttpSM.cc:7142 (call_transact_and_set_next_state)> (http) [2] State Transition: SM_ACTION_ORIGIN_SERVER_OPEN -> SM_ACTION_INTERNAL_100_RESPONSE
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <HttpTunnel.cc:655 (add_producer)> (http_tunnel) [2] adding producer 'internal msg - 100 continue'
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <HttpTunnel.cc:710 (add_consumer)> (http_tunnel) [2] adding consumer 'user agent'
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <HttpTunnel.cc:757 (tunnel_run)> (http_tunnel) tunnel_run started, p_arg is provided
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <Http2Stream.cc:571 (update_write_request)> (http2_stream) [2] [1] write_vio.nbytes=81, write_vio.ndone=0, write_vio.write_avail=4015, reader.read_avail=81
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <Http2ConnectionState.cc:1537 (send_headers_frame)> (http2_con) [2] [1] Send HEADERS frame
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <Http2ConnectionState.cc:1469 (send_a_data_frame)> (http2_con) [2] [1] Send a DATA frame - client window con: 1073741824 stream: 1073741824 payload:     0
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <Http2ConnectionState.cc:1484 (send_a_data_frame)> (http2_con) [2] [1] End of DATA frame
[Nov 19 12:00:12.773] [ET_NET 2] DEBUG: <Http2Stream.cc:268 (change_state)> (http2_stream) [2] [1] Http2StreamState::HTTP2_STREAM_STATE_CLOSED
[Nov 19 12:00:12.774] [ET_NET 2] DEBUG: <Http2ConnectionState.cc:1517 (send_data_frames)> (http2_con) [2] [1] Shutdown stream
[Nov 19 12:00:12.774] [ET_NET 2] DEBUG: <Http2ConnectionState.cc:1259 (delete_stream)> (http2_con) [2] [1] Delete stream
[Nov 19 12:00:12.774] [ET_NET 2] DEBUG: <Http2Stream.cc:389 (initiating_close)> (http2_stream) [2] [1] initiating_close

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions