Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Http integ #2

wants to merge 5 commits into from

Conversation

alexw91
Copy link
Owner

@alexw91 alexw91 commented Apr 24, 2019

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.

@alexw91 alexw91 force-pushed the http_integ branch 4 times, most recently from fc151ae to f1654ff Compare April 27, 2019 00:28
try {
/* Write the bytes, then update the Native Window Size*/
out.write(bodyBytesIn.array());
stream.updateWindowSize(in.writeSpaceAvailable());
Copy link

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?
Copy link

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.

@alexw91
Copy link
Owner Author

alexw91 commented May 20, 2019

This PR is very out of date. Closing in favor of: #3

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.

2 participants