Merge pull request #184 from richie5um/RichS-RateDivideByZeroIssue

Fix divide by zero issue when timestamp start and end are the same
This commit is contained in:
Aldo Cortesi 2013-12-08 00:54:11 -08:00
commit 83f061c1a0
1 changed files with 1 additions and 1 deletions

View File

@ -190,7 +190,7 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2):
delta = f.response.timestamp_end - f.response.timestamp_start
size = len(f.response.content) + f.response.get_header_size()
rate = utils.pretty_size(size / delta)
rate = utils.pretty_size(size / ( delta if delta > 0 else 1 ) )
d.update(dict(
resp_code = f.response.code,