Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proxy/http2/Http2Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Http2Stream::change_state(uint8_t type, uint8_t flags)
case Http2StreamState::HTTP2_STREAM_STATE_OPEN:
if (type == HTTP2_FRAME_TYPE_RST_STREAM) {
_state = Http2StreamState::HTTP2_STREAM_STATE_CLOSED;
} else if (type == HTTP2_FRAME_TYPE_DATA) {
} else if (type == HTTP2_FRAME_TYPE_HEADERS || type == HTTP2_FRAME_TYPE_DATA) {
if (recv_end_stream) {
_state = Http2StreamState::HTTP2_STREAM_STATE_HALF_CLOSED_REMOTE;
} else if (send_end_stream) {
Expand Down
3 changes: 1 addition & 2 deletions tests/gold_tests/h2/gold/nghttp_0_stdout.gold
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
``
[``] recv (stream_id=1) :status: 200
``
[``] recv RST_STREAM frame <length=4, flags=0x00, stream_id=1>
``(error_code=NO_ERROR(0x00))
``; END_STREAM
``
19 changes: 3 additions & 16 deletions tests/gold_tests/h2/nghttp.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
# ----
# Setup Origin Server
# ----
microserver = Test.MakeOriginServer("microserver")
httpbin = Test.MakeHttpBinServer("httpbin")

# 128KB
Expand All @@ -38,15 +37,6 @@
post_body_file.write(post_body)
post_body_file.close()

# For Test Case 0
microserver.addResponse("sessionlog.json",
{"headers": "POST /post HTTP/1.1\r\nHost: www.example.com\r\nTrailer: foo\r\n\r\n",
"timestamp": "1469733493.993",
"body": post_body},
{"headers": "HTTP/1.1 200 OK\r\nServer: microserver\r\nConnection: close\r\n\r\n",
"timestamp": "1469733493.993",
"body": ""})

# ----
# Setup ATS
# ----
Expand All @@ -59,7 +49,6 @@
ts.Setup.CopyAs('rules/graceful_shutdown.conf', Test.RunDirectory)

ts.Disk.remap_config.AddLines([
'map /post http://127.0.0.1:{0}/post'.format(microserver.Variables.Port),
'map /httpbin/ http://127.0.0.1:{0}/ @plugin=header_rewrite.so @pparam={1}/graceful_shutdown.conf'.format(
httpbin.Variables.Port, Test.RunDirectory)
])
Expand All @@ -82,13 +71,12 @@
# Test Case 0: Trailer
tr = Test.AddTestRun()
tr.TimeOut = 10
tr.Processes.Default.Command = "nghttp -v --no-dep 'https://127.0.0.1:{0}/post' --trailer 'foo: bar' -d 'post_body'".format(
ts.Variables.ssl_port)
tr.Processes.Default.Command = f"nghttp -vn --no-dep 'https://127.0.0.1:{ts.Variables.ssl_port}/httpbin/post' --trailer 'foo: bar' -d 'post_body'"
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(microserver, ready=When.PortOpen(microserver.Variables.Port))
tr.Processes.Default.StartBefore(httpbin, ready=When.PortOpen(httpbin.Variables.Port))
tr.Processes.Default.StartBefore(Test.Processes.ts)
tr.Processes.Default.Streams.stdout = "gold/nghttp_0_stdout.gold"
tr.StillRunningAfter = microserver
tr.StillRunningAfter = httpbin
tr.StillRunningAfter = ts

# Test Case 1: Graceful Shutdown
Expand All @@ -98,7 +86,6 @@
tr.TimeOut = 10
tr.Processes.Default.Command = f"nghttp -vn --no-dep 'https://127.0.0.1:{ts.Variables.ssl_port}/httpbin/drip?duration=3'"
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(httpbin, ready=When.PortOpen(httpbin.Variables.Port))
tr.Processes.Default.Streams.stdout = "gold/nghttp_1_stdout.gold"
tr.StillRunningAfter = httpbin
tr.StillRunningAfter = ts
Expand Down