[Groonga-commit] groonga/express-kotoumi [master] Ignore messages from backend if it has session id and the handler is not related to the session

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 6 19:06:57 JST 2013


YUKI Hiroshi	2013-02-06 19:06:57 +0900 (Wed, 06 Feb 2013)

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

  Log:
    Ignore messages from backend if it has session id and the handler is not related to the session

  Modified files:
    lib/frontend/socket.io-adaptor.js

  Modified: lib/frontend/socket.io-adaptor.js (+4 -1)
===================================================================
--- lib/frontend/socket.io-adaptor.js    2013-02-06 19:06:20 +0900 (3568411)
+++ lib/frontend/socket.io-adaptor.js    2013-02-06 19:06:57 +0900 (73e3f75)
@@ -33,12 +33,15 @@ exports.register = function(application, server, params) {
     return (function(data) {
       if (requestBuilder)
         data = requestBuilder(data);
-      connection.emitMessage(command, data);
+      connection.emitMessage(command, data, null, { socket: socket });
     });
   }
 
   function createBackendMessageHandler(socket) {
     return (function(envelope) {
+      if (envelope.sessionId && envelope.sessionId != socket.sessionid)
+        return;
+
       var event = envelope.type;
 
       var data;
-------------- next part --------------
HTML����������������������������...
Download 



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