Commits

Jeffrey Gelens committed b5da9e1

More fixes for latest gevent version

  • Participants
  • Parent commits 8e23fe7
  • Branches stable
  • Tags 0.2.3

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",