Skip to content

Conversation

nakajijapan
Copy link

Error occured when FILE IO's postion is END.
I don't want to error as possible.

rest = sz
while rest > 0
n = io.read([rest, @chunk_size].min, buf)
raise ArgumentError.new("Illegal size value: #size returns #{sz} but cannot read") if n.nil?
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to error this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's intentional to detect the situation where "it should be able to read XX bytes but httpclient can read only <XX bytes". I didn't want to ignore this unexpected situation.
How does sz become unexpected number in your case?

Copy link
Author

@nakajijapan nakajijapan Jun 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This phenomenon occurred when I was testing with webmock.

I seem that the same proccessing is performed twice in a testing.

Maybe, around here file.
https://github.com/bblimke/webmock/blob/master/lib/webmock/http_lib_adapters/httpclient_adapter.rb

I think that there may be a problem with the webmock side possibly. I try to search.

Thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nahi nahi added the Feedback label Jun 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants