| 252 | } |
| 253 | |
| 254 | VIO * |
| 255 | PluginVC::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf) |
| 256 | { |
| 257 | ink_assert(!closed); |
| 258 | ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE); |
| 259 | |
| 260 | if (buf) { |
| 261 | read_state.vio.set_writer(buf); |
| 262 | } else { |
| 263 | read_state.vio.buffer.clear(); |
| 264 | } |
| 265 | |
| 266 | // Note: we set vio.op last because process_read_side looks at it to |
| 267 | // tell if the VConnection is active. |
| 268 | read_state.vio.mutex = c ? c->mutex : this->mutex; |
| 269 | read_state.vio.cont = c; |
| 270 | read_state.vio.nbytes = nbytes; |
| 271 | read_state.vio.ndone = 0; |
| 272 | read_state.vio.vc_server = (VConnection *)this; |
| 273 | read_state.vio.op = VIO::READ; |
| 274 | |
| 275 | Dbg(dbg_ctl_pvc, "[%u] %s: do_io_read for %" PRId64 " bytes", core_obj->id, PVC_TYPE, nbytes); |
| 276 | |
| 277 | // Since reentrant callbacks are not allowed on from do_io |
| 278 | // functions schedule ourselves get on a different stack |
| 279 | need_read_process = true; |
| 280 | setup_event_cb(0, &sm_lock_retry_event); |
| 281 | |
| 282 | return &read_state.vio; |
| 283 | } |
| 284 | |
| 285 | VIO * |
| 286 | PluginVC::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffer, bool owner) |
no test coverage detected