[Groonga-commit] groonga/express-kotoumi [master] Don't emit too generic "message" event

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 13 18:32:28 JST 2013


YUKI Hiroshi	2013-02-13 18:32:28 +0900 (Wed, 13 Feb 2013)

  New Revision: 674f313601efd6d38f78c59db527aea8332dbf74
  https://github.com/groonga/express-kotoumi/commit/674f313601efd6d38f78c59db527aea8332dbf74

  Log:
    Don't emit too generic "message" event

  Modified files:
    lib/backend/connection.js

  Modified: lib/backend/connection.js (+2 -3)
===================================================================
--- lib/backend/connection.js    2013-02-13 18:28:00 +0900 (1b5e88f)
+++ lib/backend/connection.js    2013-02-13 18:32:28 +0900 (62bbd50)
@@ -74,15 +74,14 @@ function isSuccess(code) {
 }
 
 Connection.prototype._handleMessage = function(envelope) {
-  this.emit('message', envelope);
-  this.emit(envelope.type, envelope.body);
-
   var inReplyTo = envelope.inReplyTo;
   if (inReplyTo) {
     var errorCode = envelope.statusCode;
     if (!errorCode || isSuccess(errorCode))
       errorCode = null;
     this.emit('reply:' + inReplyTo, errorCode, envelope);
+  } else {
+    this.emit(envelope.type, envelope.body);
   }
 };
 
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index