Skip to content

Fix: handle unhandled exceptions#454

Closed
some-helper wants to merge 2 commits intopocoproject:developfrom
some-helper:hotfixes/handle-exception
Closed

Fix: handle unhandled exceptions#454
some-helper wants to merge 2 commits intopocoproject:developfrom
some-helper:hotfixes/handle-exception

Conversation

@some-helper
Copy link
Copy Markdown

Hi all!

I was working with poco-1.4.6 but I see this bug was also in previous versions.
Stable version of poco-1.4.6 works well on my Ubuntu-12.04_x64-86 but it works wrong on Windows 8.1 x64.

I am using Poco::Net::HTTPSStreamFactory. Sample:

Poco::Net::HTTPSStreamFactory httpsFactory;
std::istream* pIStream = httpsFactory.open( some_url );

This code should download some data and it does it but... with additional extra zero-byte in the end of these data.
After investigation I found that istream's implementation on Linux differs from Windows 8.1 one. Both handle exceptions that can be inside of istream::get(). But in Linux in this case EOF will be returned and in Windows 8.1 we get zero.

So I offer this patch.

Thanks,
Oleg

@obiltschnig @aleks-f

@aleks-f
Copy link
Copy Markdown
Member

aleks-f commented May 30, 2014

@obiltschnig : is this a valid fix?

@obiltschnig
Copy link
Copy Markdown
Member

I can reproduce the issue but the fix is not right. The real issue is that HTTPResponseStreamBuf does not propagate the failed state from the underlying stream.

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