diff options
| author | Andrei Belov <defan@nginx.com> | 2018-12-20 20:25:50 +0300 |
|---|---|---|
| committer | Andrei Belov <defan@nginx.com> | 2018-12-20 20:25:50 +0300 |
| commit | 82e12d0cdeeb707ad4b1aef91c5e90b4347b0831 (patch) | |
| tree | 19ef4cf3dea340fa365af022c76543f92d1e2e0a /src/nodejs/unit-http/socket.js | |
| parent | b140ac29e5571e9abaafce006932f15d86b78803 (diff) | |
| parent | 4195a29fabfe65f5a28baf2405c2077e2ba3c09a (diff) | |
| download | unit-82e12d0cdeeb707ad4b1aef91c5e90b4347b0831.tar.gz unit-82e12d0cdeeb707ad4b1aef91c5e90b4347b0831.tar.bz2 | |
Merged with the default branch.
Diffstat (limited to 'src/nodejs/unit-http/socket.js')
| -rwxr-xr-x | src/nodejs/unit-http/socket.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/nodejs/unit-http/socket.js b/src/nodejs/unit-http/socket.js index aef065bf..6e836949 100755 --- a/src/nodejs/unit-http/socket.js +++ b/src/nodejs/unit-http/socket.js @@ -18,10 +18,16 @@ function Socket(options) { throw new TypeError('Options must be object'); } - this.readable = (typeof options.readable === 'boolean' ? options.readable - : false); - this.writable = (typeof options.writable === 'boolean' ? options.writable - : false); + if ("fd" in options) { + throw new TypeError('Working with file descriptors not supported'); + } + + /* + * For HTTP TCP socket 'readable' and 'writable' are always true. + * These options are required by Express and Koa frameworks. + */ + this.readable = true; + this.writable = true; } util.inherits(Socket, EventEmitter); @@ -43,7 +49,6 @@ Socket.prototype.connect = function connect(options, connectListener) { this.once('connect', connectListener); this.connecting = true; - this.writable = true; return this; }; |
