(self, sock)
| 181 | |
| 182 | # Handle incoming connection |
| 183 | def handleIncomingConnection(self, sock): |
| 184 | self.log("Incoming connection...") |
| 185 | |
| 186 | if "TCP_NODELAY" in dir(socket): |
| 187 | sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) |
| 188 | |
| 189 | self.type = "in" |
| 190 | if self.ip not in config.ip_local: # Clearnet: Check implicit SSL |
| 191 | try: |
| 192 | first_byte = sock.recv(1, gevent.socket.MSG_PEEK) |
| 193 | if first_byte == b"\x16": |
| 194 | self.log("Crypt in connection using implicit SSL") |
| 195 | self.sock = CryptConnection.manager.wrapSocket(self.sock, "tls-rsa", True) |
| 196 | self.sock_wrapped = True |
| 197 | self.crypt = "tls-rsa" |
| 198 | except Exception as err: |
| 199 | self.log("Socket peek error: %s" % Debug.formatException(err)) |
| 200 | self.messageLoop() |
| 201 | |
| 202 | def getMsgpackUnpacker(self): |
| 203 | if self.handshake and self.handshake.get("use_bin_type"): |
no test coverage detected