aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_linux.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2024-05-14 09:55:11 -0700
committerDamien Neil <dneil@google.com>2024-05-14 22:34:15 +0000
commita524b8725374e4ebbb7fe3da85f407ee24141d51 (patch)
tree34a8a2eba9ad8f06280a6d73b4e43b7cc4412bdd /src/syscall/exec_linux.go
parentb86527ec0566deac64eb28e71a8603aea62c4e7b (diff)
downloadgo-a524b8725374e4ebbb7fe3da85f407ee24141d51.tar.xz
net/http: avoid panic when writing 100-continue after handler done
When a request contains an "Expect: 100-continue" header, the first read from the request body causes the server to write a 100-continue status. This write caused a panic when performed after the server handler has exited. Disable the write when cleaning up after a handler exits. This also fixes a bug where an implicit 100-continue could be sent after a call to WriteHeader has sent a non-1xx header. This change drops tracking of whether we've written a 100-continue or not in response.wroteContinue. This tracking was used to determine whether we should consume the remaining request body in chunkWriter.writeHeader, but the discard-the-body path was only taken when the body was already consumed. (If the body is not consumed, we set closeAfterReply, and we don't consume the remaining body when closeAfterReply is set. If the body is consumed, then we may attempt to discard the remaining body, but there is obviously no body remaining.) Fixes #53808 Change-Id: I3542df26ad6cdfe93b50a45ae2d6e7ef031e46fa Reviewed-on: https://go-review.googlesource.com/c/go/+/585395 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'src/syscall/exec_linux.go')
0 files changed, 0 insertions, 0 deletions