@@ -270,7 +270,7 @@ def udp_packet_unpack(self, data):
270
270
data = self .cipher .datagram .decrypt (data ) if self .cipher else data
271
271
return self .jump .udp_packet_unpack (self .rproto .udp_unpack (data ))
272
272
def destination (self , host , port ):
273
- return self .host_name , self .port
273
+ return self .host_name , self .port if self . port != 0 else port
274
274
def udp_prepare_connection (self , host , port , data ):
275
275
data = self .jump .udp_prepare_connection (host , port , data )
276
276
whost , wport = self .jump .destination (host , port )
@@ -289,7 +289,7 @@ def wait_open_connection(self, host, port, local_addr, family):
289
289
if self .unix :
290
290
return asyncio .open_unix_connection (path = self .bind )
291
291
else :
292
- return asyncio .open_connection (host = self .host_name , port = self .port , local_addr = local_addr , family = family )
292
+ return asyncio .open_connection (host = self .host_name , port = self .port if self . port != 0 else port , local_addr = local_addr , family = family )
293
293
async def prepare_connection (self , reader_remote , writer_remote , host , port ):
294
294
reader_remote , writer_remote = proto .sslwrap (reader_remote , writer_remote , self .sslclient , False , self .host_name )
295
295
_ , writer_cipher_r = await prepare_ciphers (self .cipher , reader_remote , writer_remote , self .bind )
0 commit comments