Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
net: rename flag FLAG_SHUTDOWNQUED
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Jun 4, 2012
1 parent 7161ecd commit f0a561f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/net.js
Expand Up @@ -45,7 +45,7 @@ function createTCP() {
var FLAG_GOT_EOF = 1 << 0;
var FLAG_SHUTDOWN = 1 << 1;
var FLAG_DESTROY_SOON = 1 << 2;
var FLAG_SHUTDOWNQUED = 1 << 3;
var FLAG_SHUTDOWN_QUEUED = 1 << 3;


var debug;
Expand Down Expand Up @@ -250,11 +250,11 @@ Socket.prototype.resume = function() {


Socket.prototype.end = function(data, encoding) {
if (this._connecting && ((this._flags & FLAG_SHUTDOWNQUED) == 0)) {
if (this._connecting && ((this._flags & FLAG_SHUTDOWN_QUEUED) == 0)) {
// still connecting, add data to buffer
if (data) this.write(data, encoding);
this.writable = false;
this._flags |= FLAG_SHUTDOWNQUED;
this._flags |= FLAG_SHUTDOWN_QUEUED;
}

if (!this.writable) return;
Expand Down Expand Up @@ -747,9 +747,9 @@ function afterConnect(status, handle, req, readable, writable) {

self.emit('connect');

if (self._flags & FLAG_SHUTDOWNQUED) {
if (self._flags & FLAG_SHUTDOWN_QUEUED) {
// end called before connected - call end now with no data
self._flags &= ~FLAG_SHUTDOWNQUED;
self._flags &= ~FLAG_SHUTDOWN_QUEUED;
self.end();
}
} else {
Expand Down

0 comments on commit f0a561f

Please sign in to comment.