YUKI Hiroshi
null+****@clear*****
Wed Oct 16 12:59:15 JST 2013
YUKI Hiroshi 2013-10-16 12:59:15 +0900 (Wed, 16 Oct 2013) New Revision: 3e2f0abbef9e0800259101799e146f9c6f12020c https://github.com/droonga/express-droonga/commit/3e2f0abbef9e0800259101799e146f9c6f12020c Message: Add "replyTo" header only when the message requires a response Modified files: lib/droonga-protocol/connection.js Modified: lib/droonga-protocol/connection.js (+6 -5) =================================================================== --- lib/droonga-protocol/connection.js 2013-10-11 18:49:37 +0900 (1e63caa) +++ lib/droonga-protocol/connection.js 2013-10-16 12:59:15 +0900 (e942265) @@ -123,20 +123,21 @@ Connection.prototype.emitMessage = function(type, body, callback, options) { options = options || {}; var id = createId(); debug('Connection.emitMessage %d:', this._id, id, type); - var replyTo = this.receiveHostName + ':' + this.receivePort + '/' + - this.tag + '?connection_id=' + this._id; - if (options.sessionId) - replyTo += '&client_session_id=' + options.sessionId; var envelope = { id: id, date: getCurrentTime(), - replyTo: replyTo, statusCode: 200, dataset: options.dataset || this.defaultDataset, type: type, 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; + var event = 'reply:' + id; this.once(event, function(errorCode, response) { debug('Connection.emitMessage.reply %d:', this._id, errorCode); -------------- next part -------------- HTML����������������������������...Download