From 64060294ab58dfd07a95a24a1500602421748da9 Mon Sep 17 00:00:00 2001 From: Marq Schneider Date: Wed, 11 Aug 2010 22:37:51 -0500 Subject: Allow changing the upload and download rates at runtime. This adds a 'rate' command to modify the up and download rates on the fly. Closes GH-10 --- misc/btpd_if.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'misc/btpd_if.c') diff --git a/misc/btpd_if.c b/misc/btpd_if.c index b661b21..e208d64 100644 --- a/misc/btpd_if.c +++ b/misc/btpd_if.c @@ -296,6 +296,14 @@ btpd_del(struct ipc *ipc, struct ipc_torrent *tp) return simple_treq(ipc, "del", tp); } +enum ipc_err +btpd_rate(struct ipc *ipc, unsigned up, unsigned down) +{ + struct iobuf iob = iobuf_init(32); + iobuf_print(&iob, "l4:ratei%iei%iee", up, down); + return ipc_buf_req_code(ipc, &iob); +} + enum ipc_err btpd_start(struct ipc *ipc, struct ipc_torrent *tp) { -- cgit 1.4.1