mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Rename TCP protocol impl files
This commit is contained in:
parent
c5911a6f6b
commit
1cd7e28b50
@ -27,15 +27,15 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class Connection:
|
class Connection:
|
||||||
MODES = {
|
MODES = {
|
||||||
0: Full,
|
0: TCPFull,
|
||||||
1: Abridged,
|
1: TCPAbridged,
|
||||||
2: Intermediate
|
2: TCPIntermediate
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, address: tuple, proxy: dict, mode: int = 1):
|
def __init__(self, address: tuple, proxy: dict, mode: int = 1):
|
||||||
self.address = address
|
self.address = address
|
||||||
self.proxy = proxy
|
self.proxy = proxy
|
||||||
self.mode = self.MODES.get(mode, Abridged)
|
self.mode = self.MODES.get(mode, TCPAbridged)
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from .abridged import Abridged
|
from .tcp_abridged import TCPAbridged
|
||||||
from .full import Full
|
from .tcp_full import TCPFull
|
||||||
from .intermediate import Intermediate
|
from .tcp_intermediate import TCPIntermediate
|
||||||
|
@ -23,7 +23,7 @@ from .tcp import TCP
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Abridged(TCP):
|
class TCPAbridged(TCP):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(proxy)
|
||||||
|
|
@ -25,7 +25,7 @@ from .tcp import TCP
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Full(TCP):
|
class TCPFull(TCP):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(proxy)
|
||||||
self.seq_no = None
|
self.seq_no = None
|
@ -19,12 +19,12 @@
|
|||||||
import logging
|
import logging
|
||||||
from struct import pack, unpack
|
from struct import pack, unpack
|
||||||
|
|
||||||
from .abridged import TCP
|
from .tcp import TCP
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Intermediate(TCP):
|
class TCPIntermediate(TCP):
|
||||||
def __init__(self, proxy: dict):
|
def __init__(self, proxy: dict):
|
||||||
super().__init__(proxy)
|
super().__init__(proxy)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user