Closed andreasley closed 7 years ago
I think moving these to functions would be the right thing to do, but that would break public API forcing us to bump the major.
Is there any way to fix this issue for 1.0? Perhaps catching the error and printing a warning for now.
And for Socks 2.0 we can move to functions.
@tannernelson I've created a PR: https://github.com/vapor/socks/pull/85
Resolved in release 1.1.0
I've seen the following crash in a Vapor project I'm working on, running on OS X 10.11.6:
fatal error: 'try!' expression unexpectedly raised an error: Socket failed with code 22 ("Invalid argument") [optionSetFailed(65535, 4, "1")]
Here's part of the relevant stack trace:
The corresponding call is here in SocketOptions.swift:
For some reason,
setsockopt
fails under certain circumstances,setOption
throws and since the result ofsetBoolOption
is forcibly unwrapped, I end up with aEXC_BAD_INSTRUCTION
.There's the following comment in the same file:
When we have throwing property setters, remove the bangs below
Since throwing setters will not be available in the near future, would you be interested in a pull request where the properties are replaced by functions?I will investigate the reason why
setsockopt
sometimes fails in my environment, but this might take a while.