Skip to content

Fix sending multipart bodies through SocketChannel #390

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

Merged
merged 2 commits into from
Oct 2, 2013

Conversation

plouh
Copy link

@plouh plouh commented Sep 26, 2013

As per documentation, selector.select() returns only keys that have
updated and therefore even if it return zero, it doesn't mean that
selectedKeys wouldn't contain keys that are writable.

See http://stackoverflow.com/questions/9939989/java-nio-selector-select-returns-0-although-channels-are-ready and http://docs.oracle.com/javase/7/docs/api/java/nio/channels/Selector.html#select() for more details.

This commit utilizes the same maxSpin already used in FileChannel case
for detecting that writing has stuck somewhere. A configurable
timeout for select would be the obvious better solution.

Petri Louhelainen added 2 commits September 26, 2013 10:42
As per documentation, selector.select() returns only keys that have
updated and therefore even if it return zero, it doesn't mean that
selectedKeys wouldn't contain keys that are writable.

See http://stackoverflow.com/questions/9939989/java-nio-selector-select-returns-0-although-channels-are-ready and http://docs.oracle.com/javase/7/docs/api/java/nio/channels/Selector.html#select() for more details.

This commit utilizes the same maxSpin already used in FileChannel case
for detecting that writing has stuck somewhere.  A configurable
timeout for select would be the obvious better solution.
Some servers, e.g. Jetty save multipart parts with filename present
in content disposition header to disk.  To prevent this we want
to be able to send Content-Disposition header with name only
(so we can easily access it) but not store bytes to disk to prevent
unwanted IO.
@slandelle
Copy link
Contributor

@jfarcand @rlubke You're the experts, guys! This one is for you.

jfarcand added a commit that referenced this pull request Oct 2, 2013
Fix sending multipart bodies through SocketChannel
@jfarcand jfarcand merged commit 2662a46 into AsyncHttpClient:ahc-1.7.x Oct 2, 2013
@slandelle
Copy link
Contributor

backport on master?

@slandelle
Copy link
Contributor

ported on master

@ghost ghost assigned jfarcand Oct 15, 2013
@plouh plouh deleted the ahc-1.7.x branch December 30, 2013 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants