Evgeny Poberezkin
2ff5f5a832
agent: add context to CMD error ( #1167 )
...
* agent: add context to CMD error
* tests, more warnings
* fix tests
* log TBQueue sizes
* log locks
* more logs
* log sendMessagesB
* fix test
* log length
* refactor
* remove logging
* revert lock scope change
* cleanup
* add string error to A_PROHIBITED
* remove
* remove test limitations
* language
2024-05-24 14:13:01 +01:00
Evgeny Poberezkin
e7a73a4c89
Merge branch 'stable'
2024-05-23 22:04:06 +01:00
Evgeny Poberezkin
6309f92c68
agent: fail if non-unique connection IDs are passed to sendMessages ( #1170 )
2024-05-23 22:01:57 +01:00
Evgeny Poberezkin
875a56b75a
Merge branch 'stable'
2024-05-23 16:48:11 +01:00
Alexander Bondarenko
984394d906
core: remove MonadUnliftIO ExceptT orphans ( #1169 )
2024-05-23 16:44:00 +01:00
Alexander Bondarenko
f6bb105536
utils: remove MonadError usage ( #1168 )
2024-05-23 12:47:30 +01:00
Evgeny Poberezkin
2b09ada392
agent: reduce interval for storing server connection errors to 3 seconds
2024-05-22 14:36:54 +01:00
Evgeny Poberezkin
8097df5540
agent: persist server connection error ( #1165 )
...
* agent: persist server connection
* comment, refactor
* fix tests, reduce interval for ntf server
* cleanup
* 0
2024-05-22 13:25:49 +01:00
Evgeny Poberezkin
5bff2f5537
Merge branch 'stable'
2024-05-21 23:42:49 +01:00
Evgeny Poberezkin
f50589b31a
agent: remove external timeout to resubscribe ( #1164 )
...
* agent: remove external timeout to resubscribe
* liftIO
* fix tests
2024-05-21 22:52:22 +01:00
Alexander Bondarenko
f50fa5c60b
smp-server: limit concurrency in proxy command processing ( #1162 )
...
* smp: put client proxy command processing threads under a shared semaphore
* add LIMITS.max_proc_threads to server config
* rename to PROXY.client_concurrency
* retry on strictly greater than max concurrency
* set default to 16
* rename
* fix limit
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-21 12:53:33 +01:00
Alexander Bondarenko
f89d715a99
smp server: add proxy stats ( #1157 )
...
* smp-server: add proxy counters
* count simplex.im messages
* update
* fix
* get own servers from INI
* remove export
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-20 17:07:33 +01:00
Alexander Bondarenko
8fe18c4f6d
core: use catMaybes to collect optional replies ( #1161 )
...
* core: use catMaybes to collect optional replies
* style
* rollback agent changes and add a note
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-20 15:48:21 +01:00
spaced4ndy
2e5433676e
xftp: check proxy before downloading from unknown server ( #1102 )
...
* xftp: check proxy before downloading from unknown server
* corrections
* remove import
* tests
* comment
* tests
* don't wrap into internal error
* fix tests
2024-05-20 14:14:04 +01:00
Evgeny Poberezkin
8b21f7ef2a
agent: aggregate multiple expired subscription responses into a single UP event ( #1160 )
...
* agent: aggregate multiple expired subscription responses into a single UP event
* clean up
* refactor processing of expired responses
* refactor
* refactor 2
* refactor unexpectedResponse
2024-05-20 07:56:51 +01:00
Evgeny Poberezkin
7a15ea59c9
Merge branch 'stable'
2024-05-19 07:58:00 +01:00
Evgeny Poberezkin
1bb6a5c43b
agent: do not increase network activity interval while offline ( #1159 )
...
* agent: do not increase network activity interval while offline
* test
2024-05-19 07:50:47 +01:00
Evgeny Poberezkin
077ca9c046
Merge branch 'stable'
2024-05-17 15:38:06 +01:00
Evgeny Poberezkin
33f6d2f1da
agent: optimize waiting for user network to avoid contention for state updates from multiple threads ( #1155 )
...
* haskell magic
* update
* agent: optimize waiting for user network with TChan
* clean up
* Int64
* use TVar
* cleanup
* fix
* testing
* update
2024-05-17 15:12:05 +01:00
spaced4ndy
b33e8f4370
agent: reconnect xftp clients ( #1156 )
2024-05-17 14:23:59 +01:00
Alexander Bondarenko
426f47c805
smp: use session vars for reconnecting small agent ( #1152 )
...
* smp: use session vars for reconnecting small agent
* process errors
* split session and protocol functions
* add active flag to agent
* actually invoke agent shutdown
* close proxy agent too
* restore stopping ntf subscribers
2024-05-16 19:06:27 +01:00
Evgeny Poberezkin
16d79da73e
config
2024-05-15 15:15:59 +01:00
Evgeny Poberezkin
6d19033375
proxy: remember server connection error for some time
2024-05-15 12:06:42 +01:00
Evgeny Poberezkin
2d2cc86bd8
Merge pull request #1095 from simplex-chat/proxy
...
SMP proxy feature branch
2024-05-14 21:35:51 +01:00
Evgeny Poberezkin
f51cf1deac
agent: use MVar for DB connection for more fair connection distribution between threads ( #1147 )
2024-05-14 20:04:51 +01:00
spaced4ndy
00a2dde727
Merge branch 'master' into proxy
2024-05-14 10:41:06 +04:00
Evgeny Poberezkin
512afa1e2b
agent: count received duplicate messages ( #1148 )
...
* agent: count received duplicate messages
* count total too
* names
* fix
* tuple
2024-05-13 15:16:20 +01:00
Evgeny Poberezkin
c4c983348f
Merge branch 'master' into proxy
2024-05-13 14:13:52 +01:00
Evgeny Poberezkin
4455b8bd0e
agent: do not throw exception when command is created for deleted connection ( #1150 )
...
* agent: do not throw exception when command is created for deleted connection
* convert database busy/locked to critical alert
2024-05-13 08:10:40 +01:00
Evgeny Poberezkin
66c916dbb3
proxy: increase client timeout for proxied commands ( #1145 )
2024-05-12 21:12:01 +01:00
Evgeny Poberezkin
91cc48aabe
agent: do not mark subscriptions on expired sessions as active, mark delayed subscriptions as active on the same session, do not cancel sending expired commands ( #1127 )
...
* agent: do not mark subscriptions on expired sessions as active, do mark delayed subscriptions as active on the same session, SUBOK response in the next SMP protocol version
* client: prevent sub actions from zombie sessions (#1122 )
* client: prevent sub actions from zombie sessions
* error handling
* add AERR to pass background errors to client
* switch to activeClientSession
* put closeClient under activeClientSession
* rename
* remove AERR, do not skip processing
* move check and state update to one transaction
* catch extra UPs
* fix
* check queue is still pending before making it active
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
* do not forward agent error
* revert not expiring sending subs
* fixes
* track subscription responses better
* add pending connection
* Revert "revert not expiring sending subs"
This reverts commit 4310a69391 .
* do not expire sending commands
* rename
* fix race
* function
---------
Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com >
2024-05-12 17:47:08 +01:00
Evgeny Poberezkin
103ae06d55
agent: remove critical error on subscription timeout ( #1146 )
2024-05-11 23:38:27 +01:00
Evgeny Poberezkin
8516b0dd5b
proxy: negotiate client-relay version, include it in PFWD commands and in encrypted forwarded transmissions ( #1144 )
...
* proxy: negotiate client-relay version, include it in PFWD commands and in encrypted forwarded transmissions
* rename
* inline
* comment
* use correct server version when encoding forwarded commands
2024-05-11 17:11:28 +01:00
Evgeny Poberezkin
9f72b249b4
Merge branch 'master' into proxy
2024-05-11 10:25:35 +01:00
Evgeny Poberezkin
727fd8b8f5
server: more efficient response to batched subscriptions ( #1141 )
...
* server: more efficient response to batched subscriptions
* add sndMsgQ for interleaving messages with replies
* remove redundant liftIO
* refactor
* refactor2
* rename
* fix
* diff
* remove comment
* remove comment
---------
Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com >
2024-05-10 22:19:11 +01:00
Evgeny Poberezkin
b7afb725fd
proxy: send MWARN event to user on server version or host more errors ( #1140 )
...
* proxy: include delivery path in SENT event
* send MWARN event to user on server version or host more errors
* Revert "proxy: include delivery path in SENT event"
This reverts commit 5c476718ec .
2024-05-10 10:55:19 +01:00
Evgeny Poberezkin
b48215d341
proxy: additional configuration for SOCKS proxy usage in SMP proxy client ( #1138 )
...
* proxy: additional configuration for SOCKS proxy usage in SMP proxy client
* update
2024-05-09 15:36:02 +01:00
Evgeny Poberezkin
5cafd9d5c4
server: more efficient responses to batch subscriptions ( #1137 )
...
* server: more efficient responses to batch subscriptions
* comments
* comment
* enable tests
* LogError
2024-05-09 09:20:57 +01:00
Evgeny Poberezkin
817fd77332
Merge branch 'master' into proxy
2024-05-08 23:00:53 +01:00
Evgeny Poberezkin
b27f126bab
include server version range in transport handle ( #1135 )
...
* include server version range in transport handle
* xftp handshake
* remove coment
* simplify
* comments
2024-05-08 23:00:00 +01:00
Evgeny Poberezkin
ea21b296fd
agent: reset error count and do not report errors when consequitive timeouts happen while offline ( #1136 )
...
* agent: reset error count and do not report errors when consequitive timeouts happen while offline
* refactor
* comment
2024-05-08 15:33:51 +01:00
spaced4ndy
3f57d54832
xftp: catch exceptions in chunk download ( #1133 )
2024-05-08 16:57:04 +04:00
Evgeny Poberezkin
b40654c95d
update agent to v7/v2 SMP/NTF protocol versions ( #997 )
...
* update agent to v7/v2 SMP/NTF protocol versions
2024-05-08 13:05:06 +01:00
Evgeny Poberezkin
6d471b8be2
Merge branch 'master' into proxy
2024-05-08 00:14:06 +01:00
Alexander Bondarenko
7a07076277
transport: require ALPN for extended handshakes ( #1134 )
...
* transport: require ALPN for extended handshakes
* fix 8.10 build
* rename
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-08 00:06:09 +01:00
Evgeny Poberezkin
a70f492f4d
proxy: fallback to direct connection if destination relay does not support proxy protocol ( #1132 )
...
* proxy: fallback to direct connection if destination relay does not support proxy protocol
* move version to TransportError, refactor
2024-05-07 13:37:40 +01:00
Alexander Bondarenko
c85f6a2f0e
proxy: reporting errors ( #1108 )
...
* smp-proxy: iron out errors
* treat proxy timeouts as temporary
* update errors
* proxy errors (missing encoding)
* update
* enable tests
* update
* update
* fix
* fix
* simplify
* test
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-06 22:00:42 +01:00
Evgeny Poberezkin
f22daf5cb6
Merge branch 'master' into proxy
2024-05-06 15:26:11 +01:00
Evgeny Poberezkin
e13b0df539
client: remove TLS handshake timeout ( #1129 )
...
* client: remove TLS handshake timeout
* remove comment
2024-05-05 17:05:51 +01:00
Evgeny Poberezkin
ee8e4067b0
agent: prepare connection record before joining to prevent race conditions ( #1128 )
...
* agent: prepare connection record before joining to prevent race conditions
* prepare connection for contact address as well
* clean up
2024-05-05 12:12:19 +01:00