Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Net Leaks Global Variable 'errno' #3095

Closed
devdazed opened this Issue · 4 comments

5 participants

@devdazed

The net module leaks the global variable errno with a value of EOF after a connection has successfully written and then was closed. This exists in v0.6.x and v0.7.x

with no write:

$ node
> var net = require('net');
undefined
> var conn = net.createConnection(1337, '12.0.0.1');
undefined
> conn.end();
undefined
> errno
ReferenceError: errno is not defined

and after a write:

$ node
> var net = require('net')
undefined
> var conn = net.createConnection(1337, '127.0.0.1');
undefined
> conn.write('foo')
true
> conn.end();
true
> errno
'EOF'
> 
@devdazed devdazed referenced this issue in simplereach/helenus
Closed

Global Variable leak errno #20

@bnoordhuis

Yes, known issue. It's not just the net module that does it. It's scheduled to be reworked but it might not make the cut for v0.8.

@isaacs
Owner

Yes, let's put this off until v0.9. That release will be all about polishing the API surface. v0.8 is about refactoring things to make debugging easier, and removing access to errno does not do that.

@jdalton

:+1: I just caught this with QUnit.config.noglobals = true;

@vicary

Now it sounds more friendly to me like what to expect in 0.8 and future versions.

@bnoordhuis bnoordhuis referenced this issue from a commit in bnoordhuis/node
@bnoordhuis bnoordhuis lib, src: remove errno global
Remove the errno global. It's a property on the process object now.

Fixes #3095.
c5a085f
@bnoordhuis bnoordhuis closed this issue from a commit
@bnoordhuis bnoordhuis lib, src: remove errno global
Remove the errno global. It's a property on the process object now.

Fixes #3095.
12d0f0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.