------------------------------------------------------------------------- wake_up_streams Send an event to the upstream vconnection to either - ask for more data - let it know we're done Reenable the downstream vconnection Input: contp continuation for the current transaction Output : Return Value: 0 if failure 1 if success -------------------------------------
| 543 | 1 if success |
| 544 | -------------------------------------------------------------------------*/ |
| 545 | static int |
| 546 | wake_up_streams(TSCont contp) |
| 547 | { |
| 548 | TSVIO input_vio; |
| 549 | ContData *data; |
| 550 | int ntodo; |
| 551 | |
| 552 | data = contDataGet(contp); |
| 553 | TSAssert(data->magic == MAGIC_ALIVE); |
| 554 | |
| 555 | input_vio = TSVConnWriteVIOGet(contp); |
| 556 | ntodo = TSVIONTodoGet(input_vio); |
| 557 | |
| 558 | if (ntodo > 0) { |
| 559 | TSVIOReenable(data->output_vio); |
| 560 | TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_READY, input_vio); |
| 561 | } else { |
| 562 | Dbg(dbg_ctl, "Total bytes produced by transform = %d", data->transform_bytes); |
| 563 | TSVIONBytesSet(data->output_vio, data->transform_bytes); |
| 564 | TSVIOReenable(data->output_vio); |
| 565 | TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_COMPLETE, input_vio); |
| 566 | } |
| 567 | |
| 568 | return 1; |
| 569 | } |
| 570 | |
| 571 | /*------------------------------------------------------------------------- |
| 572 | handle_transform |
no test coverage detected