Fix socks5 problem:
receive() returns bytes, not str
This commit is contained in:
		
							parent
							
								
									bda11b7d39
								
							
						
					
					
						commit
						f8383954e3
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -145,10 +145,10 @@ class SocksQueue:
 | 
				
			||||||
                self.add_sockobj(account, socks5obj)
 | 
					                self.add_sockobj(account, socks5obj)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                if 'candidate_id' in streamhost:
 | 
					                if 'candidate_id' in streamhost:
 | 
				
			||||||
                    log.debug('Trying to connect as sender to cid' + \
 | 
					                    log.debug('Trying to connect as sender to cid ' + \
 | 
				
			||||||
                        streamhost['candidate_id'])
 | 
					                        streamhost['candidate_id'])
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    log.debug('Trying to connect as sender to jid' + \
 | 
					                    log.debug('Trying to connect as sender to jid ' + \
 | 
				
			||||||
                        streamhost['jid'])
 | 
					                        streamhost['jid'])
 | 
				
			||||||
                if file_props.sha_str:
 | 
					                if file_props.sha_str:
 | 
				
			||||||
                    idx = file_props.sha_str
 | 
					                    idx = file_props.sha_str
 | 
				
			||||||
| 
						 | 
					@ -1208,7 +1208,7 @@ class Socks5Client(Socks5):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        result = 1
 | 
					        result = 1
 | 
				
			||||||
        buff = self.receive()
 | 
					        buff = self.receive()
 | 
				
			||||||
        if buff == '':
 | 
					        if buff == b'':
 | 
				
			||||||
            # end connection
 | 
					            # end connection
 | 
				
			||||||
            self.pollend()
 | 
					            self.pollend()
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue