lf = b'\n'
mime = (b'--b' + crlf +
b'Content-Disposition: form-data; name="m"' + crlf + crlf +
- password + crlf +
str(c.client) .encode('ascii') + crlf +
+ password + crlf +
str(c.target_outstanding) .encode('ascii') + crlf +
((
b'--b' + crlf +
def process_request(request, desca):
# find client, update config, etc.
- metadata = request.args['m']
+ metadata = request.args[b'm'][0]
metadata = metadata.split(b'\r\n')
(ci_s, pw, tro) = metadata[0:3]
desca['m[0,2]'] = [ci_s, tro]
+ ci_s = ci_s.decode('utf-8')
+ tro = int(tro)
+ desca['tro']= tro
ci = ipaddr(ci_s)
desca['ci'] = ci
cl = clients[ci]
raise ValueError('tro must be %d' % cl.target_requests_outstanding)
try:
- d = request.args['d']
+ d = request.args[b'd']
desca['d'] = d
except KeyError: d = ''
log_http(desca, 'EXCEPTION ' + emsg)
request.setHeader('Content-Type','text/plain; charset="utf-8"')
request.setResponseCode(400)
- return emsg.encode('utf-8')
+ return (emsg + ' # ' + repr(desca) + '\r\n').encode('utf-8')
log_http(desca, '... [%s]' % id(request))
return NOT_DONE_YET