Skip to content

Commit

Permalink
Adding better logic for unknown http body size reads.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuinnDamerell committed Nov 25, 2024
1 parent c4660b3 commit b5778b1
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 74 deletions.
4 changes: 2 additions & 2 deletions octoeverywhere/WebStream/octowebstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ def ensureCloseMessageSent(self):
WebStreamMsg.AddIsCloseMsg(builder, True)
WebStreamMsg.AddCloseDueToRequestConnectionFailure(builder, self.ClosedDueToRequestConnectionError)
webStreamMsgOffset = WebStreamMsg.End(builder)
outputBuf = OctoStreamMsgBuilder.CreateOctoStreamMsgAndFinalize(builder, MessageContext.MessageContext.WebStreamMsg, webStreamMsgOffset)
buffer, msgStartOffsetBytes, msgSizeBytes = OctoStreamMsgBuilder.CreateOctoStreamMsgAndFinalize(builder, MessageContext.MessageContext.WebStreamMsg, webStreamMsgOffset)
# Set the flag to silently fail, since the message might have already been sent by the helper.
self.SendToOctoStream(outputBuf, True, True)
self.SendToOctoStream(buffer, msgStartOffsetBytes, msgSizeBytes, True, True)
except Exception as e:
# This is bad, log it and kill the stream.
Sentry.Exception("Exception thrown while trying to send close message for web stream "+str(self.Id), e)
Expand Down
Loading

0 comments on commit b5778b1

Please sign in to comment.