#29539 closed defect (fixed)

version key should be in the second possition in the Bandwidth File

Reported by: juga Owned by: atagar
Priority: Medium Milestone:
Component: Archived/Stem Version:
Severity: Normal Keywords: tor-bwauth
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


According to the spec: https://gitweb.torproject.org/torspec.git/tree/bandwidth-file-spec.txt?id=698d6301a409c8ebb2db389d06d2ee8f40d0fa3a#n152

But i can create a Bandwidth File with version in other position:

>>> content = """1523911758
... earliest_bandwidth=2019-02-14T16:06:24
... version=1.2
... =====
... bw=760 node_id=$68A483E05A2ABDCA6DA5A3EF8DB5177638A27F80 nick=Test"""
... bwfile = BandwidthFile.from_str(content)
>>> str(bwfile)
'1523911758\nearliest_bandwidth=2019-02-14T16:06:24\nversion=1.2\n=====\nbw=760 node_id=$68A483E05A2ABDCA6DA5A3EF8DB5177638A27F80 nick=Test'

When generating the string, the version should be in the second position.
When parsing the string, i'm not sure if we should assume that is version 1.0 and ignore all the other headers or because stem is able to parse it, ignore the error and accept it's version 1.2

Child Tickets

Change History (1)

comment:1 Changed 19 months ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.