387 Commits
Author SHA1 Message Date
Guoqiang Liuandsuch-gitea 6d9aca92f1 net: detect half-closed sockets before connection reuse
Detect peer EOF and TLS closure before reusing idle connections. Make
disconnect idempotent while preserving buffered data and pending operation
lifetimes.

Keep the release branch's multi-byte recv_n behavior, and cover partial EOF,
socket modes, and TLS shutdown with loopback regression tests. Use fixed
test certificates and retain compatibility with the release branch's
Google Test version.

Co-authored-by: woodser <13068859+woodser@users.noreply.github.com>
(cherry picked from commit 096abdaa22b71ade9ca673ed8012c500cecb58d3)
2026-10-04 18:50:24 -04:00
j-bermanandsuch-gitea 16d9fb5336 p2p: don't reset timeout timer for handshakes
The handshake timeout should just be an absolute timeout, we don't
care about partial messages received during the handshake.

(cherry picked from commit c7c43686878166cd0b93bed0cc712c8dd9845c89)
2026-10-04 18:50:24 -04:00
selstaandsuch-gitea 01a7c14a82 epee: prevent log injection from malformed HTTP headers
(cherry picked from commit 281c1d41aae7b579fa1307d82622e18abcd038ff)
2026-10-04 18:50:23 -04:00
woodserandsuch-gitea 5fe3caa4d9 wallet2: abort in-flight daemon request on shutdown
(cherry picked from commit 3c0980f5991a3cc27f7b3890cb68251c971a4b07)
2026-10-04 18:50:23 -04:00
selstaandsuch-gitea 16f7dfef75 epee: prevent JSON parser log injection
(cherry picked from commit 1b82d32a2f18efde834531a1be28b0f711a495e6)
2026-10-04 18:50:23 -04:00
j-bermanandsuch-gitea f2a8c47410 p2p: use a bool for send()
Identified by @selsta

Callers can otherwise misinterpret int -1 as truthy success,
e.g. see make_payload_send_txs

(cherry picked from commit 9bf193728bb11beb9c40e06a0d48d1c697fe7a84)
2026-10-04 18:50:22 -04:00
selstaandsuch-gitea f26ac02df9 p2p, rpc: group public IPv6 connection limits by /64
(cherry picked from commit f277d328cf1f7e64423b5eb7dc0e21649f71e47a)
2026-10-04 18:50:22 -04:00
Lee Clagettandsuch-gitea e4d52af5c7 Fix stall issues with p2p
(cherry picked from commit f618ee1136fa11d0611229a81d9c2838cc9db737)
2026-10-04 18:50:22 -04:00
selstaandsuch-gitea af216147b0 p2p: stop buffered dispatch after fatal notifications
(cherry picked from commit f397f3920998aa8f57f86c9539fd720d288c7e18)
2026-10-04 18:50:22 -04:00
selstaandsuch-gitea 7d1d93d168 epee: avoid bad_weak_ptr during connection teardown
foreach_connection() can race with connection destruction while the
protocol handler remains in the raw-pointer map. Use the non-throwing
weak_from_this().lock() in add_ref() and treat expired connections as
unavailable.

This is an interim mitigation pending the broader connection lifetime
fix in PR 7345.

