Giampaolo Rodola avatar Giampaolo Rodola committed 4d2a589

Comments (0)

Files changed (1)

 
 class dispatcher:
 
+    debug = False
     connected = False
     accepting = False
-    closed = False
+    closing = False
     addr = None
     ignore_log_types = frozenset(['warning'])
 
                 raise
 
     def close(self):
-        if not self.closed:
-            self.closed = True
-            self.connected = False
-            self.accepting = False
-            self.del_channel()
-            try:
-                self.socket.close()
-            except socket.error as why:
-                if why.args[0] not in (ENOTCONN, EBADF):
-                    raise
+        self.connected = False
+        self.accepting = False
+        self.del_channel()
+        try:
+            self.socket.close()
+        except socket.error as why:
+            if why.args[0] not in (ENOTCONN, EBADF):
+                raise
 
     # cheap inheritance, used to pass all other attribute
     # references to the underlying socket object.
         return (not self.connected) or len(self.out_buffer)
 
     def send(self, data):
+        if self.debug:
+            self.log_info('sending %s' % repr(data))
         self.out_buffer = self.out_buffer + data
         self.initiate_send()
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.