equal
deleted
inserted
replaced
398 |
398 |
399 if not frame: |
399 if not frame: |
400 states.append(b'received: <no frame>') |
400 states.append(b'received: <no frame>') |
401 break |
401 break |
402 |
402 |
403 requestid, frametype, frameflags, payload = frame |
403 states.append(b'received: %d %d %d %s' % (frame.typeid, frame.flags, |
404 states.append(b'received: %d %d %d %s' % (frametype, frameflags, |
404 frame.requestid, |
405 requestid, payload)) |
405 frame.payload)) |
406 |
406 |
407 action, meta = reactor.onframerecv(requestid, frametype, frameflags, |
407 action, meta = reactor.onframerecv(frame) |
408 payload) |
|
409 states.append(json.dumps((action, meta), sort_keys=True, |
408 states.append(json.dumps((action, meta), sort_keys=True, |
410 separators=(', ', ': '))) |
409 separators=(', ', ': '))) |
411 |
410 |
412 action, meta = reactor.oninputeof() |
411 action, meta = reactor.oninputeof() |
413 meta['action'] = action |
412 meta['action'] = action |
432 while True: |
431 while True: |
433 frame = wireprotoframing.readframe(req.bodyfh) |
432 frame = wireprotoframing.readframe(req.bodyfh) |
434 if not frame: |
433 if not frame: |
435 break |
434 break |
436 |
435 |
437 action, meta = reactor.onframerecv(*frame) |
436 action, meta = reactor.onframerecv(frame) |
438 |
437 |
439 if action == 'wantframe': |
438 if action == 'wantframe': |
440 # Need more data before we can do anything. |
439 # Need more data before we can do anything. |
441 continue |
440 continue |
442 elif action == 'runcommand': |
441 elif action == 'runcommand': |