Do not crash if connection is closed while sending a file using sendfile #463

Merged
merged 1 commit into from Apr 11, 2013

Projects

None yet

2 participants

@asabil
asabil commented Mar 7, 2013

file:sendfile/2 may return {error, enotconn} if the connection is closed while trying to send the file

@essen
Member
essen commented Mar 7, 2013

I've seen {error,etimedout} too. Please add.

@asabil
asabil commented Mar 7, 2013

Sure, however, it seems like many tests are failing now, I don't really know if they are related to this change

@asabil
asabil commented Mar 7, 2013

Looks like the failing tests are not related to this commit, since master has about 7 failing test cases on master when ran on an OSX 10.8 machine.

@essen
Member
essen commented Mar 7, 2013

Wait why the try catch? There's a badmatch because you didn't add a case clause that's all.

@asabil
asabil commented Mar 7, 2013

Th badmatch occurs in primfile:sendfile/10 it's a badmatch not a case_clause error that I see in production

@essen
Member
essen commented Mar 8, 2013

Right, my bad. Any luck with the tests?

@asabil
asabil commented Mar 8, 2013

There is no real problem with the tests, they are just failing on my machine because I don't have an iface named "lo" but one called "lo0" instead, and this is not related to this pull request.

@essen
Member
essen commented Mar 8, 2013

I still wouldn't mind having it fixed at the same time. :)

@asabil
asabil commented Mar 8, 2013

I will open a new pull request with the tests fixes when I get time to get them running

@essen
Member
essen commented Mar 9, 2013

For etimedout it's a case clause though: {case_clause,{error,etimedout}}

@asabil
asabil commented Apr 8, 2013

Updated to match the changes in ranch

@essen essen merged commit 83876c3 into ninenines:master Apr 11, 2013
@essen
Member
essen commented Apr 11, 2013

Merged! Thanks.

@asabil asabil deleted the soundrop:fix/sendfile-error-handling branch Jul 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment