rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: Novox on July 14, 2010, 04:02:05 PM
-
Here is my event script use to limit 3 connections per user per file. Unfortunately, the script is doesn't work. User can connect more than 3 connection
This is what I read from HFS document
current downloads of file
number of current downloads of current file.
If an unnamed optional parameter is specified, it is used as IP mask, and only matching connections will be counted.
If the parameter is given name user, only connections by such user will be counted.
Here is my code
[download]
{.if| {.{.current downloads of file.} > 3.} |{: {.disconnect.} :} .}
What wrong with my code? and how can i given a name user parameter in the script?
Thank you very much!
Tested on HFS beta #260
-
{.current downloads of file.}
this macro doesn't exist ;D
[download]
{.if|{.{.current downloads|ip=%ip%|file=this.} > 3.} |{: {.disconnect.} :}/if.}
or you can limit the number of connection by ip, in the menu limits ;)
list of macros http://www.rejetto.com/wiki/index.php/HFS:_scripting_commands
list of events http://www.rejetto.com/forum/index.php/topic,6845.msg1042396.html#msg1042396
-
Thank you very much for your reply.
However, the script is doesn't work for me. I have tried to replace IP parameter to user but it still doesn't work.
[download]
{.if|{.{.current downloads|user=%user%|file=this.} > 3.} |{: {.disconnect.} :}/if.}
The users in my server can still connecting and downloading file in HFS with more than 3 connection per file by using IDM. How can I set the connection per file from the HFS menu?
I have found that limit connection in HFS menu is global connections right? All I need is to limit 3 connections per file but they still get more connection if they download a new file.
Please advice :)
-
It will be necessary to wait for the answer of rejetto to this subject, it is better able to determine the relation with the limits and the number of current connections.
do a test with
[download]
{.if|{.{.current downloads|ip=%ip%.} > 3.} |{: {.disconnect.} :}/if.}
inside the macro file=this is removed
-
i tested the script and it worked fine here
[+download]
{.if|{.{.current downloads|ip=%ip%|file=this.} > 3.} |{: {.disconnection reason|too many threads.} :}/if.}
i advice to use {.disconnection reason.} in place of {.disconnect.}
All I need is to limit 3 connections per file but they still get more connection if they download a new file.
it's not clear what you are saying, "new file".
being the limit applied to a single file, any file is not affecting others.
if you download 2 files you'll have 3 + 3 available connections from the same IP address.
-
being the limit applied to a single file, any file is not affecting others.
if you download 2 files you'll have 3 + 3 available connections from the same IP address.
What you said, is what I want. ;D
do I need to add + sign in front if download? [+download]? what is it?
-
do I need to add + sign in front if download? [+download]? what is it?
Yes, especially if you already have a section [download] or [+download]
It's so that all sections can be executed.
-
i consider it a good practice, in case you have other scripts relying on that event/section.
in the future it will be a must, when i'll implement plugin system.