reduced chunk size from 1KB to 64 bytes; useful when number of reachable hops are low and unreachable hops are high
This commit is contained in:
parent
5ff3ffb620
commit
43ab12ac63
1 changed files with 3 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ for each hop for a specified host from geographically distant source(s).
|
||||||
|
|
||||||
__author__ = 'Dazzlepod (info@dazzlepod.com)'
|
__author__ = 'Dazzlepod (info@dazzlepod.com)'
|
||||||
__copyright__ = 'Copyright (c) 2013 Dazzlepod'
|
__copyright__ = 'Copyright (c) 2013 Dazzlepod'
|
||||||
__version__ = '$Revision: #13 $'
|
__version__ = '$Revision: #14 $'
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
|
|
@ -203,12 +203,12 @@ class Traceroute(object):
|
||||||
def chunked_read(self, response):
|
def chunked_read(self, response):
|
||||||
"""Read page response in chunks. A signal handler is attached to abort
|
"""Read page response in chunks. A signal handler is attached to abort
|
||||||
reading after the set timeout.
|
reading after the set timeout.
|
||||||
Chunk size = 1KB, max. page size = 1MB
|
Chunk size = 64 bytes, max. page size = 1MB
|
||||||
"""
|
"""
|
||||||
content = ''
|
content = ''
|
||||||
max_bytes = 1 * 1024 * 1024
|
max_bytes = 1 * 1024 * 1024
|
||||||
completed_bytes = 0
|
completed_bytes = 0
|
||||||
bytes_per_read = 1024
|
bytes_per_read = 64
|
||||||
|
|
||||||
try:
|
try:
|
||||||
signal.signal(signal.SIGALRM, self.signal_handler)
|
signal.signal(signal.SIGALRM, self.signal_handler)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue