-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
HttpStaticFileServerHandler Example: Fail to download file in ssl mode #3592
Comments
bobwenx
changed the title
HttpStaticFileServerHandler: Fail to download file in ssl mode
HttpStaticFileServerHandler Example: Fail to download file in ssl mode
Apr 6, 2015
@bobwenx nope the code of the example is wrong. Could you try to replace: ctx.write(new HttpChunkedInput(...)); with ctx.writeAndFlush(new HttpChunkedInput(...)); and let me know if it works ? |
after change code to use One more thing, the javadoc of
However, the HTTP response didn't contains such header:
do we need manually add such header? // Line 196
response.headers().set(TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
sendFileFuture = ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)),
ctx.newProgressivePromise());
// HttpChunkedInput will write the end marker (LastHttpContent) for us.
lastContentFuture = sendFileFuture; |
normanmaurer
added a commit
that referenced
this issue
Apr 10, 2015
Motivation: We missed to flush the channel when using HttpChunkedInput (this is done when using SSL). This will result in a stale. Modifications: Replace ctx.write(...) with ctx.writeAndFlush(...) Result: Correctly working example.
normanmaurer
added a commit
that referenced
this issue
Apr 10, 2015
Motivation: We missed to flush the channel when using HttpChunkedInput (this is done when using SSL). This will result in a stale. Modifications: Replace ctx.write(...) with ctx.writeAndFlush(...) Result: Correctly working example.
normanmaurer
added a commit
that referenced
this issue
Apr 10, 2015
Motivation: We missed to flush the channel when using HttpChunkedInput (this is done when using SSL). This will result in a stale. Modifications: Replace ctx.write(...) with ctx.writeAndFlush(...) Result: Correctly working example.
Fixed.. Thanks for reporting |
pulllock
pushed a commit
to pulllock/netty
that referenced
this issue
Oct 19, 2023
Motivation: We missed to flush the channel when using HttpChunkedInput (this is done when using SSL). This will result in a stale. Modifications: Replace ctx.write(...) with ctx.writeAndFlush(...) Result: Correctly working example.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The netty http-file-server example are unable to download file if ssl mode is enabled:
when i try to download file(https://localhost:8443/pom.xml) with chrome, the browser will hang there:
HTTP Request:
HTTP Response:
i check the example code, and find the comment(line 200) say:
However, it didn't write HTTP end marker(that's why the browser hang).
if i change the code to manually write LastHttpContent.EMPTY_LAST_CONTENT, Chrome can download file correctly.
So, There are something wrong in HttpChunkedInput processing?
The text was updated successfully, but these errors were encountered: