| 296 | -------------------------------------------------------------------------*/ |
| 297 | |
| 298 | VIO * |
| 299 | TransformTerminus::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf) |
| 300 | { |
| 301 | m_read_vio.op = VIO::READ; |
| 302 | m_read_vio.set_continuation(c); |
| 303 | m_read_vio.nbytes = nbytes; |
| 304 | m_read_vio.ndone = 0; |
| 305 | m_read_vio.vc_server = this; |
| 306 | |
| 307 | if (buf != nullptr) { |
| 308 | _read_disabled = false; |
| 309 | m_read_vio.set_writer(buf); |
| 310 | if (ink_atomic_increment(&m_event_count, 1) < 0) { |
| 311 | ink_assert(!"not reached"); |
| 312 | } |
| 313 | Dbg(dbg_ctl_transform, "[TransformTerminus::do_io_read] event_count %d", m_event_count); |
| 314 | |
| 315 | _read_event = this_ethread()->schedule_imm_local(this); |
| 316 | } else { |
| 317 | _read_disabled = true; |
| 318 | if (_read_event != nullptr) { |
| 319 | _read_event->cancel(); |
| 320 | _read_event = nullptr; |
| 321 | } |
| 322 | m_read_vio.buffer.clear(); |
| 323 | } |
| 324 | |
| 325 | return &m_read_vio; |
| 326 | } |
| 327 | |
| 328 | /*------------------------------------------------------------------------- |
| 329 | -------------------------------------------------------------------------*/ |
no test coverage detected