parser = OptionParser(usage=usage)I had forgotten that the OptionParser lets you specify a default value for the options.
parser.add_option('-d', '--delay', action='append', dest='delay',
help='Delay, in milliseconds, to configure link')
parser.add_option('-b', '--buffer', action='append', dest='buf',
help='Size of traffic-shaping buffer for link, -1 to leave unset')
parser.add_option('-s', '--speed', action='append', dest='speed',
help='Speed of link, -1 to leave unset')
...snip...
(options, args) = parser.parse_args(sys.argv)
...snip...
# we want empty lists, not Nones. The Nones, of course, being either the
# fifth or the seventh of the month in the Roman calendar.
if not options.delay:
options.delay = []
if not options.buf:
options.buf = []
if not options.speed:
options.speed = []
I don't know what you can infer from this. But it's interesting.
The title is the comment that precedes the function
tcp_try_undo_recovery
in net/ipv4/tcp_input.c
in the linux kernel. It's actually more documentation than most of the functions in the linux TCP stack have. I never thought I'd actually want to see a Glen-style header again...
No comments:
Post a Comment