Comparing version 0.4.0 to 0.4.1-1
@@ -32,2 +32,6 @@ | ||
}, | ||
removeSession: function(s){ | ||
var id = s._id | ||
delete this._sessions[id] | ||
}, | ||
_resetSessions: function(errno){ | ||
@@ -34,0 +38,0 @@ Object.keys(this._sessions).forEach(function(sid){ |
@@ -30,2 +30,6 @@ | ||
_this._done = true | ||
if(_this._owner){ | ||
_this._owner.removeSession(_this) | ||
_this._owner = null | ||
} | ||
var err = new Error('call timeout') | ||
@@ -32,0 +36,0 @@ _this._cb(err) |
@@ -33,2 +33,6 @@ | ||
_this._done = true | ||
if(_this._owner){ | ||
_this._owner.removeSession(_this) | ||
_this._owner = null | ||
} | ||
var err = new Error('call timeout') | ||
@@ -35,0 +39,0 @@ _this.fiber.throwInto(err) |
@@ -33,2 +33,6 @@ | ||
_this._done = true | ||
if(_this._owner){ | ||
_this._owner.removeSession(_this) | ||
_this._owner = null | ||
} | ||
var err = new Error('call timeout') | ||
@@ -35,0 +39,0 @@ Promise.reject(_this.deferred, err) |
@@ -25,2 +25,6 @@ | ||
_this._done = true | ||
if(_this._owner){ | ||
_this._owner.removeSession(_this) | ||
_this._owner = null | ||
} | ||
var err = new Error('call timeout') | ||
@@ -27,0 +31,0 @@ } |
@@ -270,3 +270,3 @@ | ||
if(s){ | ||
s.pushError(code, msg) | ||
s.pushError(code, message) | ||
delete s._sessions[sid] | ||
@@ -273,0 +273,0 @@ } |
{ | ||
"name": "cocaine", | ||
"version": "0.4.0", | ||
"version": "0.4.1-1", | ||
"description": "Node.js framework for Cocaine platform", | ||
@@ -5,0 +5,0 @@ "author": "Cocaine Project <cocaine@yandex-team.ru>", |
@@ -179,3 +179,3 @@ | ||
var cli = new require('cocaine').Client() | ||
var app = cli.Service('the_app') | ||
var app = cli.Service('the_app', 'app') | ||
@@ -185,9 +185,34 @@ app.connect() | ||
app.on('connect', function(){ | ||
app.enqueue('handle','anydata', function(err, result){ | ||
if(err) { | ||
console.log('app error', err) | ||
} else { | ||
console.log('app response is', result) | ||
} | ||
}) | ||
var s = app.enqueue( | ||
'http', | ||
mp.pack(['GET', // http method | ||
'/', // uri | ||
'HTTP/1.0', // http version | ||
[['some-header','value']], // tuple of header-value pairs | ||
''])) // body of request | ||
var header | ||
var body = [] | ||
s.on('data', function(chunk){ | ||
console.log('reply chunk', chunk) | ||
var data = mp.unpack(chunk) | ||
console.log(' which decodes', data) | ||
if(header === undefined){ | ||
console.log('header') | ||
header = data | ||
} else { | ||
console.log('body chunk') | ||
body.push(data) | ||
} | ||
}) | ||
s.on('end', function(){ | ||
console.log('reply done') | ||
}) | ||
s.on('error', function(err){ | ||
console.log('reply error', err) | ||
}) | ||
}) | ||
@@ -194,0 +219,0 @@ |
var mp = require('msgpack') | ||
var cli = new (require('../lib/client/client').Client)(['apefront.tst.ape.yandex.net', 10053]) | ||
var cli = new (require('../lib/client/client').Client)(['coca', 10053]) | ||
@@ -6,0 +6,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
224
4
4
112921
38
3208