From: fredrik Date: Wed, 9 Nov 2005 03:51:27 +0000 (+0000) Subject: Add transstatus. X-Git-Tag: 0.1~83 X-Git-Url: http://git.dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=796283c6df4713edcac9c199bf4fd26dff42c2fd Add transstatus. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@496 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/daemon/ui.c b/daemon/ui.c index 94241e7..87818bb 100644 --- a/daemon/ui.c +++ b/daemon/ui.c @@ -1204,6 +1204,18 @@ static void cmd_hashstatus(struct socket *sk, struct uidata *data, int argc, wch sq(sk, 0, L"200", L"%%i", total, L"tth", L"%%i", hashed, NULL); } +static void cmd_transstatus(struct socket *sk, struct uidata *data, int argc, wchar_t **argv) +{ + wchar_t *buf1, *buf2; + + havepriv(PERM_TRANS); + buf1 = swprintf2(L"%lli", bytesdownload); + buf2 = swprintf2(L"%lli", bytesupload); + sq(sk, 0, L"200", L"%%ls", buf1, L"%%ls", buf2, NULL); + free(buf1); + free(buf2); +} + #undef haveargs #undef havepriv @@ -1239,6 +1251,7 @@ static struct command commands[] = {L"filtercmd", cmd_filtercmd}, {L"lstrarg", cmd_lstrarg}, {L"hashstatus", cmd_hashstatus}, + {L"transstatus", cmd_transstatus}, {NULL, NULL} };