(cherry picked from commit 146f801063b85e23b635c235100cc241e4ab626a)
2026-10-04 18:50:21 -04:00
selstaandsuch-gitea bcdb7c1075 http: share deterministic header field parser
(cherry picked from commit d2e4cbcda578152d9640a1aafa97a527f48a1380)
2026-10-04 18:50:20 -04:00
selstaandsuch-gitea d171742ed6 p2p: close zone connections before stopping net servers
(cherry picked from commit b7ca9e73f23cfb0ce1e795b2074ad12af56b04e3)
2026-10-04 18:50:20 -04:00
selstaandsuch-gitea 1e17dc299a p2p: make stop signal idempotent
(cherry picked from commit ec60113e09d9fc985b1c35fe1c579ef73c067d91)
2026-10-04 18:50:20 -04:00
jeffro256andsuch-gitea 35a6aabcee contrib: fix unaligned&aliased levin buffer reads
Co-authored-by: selsta <selsta@users.noreply.github.com>
(cherry picked from commit 98b350f7a15997f5866c413c16b07e2ee6348922)
2026-10-04 18:50:20 -04:00
iuyua9andsuch-gitea a99f104fc0 epee: skip IPv4 TOS option for non-IPv4 peers
(cherry picked from commit 2a6f64d8faad464c9cecc9c317b06f00f96f4578)
2026-10-04 18:50:19 -04:00
j-bermanandsuch-gitea b56c56d807 p2p: cleaner connection close()
(cherry picked from commit c5c9420d8cc9b5b44fd6dc177b3cac773e5e1674)
2026-10-04 18:50:19 -04:00
j-bermanandjwinterm bc0b6d8c4a p2p: wait_for on shutdown instead of indefinite wait
(cherry picked from commit bf314b7ab1611c98476265a938163f2966150483)
2026-05-06 10:52:36 -04:00
j-bermanandjwinterm ef41a9677c connection: try-catch handles
(cherry picked from commit 14e333217e968416a521568ed2ef4868bb162b26)
2026-05-05 18:20:53 -04:00
j-bermanandjwinterm e69533337b p2p: fix hanging shutdown
(cherry picked from commit 7bc2d5a42e8462f2a04f71bd59111a863fa9a6d8)
2026-05-05 18:20:52 -04:00
Lee *!* Clagettandjwinterm e16f0a2c28 Cleanup some of the fragmented levin handling
(cherry picked from commit 017c9022d7bbc03484191177228657b14fb09f53)
2026-05-05 18:20:52 -04:00
selstaandjwinterm a3a824d288 abstract_tcp_server2: add missing return
(cherry picked from commit f60b400917a6d2fecc6c03524c70fbd9e033f436)
2026-05-05 18:19:54 -04:00
j-bermanandjwinterm 0544146ff3 p2p: connection patches
- Make sure the server sends a complete response when the client
includes the "Connection: close" header.
- Make sure the server terminates in `m_strand` to avoid
concurrent socket closure and ops processing.

