projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29b2fdb
)
net.js: don't pretend that everything is okay when unwrapping fails
author
Bert Belder
<bertbelder@gmail.com>
Tue, 8 May 2012 18:17:54 +0000
(20:17 +0200)
committer
Bert Belder
<bertbelder@gmail.com>
Wed, 9 May 2012 01:56:06 +0000
(
03:56
+0200)
In case of an UNWRAP failure, the binding returns -1, which is truthy.
lib/net.js
patch
|
blob
|
history
diff --git
a/lib/net.js
b/lib/net.js
index 3acaf8a130b7168c35d469912c00af58a4a416f6..4ebc940c3c3457dc2d4a3cb92d1666f674b88f5e 100644
(file)
--- a/
lib/net.js
+++ b/
lib/net.js
@@
-512,7
+512,7
@@
Socket.prototype._write = function(data, encoding, cb) {
// `encoding` is unused right now, `data` is always a buffer.
var writeReq = this._handle.write(data);
- if (!writeReq) {
+ if (!writeReq
|| typeof writeReq !== 'object'
) {
this._destroy(errnoException(errno, 'write'), cb);
return false;
}