| 526 | } |
| 527 | |
| 528 | VIO * |
| 529 | Http2Stream::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffer, bool /* owner ATS_UNUSED */) |
| 530 | { |
| 531 | if (abuffer) { |
| 532 | write_vio.set_reader(abuffer); |
| 533 | } else { |
| 534 | write_vio.buffer.clear(); |
| 535 | } |
| 536 | write_vio.mutex = c ? c->mutex : this->mutex; |
| 537 | write_vio.cont = c; |
| 538 | write_vio.nbytes = nbytes; |
| 539 | write_vio.ndone = 0; |
| 540 | write_vio.vc_server = this; |
| 541 | write_vio.op = VIO::WRITE; |
| 542 | _send_reader = abuffer; |
| 543 | |
| 544 | if (c != nullptr && nbytes > 0 && this->is_state_writeable()) { |
| 545 | update_write_request(false); |
| 546 | } else if (!this->is_state_writeable()) { |
| 547 | // Cannot start a write on a closed stream |
| 548 | return nullptr; |
| 549 | } |
| 550 | return &write_vio; |
| 551 | } |
| 552 | |
| 553 | // Initiated from SM |
| 554 | void |
no test coverage detected