Page 1 of 1

Kick all sessions having "Keep alive"

Posted: Wed Nov 30, 2016 11:11 am
by Broemmelhaus
Hello,

I try to Kick all Sessions having "Keep_Alive" as last remark.
The Little Lua-script works very well.

Here's my script:
local strUserlist = {}
strUserlist = c_GetConnectionsList("Domain")
for nr in pairs(strUserlist) do
local letztes = strUserlist[nr].lastcommand
local user = strUserlist[nr].username
if string.find(letztes, 'KEEP ALIVE') then
c_KickSession('Domain',strUserlist[nr].id,0,0,0,0,0,0)
end
end

But I recognized, that WingFTP remarks "Keep alive" for users who's uploads are in still in progress. So the script kicks sessions that shouldn't be "kicked".
Now I tried to use "%ConTransferByte" but I got no values back from the System.

Perhaps someone can help to solve my problem, getting the information, if there is any process (upload/download) in progress.

Thx
Meik

Re: Kick all sessions having "Keep alive"

Posted: Thu Dec 01, 2016 12:41 pm
by FTP
For your requirement, you can solve it via a simple method, just modify the file "webclient/main.html", remove the following line:

_TIMER_KEEPLIVE = setInterval("keeplive()",1000*300);

Re: Kick all sessions having "Keep alive"

Posted: Wed Dec 07, 2016 3:47 pm
by Broemmelhaus
Thx FTP for the really simple method!

But if I understand it right, this one line will not solve my problem, if there is an upload/download in process. The logs last entry is a "Keep alive" and the up-/download is still running. These sessions shouldn't be kicked off.

Is ist possible to manage?

Or does the remove of "_TIMER_KEEPLIVE = setInterval("keeplive()",1000*300);" solve this too?

Best regards
Meik