diff options
Diffstat (limited to 'seggetd')
-rw-r--r-- | seggetd/scripts/net0.py | 13 | ||||
-rw-r--r-- | seggetd/scripts/net0_example.py | 15 |
2 files changed, 16 insertions, 12 deletions
diff --git a/seggetd/scripts/net0.py b/seggetd/scripts/net0.py index 8d87955..7d604c1 100644 --- a/seggetd/scripts/net0.py +++ b/seggetd/scripts/net0.py @@ -1,15 +1,4 @@ from functions import * import time; def schedule(): - localtime = time.localtime(time.time()); - hour=localtime[3]; - # disable downloading distfiles that have size more than 5 000 000 bytes - # from 8-00 to 22-00. - if hour>8 and hour<21 and (get("distfile.size"))>5000000: - print "reject because distfile is too big" - reject_segment() - # set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes - if get("distfile.size")>1000000: - print "limit connection speed" - set(connection.max_speed_limit, 50000) - accept_segment()
\ No newline at end of file + accept_segment()
\ No newline at end of file diff --git a/seggetd/scripts/net0_example.py b/seggetd/scripts/net0_example.py new file mode 100644 index 0000000..8d87955 --- /dev/null +++ b/seggetd/scripts/net0_example.py @@ -0,0 +1,15 @@ +from functions import * +import time; +def schedule(): + localtime = time.localtime(time.time()); + hour=localtime[3]; + # disable downloading distfiles that have size more than 5 000 000 bytes + # from 8-00 to 22-00. + if hour>8 and hour<21 and (get("distfile.size"))>5000000: + print "reject because distfile is too big" + reject_segment() + # set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes + if get("distfile.size")>1000000: + print "limit connection speed" + set(connection.max_speed_limit, 50000) + accept_segment()
\ No newline at end of file |