Jeffrey Gelens avatar Jeffrey Gelens committed b5da9e1

More fixes for latest gevent version

Comments (0)

Files changed (3)

geventwebsocket/__init__.py

 
-version_info = (0, 2, 2)
+version_info = (0, 2, 3)
 __version__ =  ".".join(map(str, version_info))
 
 try:

geventwebsocket/handler.py

             ]
 
             self.start_response("101 Web Socket Protocol Handshake", headers)
-            self.write([challenge])
+            self.write(challenge)
         else:
             raise Exception("Version not supported")
 
 
     def write(self, data):
         if self.websocket_connection:
-            self.wfile.writelines(data)
+            self.socket.sendall(data)
         else:
             super(WebSocketHandler, self).write(data)
 
                 towrite.append("%s: %s\r\n" % header)
 
             towrite.append("\r\n")
-            self.wfile.writelines(towrite)
+            msg = ''.join(towrite)
+            self.socket.sendall(msg)
             self.headers_sent = True
         else:
             super(WebSocketHandler, self).start_response(status, headers, exc_info)
             message = "Client using old/invalid protocol implementation"
             headers = [("Content-Length", str(len(message))),]
             self.start_response("400 Bad Request", headers)
-            self.write([message])
+            self.write(message)
             self.close_connection = True
             return
 
 
 setup(
     name="gevent-websocket",
-    version="0.2.2",
+    version="0.2.3",
     description="Websocket handler for the gevent pywsgi server, a Python network library",
     long_description=open("README.rst").read(),
     author="Jeffrey Gelens",
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.