def get_channel_data(self, sock): try: tlv_header = relay.recvall(sock, 4) channel_id, tlv_data_len = unpack('<HH', tlv_header) data = relay.recvall(sock, tlv_data_len) except socket.error as (code, msg): logger.debug('Exception on receiving tlv message from remote side. Exiting') logger.debug('Errno: {0} Msg: {1}'.format(errno.errorcode[code], msg)) raise relay.RelayError
def handle_new_socks_connection(self, sock): try: data = relay.recvall(sock, 9) if data[-1] != '\x00': logger.debug('Error receiving socks header: corrupted header') raise relay.RelayError except socket.error as (code, msg): logger.debug('Error receiving socks header {} {}'.format( errno.errorcode[code], msg)) raise relay.RelayError