-
Notifications
You must be signed in to change notification settings - Fork 27
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
Trace.fromRequest in Trace.js fails when using Unix Socket instead of TCP/IP Network Socket #36
Comments
@radkins3141 #35 is relevant to the above issue. Please have a look at it. |
Hi Surya, The problem with the work-around for issue #35 seems to be that on line var host = (request.socket && request.socket.address ? Bob On Sat, Sep 5, 2015 at 8:37 AM, Surya P [email protected] wrote:
|
@radkins3141 |
on Linux -- at least on node v0.10.26 and Ubuntu 15.04 -- On Wed, Sep 9, 2015 at 10:10 AM, Surya P [email protected] wrote:
|
In Trace.fromRequest in the file lib/trace.js, a variable called 'host' is unprotected when function call 'request.socket.address()' returns null, resulting in an error later when host.address is dereferenced during the construction of a new Endpoint. This is because, within the request.socket.address function, a native code function called 'getsockname' is undefined on the internally used 'request.socket._handle' object when associated with a Unix Socket. In contrast, getsockname is properly defined (by node.js) and can be found when the request is associated with a TCP/IP socket. A sample fix for Trace.fromRequest could be to protect the 'host' variable with a slight modification to the current code similar to the following:
[ Please note I'm using node v0.10.26 in an Ubuntu 15.04 environment. Thank's in advance for looking at this issue. ]
The text was updated successfully, but these errors were encountered: