-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for chunked transfers #2
base: master
Are you sure you want to change the base?
Conversation
@@ -55,7 +56,27 @@ class RequestAccessLogger(ctx: RequestContext, accessLogger: AccessLogger, | |||
accessLogger.logAccess(request, response, timeStampCalculator(Unit)) | |||
forwardMsgAndStop(response) | |||
} | |||
case Confirmed(ChunkedResponseStart(response), sentAck) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to assume these will always be Confirmed?
ie sent via responder ! MessageChunk.withAck(sentAck)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could re-write this case as:
case confirmed@Confirmed(ChunkResponseStart(response), _) => {
chunkedResponse = response
responder forward confirmed
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed & covers now also un-ACKed
Added |
Chunked transfers are not handled properly and time out while the transfer is still ongoing. With this patchset, each messageChunk is considered a heart beat and resetting the timeout scheduler.
case confirmed@Confirmed(ChunkedResponseStart(response), _) => handleChunkedResponseStart(confirmed, response) | ||
case unconfirmed@ChunkedResponseStart(response) => handleChunkedResponseStart(unconfirmed, response) | ||
|
||
case confirmed@(Confirmed(MessageChunk(_,_), _) | MessageChunk) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice pattern match
FWIW I'm 👍 |
This commit adds a connection abort in case of a timeout happens during a chunked transfer: A reasonable tear down and/or sending any content to the client is impossible as we have already started to transmit data. Thus it is impossible to predict how a client would treat any 'appened' error message to the stream anyway - and trailing headers are not supported by any reasonable HTTP client library out there. Therefore the connection is just aborted to get back to a "definied state".
passing values back
Chunked transfers are not handled properly and time out while the transfer is still ongoing.
With this patchset, each messageChunk is considered a heart beat and resetting the timeout scheduler.