(cherry picked from commit ee9e4a49baae0319f6cab543979e221f251339a3)
2026-05-05 18:19:53 -04:00
tobtohtandjwinterm e9fde467bd epee: add missing cstdint include
(cherry picked from commit 7baf2bde6ecad1e13848fdbd9d4db026ca0ff8fc)
2026-05-05 18:19:53 -04:00
Lee *!* Clagett e23b759b37 Skip ping connections in outgoing count 2025-08-19 17:16:05 -04:00
Lee *!* Clagett 9f3d96eba6 Add check for exception in tcp accept handler 2025-06-12 17:48:49 -04:00
Lee *!* Clagett 4acc0ea41f Limit scope of TCP checks to incoming only 2025-02-26 13:09:20 -05:00
Lee *!* Clagett 01bcd52924 Fix build with boost ASIO 0.87. Support boost 1.66+ 2025-02-14 13:29:57 -05:00
Lee *!* Clagett 13ff355cf6 Set response limits on http server connections 2025-02-14 00:21:05 -05:00
Jeffrey RyanandLee *!* Clagett 89fa3ed68a epee: update 'http_server_handlers_map2.h' macros to use fully qualified names
quick patch which fixes the issue where if you use some macros from `http_server_handlers_map2.h` you have to be in the `epee` namespace or it doesn't compile. Now can remove `using namespace epee;` from header file `core_rpc_server.h`, which caused a couple of name qualifying mistakes
2025-02-13 16:24:48 -05:00
tobtoht 00e582a2b1 Merge pull request #9460
0cd74568d Cleanup TCP throttling code (performance) + move connection checks (Lee *!* Clagett)
2025-01-22 22:47:10 +00:00
Lee *!* Clagett 0cd74568d6 Cleanup TCP throttling code (performance) + move connection checks 2024-12-19 20:54:22 -05:00
0xFFFC0000andBoog900 13df862535 contrib: force (de)serialization to create params section incase there is none.
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-12-13 19:49:55 +00:00
jeffro256 c7cf489585 Revert "http_client: reduce number of packets sent for small bodies"
This reverts commit e0b2123c32.
2024-03-10 23:08:17 -05:00
jeffro256 e0b2123c32 http_client: reduce number of packets sent for small bodies 2023-10-15 01:33:38 -05:00
j-bermanandselsta 438554e1ab properly terminate interrupted TCP connection. fixes #8685 2023-06-09 21:11:13 +02:00
luigi1111 b6a029f222 Merge pull request #8435
cf3be99 Template hash func to fix compiler error on < gcc-6 (j-berman)
2022-07-15 11:43:15 -04:00
j-berman cf3be9926f Template hash func to fix compiler error on < gcc-6 2022-07-13 22:44:43 -07:00
j-berman a82fba4b7b address PR comments 2022-07-08 15:10:03 -07:00
anonandj-berman 3be1dbd096 connection: fix implementation 2022-07-05 22:33:34 -07:00
luigi1111 9e71901346 Merge pull request #8301
6ef945d Doxygen: Hide anonymous namespaces from documentation by default (Jeffrey)
2022-05-10 16:55:36 -05:00
luigi1111 7cdbd25042 Merge pull request #8279
f7d50cb EPEE: Remove gzip_encoding.h (Jeffrey)
2022-05-10 16:50:17 -05:00
Jeffrey 6ef945d9a5 Doxygen: Hide anonymous namespaces from documentation by default
Bonus: little doc fix for net_ssl.h
2022-04-28 19:35:49 -05:00
Jeffrey f7d50cbaa8 EPEE: Remove gzip_encoding.h 2022-04-22 14:32:56 -05:00
moneromooo-monero 9209880e9c add a sanity check to RPC input data size
reported by m31007
2022-04-21 22:22:56 +00:00
Jeffrey b49ed59166 Remove the only 4 non-UTF8 characters in codebase
Relevant commit in old PR:
1b798a7042070cc8063bd341ebf7025da554b632
2022-04-18 09:55:21 -05:00
Jeffrey 801568d0c6 Refactor out to_nonconst_iterator.h
Relevant commit on old PR:
2499269696192ce30dd125ddee90a80d4326dff9
2022-04-18 09:55:21 -05:00
Jeffrey 87ec36cacf Refactor out pragma_comp_defs
Relevant commits on the old cleanup PR:
36933c7f5c7778e2d7fbfea5361c11fb41070467
21e43de0f300ee47b7e597098908601bf591950b
3c678bb1cedfd7b865ac2e7aaf014de4bfb3eb3d
2022-04-18 09:55:21 -05:00
Jeffrey 441c860738 Merge functionality of misc_os_dependent into time_helper.h
Actions:
1. Remove unused functions from misc_os_dependent.h
2. Move three remaining functions, get_gmt_time, get_ns_count, and get_tick_count into time_helper.h
3. Remove unused functions from time_helper.h
4. Refactor get_ns_count and get_internet_time_str and get_time_interval_string
5. Remove/add includes as needed

Relevant commits on the old PR:
a9fbe52b02ffab451e90c977459fea4642731cd1
9a59b131c4ed1be8afe238fff3780fe203c65a46
7fa9e2817df9b9ef3f0290f7f86357939829e588
2022-04-18 09:55:21 -05:00
Jeffrey 12b1b74d32 Trimming Fat
Remove unused include statements or unused definitions.
2022-04-18 09:55:20 -05:00
Jeffrey 690ce560b0 Boring Old Deletes
Here lies dozens of unused files. This commit is ONLY file deletions except
for the removing of a couple of #includes and removing filenames from CmakeLists
where appropriate.
2022-04-18 09:55:20 -05:00