YUKI Hiroshi
null+****@clear*****
Wed Oct 16 14:29:25 JST 2013
YUKI Hiroshi 2013-10-16 14:29:25 +0900 (Wed, 16 Oct 2013) New Revision: f9c90975632daa89b08b4127a228f8cc93296604 https://github.com/droonga/express-droonga/commit/f9c90975632daa89b08b4127a228f8cc93296604 Message: Add "from" field for envelope Modified files: lib/droonga-protocol/connection.js Modified: lib/droonga-protocol/connection.js (+6 -5) =================================================================== --- lib/droonga-protocol/connection.js 2013-10-16 13:16:55 +0900 (e942265) +++ lib/droonga-protocol/connection.js 2013-10-16 14:29:25 +0900 (899b753) @@ -123,8 +123,13 @@ Connection.prototype.emitMessage = function(type, body, callback, options) { options = options || {}; var id = createId(); debug('Connection.emitMessage %d:', this._id, id, type); + var from = this.receiveHostName + ':' + this.receivePort + '/' + + this.tag + '?connection_id=' + this._id; + if (options.sessionId) + from += '&client_session_id=' + options.sessionId; var envelope = { id: id, + from: from, date: getCurrentTime(), statusCode: 200, dataset: options.dataset || this.defaultDataset, @@ -132,11 +137,7 @@ Connection.prototype.emitMessage = function(type, body, callback, options) { body: body }; if (callback) { - var replyTo = this.receiveHostName + ':' + this.receivePort + '/' + - this.tag + '?connection_id=' + this._id; - if (options.sessionId) - replyTo += '&client_session_id=' + options.sessionId; - envelope.replyTo = replyTo; + envelope.replyTo = from; var event = 'reply:' + id; this.once(event, function(errorCode, response) { -------------- next part -------------- HTML����������������������������...Download