Commit Graph

1745 Commits

Author SHA1 Message Date
rakshasa 7104512ac1 Stuff. 2026-09-01 17:10:29 +02:00
rakshasa bd82f6152e Stuff. 2026-09-01 16:40:37 +02:00
rakshasa 83eb4e016a Stuff. 2026-09-01 16:16:30 +02:00
rakshasa 6b60c219fa Stuff. 2026-08-31 09:52:34 +02:00
Jari Sundell 2804be2c9c Optionally sanitize download and file names by replacing slash with underscore. 2026-08-29 18:31:16 +09:00
noctuum 21019fde41 Add the download to the stopped view when a hash check contradicts d.complete.
Setting d.state alone left it in the started view, where d.start cannot restore it.
2026-08-28 09:31:55 +02:00
noctuum e4e858cc40 Stop the download in close_directly() rather than leaving the state behind.
It closed the files while d.state and the started view still called it running.
2026-08-28 09:31:55 +02:00
noctuum 60eb8f0383 Split the file closing in DownloadList::close_directly() into close_files().
Callers that only need the files released should not depend on how a stop behaves.
2026-08-28 09:31:55 +02:00
Jari Sundell 072cbae0c6 Expose system.files.close_idle for FileManager idle FD timeout by @j-c-m 2026-08-28 03:18:25 +09:00
xirvik 16bfaf2694 Reject an XMLRPC size limit above the SCGI content size limit. 2026-08-27 10:48:26 +02:00
xirvik c8da93bd30 Warn that pieces.sync.timeout_safe.set is no longer supported. 2026-08-26 11:21:14 +02:00
xirvik 2cd3ca052d Pass the gz flag to log.append_gz_file. 2026-08-26 10:54:22 +02:00
xirvik 8be1fcb3a4 Return m_use_fsyncdisk from SessionManager::use_fsyncdisk.
system.files.session.fdatasync always reported true even when disabled.
2026-08-26 10:32:12 +02:00
rakshasa 109a20c09c Tagged release 0.16.21. v0.16.21 2026-08-26 08:51:40 +02:00
xirvik ac1b2685d5 Guard the value suffixes against negative overflow.
The k, m and g guards only checked the positive side, so -4611686018427387904K became 0.
2026-08-24 08:57:58 +02:00
xirvik d7b2cfe4f2 Clamp the elapsed time conversion instead of overflowing.
convert.elapsed_time subtracted an unchecked value from the cached seconds.
2026-08-24 08:24:20 +02:00
xirvik dcfbf82a38 Mark view.list and the system.time getters as untrusted safe.
Read-only getters a client needs to list views and make sense of timestamps.
2026-08-24 07:37:23 +02:00
xirvik 3ae91b6536 Check flag_public_rpc when dispatching jsonrpc calls.
Private commands and non-exported redirects were reachable over jsonrpc.
2026-08-19 19:11:53 +02:00
xirvik af6d8a10ad Add a timeout to scgi tasks.
A hundred connections sending a partial header held the whole task pool.
2026-08-18 12:25:58 +02:00
xirvik 9066afc063 Guard the unit multiplication in value commands against overflow.
The kb variants multiply the argument by 1024 without checking the range.
2026-08-18 11:58:47 +02:00
xirvik a2fabb10de Range check the socket allocation and size values.
int64 arguments were truncated into uint32 setters, so -1 became 4294967295.
2026-08-18 11:38:01 +02:00
xirvik 13e073d9ff Reject division overflow in math.div and math.mod.
Dividing the smallest integer by -1 traps and takes the process with it.
2026-08-18 11:12:33 +02:00
xirvik d73f245692 Add a depth limit to the command parser.
A million nested braces in one argument exhausted the main thread's stack.
2026-08-18 10:52:38 +02:00
xirvik 7db356cae4 Add a depth limit to json_to_object.
Deeply nested params recursed until the main thread's stack was exhausted.
2026-08-18 10:34:07 +02:00
Auska 8378c0a83a Fix review: mark ipv4/ipv6 local_port safe, dedup port validation
- mark network.local_port.ipv4/ipv6 safe for untrusted RPC connections (mark_safe matches exact command keys).
- Replace duplicated multi-line port validation with a shared checked_local_port_value helper and single-line lambdas.
2026-08-17 11:29:50 +02:00
Auska 4c6f7afdc7 Add network.local_port commands for tracker port reporting
Mirror the network.local_address.* command family for ports:
- network.local_port            report the best-match local port
- network.local_port.set        set both the ipv4 and ipv6 local ports
- network.local_port.ipv4(.set) get/set the ipv4 local port only
- network.local_port.ipv6(.set) get/set the ipv6 local port only

