File tree Expand file tree Collapse file tree
pyrogram/connection/transport/tcp Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626class TCPAbridged (TCP ):
2727 def __init__ (self , proxy : dict ):
2828 super ().__init__ (proxy )
29- self .is_first_packet = None
3029
3130 def connect (self , address : tuple ):
3231 super ().connect (address )
33- self .is_first_packet = True
32+ super ().sendall (b"\xef " )
33+
3434 log .info ("Connected{}!" .format (" with proxy" if self .proxy_enabled else "" ))
3535
3636 def sendall (self , data : bytes , * args ):
3737 length = len (data ) // 4
3838
39- data = (
40- bytes ([length ]) + data
41- if length <= 126
42- else b"\x7f " + int .to_bytes (length , 3 , "little" ) + data
39+ super ().sendall (
40+ (bytes ([length ])
41+ if length <= 126
42+ else b"\x7f " + length .to_bytes (3 , "little" ))
43+ + data
4344 )
4445
45- if self .is_first_packet :
46- data = b"\xef " + data
47- self .is_first_packet = False
48-
49- super ().sendall (data )
50-
5146 def recvall (self , length : int = 0 ) -> bytes or None :
5247 length = super ().recvall (1 )
5348
You can’t perform that action at this time.
0 commit comments