-
Notifications
You must be signed in to change notification settings - Fork 0
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
Http integ #2
Http integ #2
Conversation
fc151ae
to
f1654ff
Compare
try { | ||
/* Write the bytes, then update the Native Window Size*/ | ||
out.write(bodyBytesIn.array()); | ||
stream.updateWindowSize(in.writeSpaceAvailable()); |
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.
The "update" in update_window_size is a slightly misleading, but it's the terminology that's used in the world of read-windows...
This doesn't "set" the size of the window, it "re-opens" the window by that much.
So, by the fact that you've receive bodyBytesIn
of data, the window has shrunk by bodyBytesIn
.
You want to re-open the window by bodyBytesIn
, if possible.
Long story short, this math should look something like: stream.updateWindowSize(min(bodyBytesIn.length, in.writeSpaceAvailable());
And if you didn't re-eopen the window all the way, you'll want to open it once space becomes available again
out.write(bodyBytesIn.array()); | ||
stream.updateWindowSize(in.writeSpaceAvailable()); | ||
} catch (IllegalStateException|IOException e) { | ||
// TODO: What to do? |
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.
Currently, if something goes wrong in a callback you should close the connection from the callback.
The function for closing the connection doesn't currently allow an error-code to be passed, but that's going to change in the near-future.
This PR is very out of date. Closing in favor of: #3 |
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.