Commit graph

95 commits

Author SHA1 Message Date
wulan17
2212b98b81
pyrofork: Retrive dc address and port from GetConfig
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-06-26 20:41:48 +07:00
wulan17
2c3fb1caa6
Revert "fix: handle connection closure and retry logic in session management"
This reverts commit 4df4478a80.

Signed-off-by: wulan17 <wulan17@komodos.id>
2025-05-18 19:57:20 +07:00
Hitalo M.
4df4478a80
fix: handle connection closure and retry logic in session management
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-05-14 20:48:30 +07:00
wulan17
8655deb92c
pyrofork: moar cleanups
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-04-03 22:31:37 +07:00
wulan17
3e24f006e0
pyrofork: Cleanup codes
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-03-29 00:25:16 +07:00
Artem Ukolov
bb4ea00d4e
Implement non-blocking TCP connection (KurimuzonAkuma/pyrogram#71)
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2024-06-23 16:59:32 +07:00
wulan17
1b3f0933c7
Pyrofork: Update Copyright headers
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2024-02-07 20:25:08 +07:00
wulan17
9e82bd0b57
Pyrofork: Add alt_port parameter to Client
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-08-18 03:30:28 +07:00
Dan
283246a6b8 Change connection mode 2023-01-12 18:25:10 +01:00
Dan
d53e1c235b Lower the logging level of some log calls 2023-01-09 15:19:55 +01:00
Dan
1daa05a35c Raise and handle send errors in order to immediately act upon 2022-12-28 00:21:05 +01:00
Dan
2dca5aeac2 Handle proxy socket connections using thread executors 2022-12-28 00:14:04 +01:00
Dan
cf06939a55 Workaround proxy sockets not timing out properly 2022-12-27 22:23:05 +01:00
Dan
9bf742abc0 Introduce back some previously reverted changes 2022-12-27 13:40:42 +01:00
Dan
bff583ed75 Revert some of the latest changes 2022-12-26 22:26:55 +01:00
Dan
8b87c6ace3 Update tcp.py 2022-12-26 16:48:03 +01:00
Dan
7182a7cff7 Update connection.py 2022-12-26 16:29:05 +01:00
Dan
dd4e41f63f Make the use of proxies an optional dependency 2022-12-26 16:28:06 +01:00
Dan
6aae3a9c77 Always use non-blocking sockets 2022-12-26 16:25:22 +01:00
Dan
9ee1807e42 Don't raise write() and close() exceptions 2022-12-26 16:23:57 +01:00
Dan
c7d362990f Add back a reference to the loop 2022-12-24 17:53:24 +01:00
Dan
f12005b5d0 Use Python's standard sockets in case of no proxy 2022-12-24 17:30:23 +01:00
Dan
deb560a051 Remove unused variables 2022-12-24 17:27:06 +01:00
Dan
1cb17152f8 Keep a timeout while connecting and set non-blocking afterwards
Also fix an await to None value
2022-12-24 17:15:10 +01:00
Dan
84d60b56b3 Switch to non-blocking sockets & use a send queue 2022-12-24 16:15:07 +01:00
Dan
761e4735d3 More nonce check fixes 2022-09-02 14:44:02 +02:00
Dan
88af58f246 Fix nonce checks 2022-09-02 14:25:13 +02:00
Dan
6736602424 Handle socket.connect() blocking-ness 2022-07-23 22:52:21 +02:00
Dan
124bcb4db7 Remove API key requirement for existing sessions 2022-04-24 11:56:07 +02:00
Dan
9279b67319 Display a more meaningful error message 2022-02-10 20:15:48 +01:00
Dan
84b0e15e2b Revert "Make Connection.send() raise the actual exception"
This reverts commit ed2db45a03.
2022-02-10 20:14:09 +01:00
Dan
ed2db45a03 Make Connection.send() raise the actual exception 2022-02-10 06:45:59 +01:00
Dan
dc6c816c80 Revert some of the last changes 2022-02-10 06:44:42 +01:00
Dan
03629d5ee9 Always try to reconnect within Connection 2022-02-10 04:25:36 +01:00
Dan
462e5d11a5 Improve stability in case of connection failures 2022-02-10 01:05:36 +01:00
Dan
626a1bd938 Update copyright year 2022-01-07 10:23:45 +01:00
Dan
8c8288412f Various improvements 2022-01-07 10:18:51 +01:00
Dan
a3e46b4957 Cleanup connection info logs 2021-05-03 21:07:36 +02:00
Dan
0c814e9e5e Add support for media DC IPs 2021-04-13 15:53:53 +02:00
Dan
a48d27f501 Always run crypto-related functions in the dedicated thread 2021-01-02 18:45:43 +01:00
Dan
7dda167c09 Update copyright notice
Year 2021
2021-01-01 22:58:48 +01:00
Alisson Lauffer
1dc4df8cb1
Improve typing hints (#537)
* Change type1 or type2 to Union[type1, type2]

* Address @KunoiSayami suggestions

* Change Union[type1, None] to Optional[type1]

* Update PR with latest commit changes

* Address Dan suggestions
2020-12-20 17:05:17 +01:00
Dan
844e53a70e Move crypto calls to threads in case of big enough chunks 2020-12-07 19:16:46 +01:00
Dan
3c8f41b1d2 Add more verbose error in case of network issues 2020-12-07 19:11:26 +01:00
Dan
538f1e3972 Deep rewrite: preparing for v1.0
- Pyrogram core is now fully asynchronous
- Ditched Python 3.5, welcome 3.6 as minimum version.
- Moved all types to pyrogram.types
- Turned the Filters class into a module (filters)
- Moved all filters to pyrogram.filters
- Moved all handlers to pyrogram.handlers
- Moved all emoji to pyrogram.emoji
- Renamed pyrogram.api to pyrogram.raw
- Clock is now synced with server's time
- Telegram schema updated to Layer 117
- Greatly improved the TL compiler (proper type-constructor hierarchy)
- Added "do not edit" warning in generated files
- Crypto parts are executed in a thread pool to avoid blocking the event loop
- idle() is now a separate function (it doesn't deal with Client instances)
- Async storage, async filters and async progress callback (optional, can be sync too)
- Added getpass back, for hidden password inputs
2020-08-22 08:05:05 +02:00
CyanBook
c8c6faa96e
Change logging hierarchy for loading plugins (#451)
Loading plugins shouldn't be considered a warning
2020-08-21 07:28:27 +02:00
Dan
2ba921c84d Workaround the occasional delayed stop of a Client instance 2020-03-30 16:59:22 +02:00
Dan
1996fb1481 Update Copyright 2020-03-21 15:43:32 +01:00
Dan
42c9bafa0c Update copyright notice 2020-02-01 14:04:33 +01:00
Dan
a015f998fa Revert "Stop instantiating logger objects and directly use the logging module"
This reverts commit 792068d7
2019-09-08 19:24:06 +02:00