Values are restricted to 0-65535; 0 (default) means unset, and trackers
then report the listening port.

Why: behind multiple layers of NAT the port peers must connect to can
differ from the port rtorrent is listening on. These commands let the
user manually advertise the forwarded public port per address family,
e.g.:
    network.local_port.ipv4.set = 6881
    network.local_port.ipv6.set = 6882

network.local_port is marked safe for RPC use alongside
network.local_address.
2026-08-17 11:29:50 +02:00
xirvik 385e149ccc Let the download list own its downloads through a shared pointer.
A multicall could then dispatch commands on an erased download.
2026-08-17 10:40:41 +02:00
rakshasa 58e627f2be Fixed '-i <ip>' command line argument. 2026-08-16 14:11:01 +02:00
xirvik 9ff0cd28d5 Add schedule.if_absent for clients that re-register periodic tasks.
schedule restarts a re-registered task's countdown, if_absent keeps the existing entry.
2026-08-16 13:36:19 +02:00
Jacob Reynolds 5e7dd98c67 Update rtorrent.rc.lua-example to use new network.listen.port.x commands
See #1935
2026-08-14 16:35:20 +02:00
xirvik b24db0eaa5 Do not dereference missing text nodes in the tinyxml2 backend.
Empty elements and element children crashed the parser on a null.
2026-08-14 13:16:17 +02:00
Jari Sundell 6fa139f7bf Reduce max_string_pad_size from 1<<20 to 1<<14 2026-08-14 12:46:37 +02:00
xirvik 68904ba005 Limit the padding string.rpad and string.lpad will build.
An untrusted caller could exhaust memory or the response limit.
2026-08-14 12:46:37 +02:00
xirvik b401068246 Let the choke group list own its groups.
Each choke_group.insert leaked a group, and size reported a stale copy.
2026-08-14 12:15:36 +02:00
xirvik 946a4b5c83 Check the focus iterator before dereferencing it on erase.
Erasing a download read past the end of the view.
2026-08-13 19:30:21 +02:00
xirvik a075001a73 Catch every json exception when processing a JSONRPC request.
A number overflow escaped the two handlers and killed the process.
2026-08-12 18:22:17 +02:00
xirvik 781520fef8 Close the connection when an SCGI header does not fit the buffer.
A malformed header aborted the process from the SCGI thread.
2026-08-12 15:48:39 +02:00
kunalkakade 224f06fdc2 Link against libatomic when 64-bit atomics require it. 2026-08-09 12:06:08 +02:00
xirvik 324811d6f0 Do not fail startup on unreadable session files.
The download is flagged as hash failed with a message instead of throwing.
2026-08-09 10:39:55 +02:00
Jari Sundell e51fad5bd2 Clean up comments in root.h
Removed comments regarding input history size limitations.
2026-08-09 10:19:35 +02:00
xirvik 44bb2d691f ui: bound the input history size.
Only the lower end was checked, so a large value threw bad_alloc and exited.
2026-08-09 10:19:35 +02:00
xirvik 161a36dedd Add system.sockets.<category>.min_alloc.limit.
A category can have a lower bound too, and a client needs to read it.
2026-08-08 19:39:59 +02:00
xirvik a69e44a096 Add system.sockets.<category>.max_alloc.limit.
A category can have a ceiling below the shared budget, and a client needs to read it.
2026-08-08 11:28:26 +02:00
Greg ORIOL 4dd8b1fd7e Update rtorrent.rc-example with newer network.listen 2026-08-08 10:44:41 +02:00
Greg ORIOL b5f6bb5652 Update rtorrent.rc with newer network.listen 2026-08-08 10:44:41 +02:00
kunalkakade 3ae6bbc394 Fix garbage throttle values in the status bar on 32-bit archs.
Closes #1683.
2026-08-07 15:45:47 +02:00
kunalkakade fdfca98f1c Add documentation for resolving paths. 2026-08-07 11:58:14 +02:00
kunalkakade 31196ff5f0 Add realpath variants of the commands that return paths.
Closes #1670.
2026-08-07 11:58:14 +02:00
kunalkakade cfb9e083d2 Add documentation for the string.* commands. 2026-08-07 11:35:35 +02:00
kunalkakade 5b4b607c98 Add string.* commands for text manipulation.
Closes #1366.
2026-08-07 11:35:35 +02:00