| 283 | } |
| 284 | |
| 285 | VIO * |
| 286 | PluginVC::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffer, bool owner) |
| 287 | { |
| 288 | ink_assert(!closed); |
| 289 | ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE); |
| 290 | |
| 291 | if (abuffer) { |
| 292 | ink_assert(!owner); |
| 293 | write_state.vio.set_reader(abuffer); |
| 294 | } else { |
| 295 | write_state.vio.buffer.clear(); |
| 296 | } |
| 297 | |
| 298 | // Note: we set vio.op last because process_write_side looks at it to |
| 299 | // tell if the VConnection is active. |
| 300 | write_state.vio.mutex = c ? c->mutex : this->mutex; |
| 301 | write_state.vio.cont = c; |
| 302 | write_state.vio.nbytes = nbytes; |
| 303 | write_state.vio.ndone = 0; |
| 304 | write_state.vio.vc_server = (VConnection *)this; |
| 305 | write_state.vio.op = VIO::WRITE; |
| 306 | |
| 307 | Dbg(dbg_ctl_pvc, "[%u] %s: do_io_write for %" PRId64 " bytes", core_obj->id, PVC_TYPE, nbytes); |
| 308 | |
| 309 | // Since reentrant callbacks are not allowed on from do_io |
| 310 | // functions schedule ourselves get on a different stack |
| 311 | need_write_process = true; |
| 312 | setup_event_cb(0, &sm_lock_retry_event); |
| 313 | |
| 314 | return &write_state.vio; |
| 315 | } |
| 316 | |
| 317 | void |
| 318 | PluginVC::reenable(VIO *vio) |
no test coverage detected