##// END OF EJS Templates
Respect "Connection: close" headers sent by HTTP clients....
Respect "Connection: close" headers sent by HTTP clients. A HTTP client can indicate that it doesn't support (or doesn't want) persistent connections by sending this header. This not only makes the server more compliant with the RFC, but also reduces the run time of test-http-proxy when run with python 2.3 from ~125s to ~5s (it doesn't affect it with python 2.4, which was already ~5s).

File last commit:

r1541:bf4e7ef0 default
r2582:276de216 default
Show More
fancyopts.py
30 lines | 847 B | text/x-python | PythonLexer
mark.williamson@cl.cam.ac.uk
A number of minor fixes to problems that pychecker found....
r667 import getopt
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0
mpm@selenic.com
A bunch of parsing/help updates...
r596 def fancyopts(args, options, state):
twaldmann@thinkmo.de
fixed some stuff pychecker shows, marked unclear/wrong stuff with XXX
r1541 long = []
short = ''
map = {}
dt = {}
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0
for s, l, d, c in options:
Bryan O'Sullivan
Map long option names containing dashes to ones containing underscores.
r1056 pl = l.replace('-', '_')
map['-'+s] = map['--'+l] = pl
state[pl] = d
dt[pl] = type(d)
mpm@selenic.com
Fix option parsing bug for empty short options
r959 if not d is None and not callable(d):
if s: s += ':'
if l: l += '='
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0 if s: short = short + s
if l: long.append(l)
mpm@selenic.com
hg help improvements...
r293 opts, args = getopt.getopt(args, short, long)
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0
for opt, arg in opts:
mpm@selenic.com
hg help improvements...
r293 if dt[map[opt]] is type(fancyopts): state[map[opt]](state,map[opt],arg)
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0 elif dt[map[opt]] is type(1): state[map[opt]] = int(arg)
elif dt[map[opt]] is type(''): state[map[opt]] = arg
elif dt[map[opt]] is type([]): state[map[opt]].append(arg)
elif dt[map[opt]] is type(None): state[map[opt]] = 1
mpm@selenic.com
Beginning of new command parsing interface...
r209
mpm@selenic.com
Add back links from file revisions to changeset revisions...
r0 return args