rest.py

changeset 95
af912f53649c
parent 94
2c93636202a5
child 96
24f0b13e87d3
equal deleted inserted replaced
94:2c93636202a5 95:af912f53649c
110 httpdata = '' 110 httpdata = ''
111 writebuffer = '' 111 writebuffer = ''
112 address = None 112 address = None
113 113
114 def __init__ (self, conn, address): 114 def __init__ (self, conn, address):
115 asyncore.dispatcher.__init__ (self, conn) 115 asyncore.dispatcher.__init__ (self, conn, address)
116 self.socket = ssl.wrap_socket (conn, server_side=True, keyfile='key.pem', 116 self.socket = ssl.wrap_socket (conn, server_side=True, keyfile='key.pem',
117 certfile='cert.pem', do_handshake_on_connect=False) 117 certfile='cert.pem', do_handshake_on_connect=False)
118 self.socket.setblocking (0) 118 self.socket.setblocking (0)
119 self.address = address 119 self.address = address
120 print 'Initialized connection handler for %s' % type (address) 120 print 'Initialized connection handler for %s' % type (address)
191 return 191 return
192 192
193 Irc.broadcast ('REST connection from %s:%s' % address) 193 Irc.broadcast ('REST connection from %s:%s' % address)
194 conn = RESTConnection (sock, address) 194 conn = RESTConnection (sock, address)
195 195
196 if conn.address == None:
197 conn.__init__ (sock, address) # eh?
198
199 def handle_error (self): 196 def handle_error (self):
200 return 197 return

mercurial