|
28 | 28 | #include "tscore/PluginUserArgs.h" |
29 | 29 | #include "iocore/eventsystem/EventSystem.h" |
30 | 30 |
|
31 | | -#if !defined(I_VIO_h) |
32 | | -#error "include VIO.h" |
33 | | -#endif |
34 | | - |
35 | 31 | // |
36 | 32 | // Data Types |
37 | 33 | // |
@@ -145,7 +141,7 @@ typedef struct tsapi_vio *TSVIO; |
145 | 141 | class VConnection : public Continuation |
146 | 142 | { |
147 | 143 | public: |
148 | | - ~VConnection() override; |
| 144 | + ~VConnection() override {} |
149 | 145 |
|
150 | 146 | /** |
151 | 147 | Read data from the VConnection. |
@@ -306,17 +302,28 @@ class VConnection : public Continuation |
306 | 302 | */ |
307 | 303 | virtual void do_io_shutdown(ShutdownHowTo_t howto) = 0; |
308 | 304 |
|
309 | | - explicit VConnection(ProxyMutex *aMutex); |
310 | | - explicit VConnection(Ptr<ProxyMutex> &aMutex); |
| 305 | + explicit VConnection(ProxyMutex *aMutex) : Continuation(aMutex), lerrno(0) { SET_HANDLER(nullptr); } |
| 306 | + explicit VConnection(Ptr<ProxyMutex> &aMutex) : Continuation(aMutex), lerrno(0) { SET_HANDLER(nullptr); } |
311 | 307 |
|
312 | 308 | // Private |
313 | 309 | // Set continuation on a given vio. The public interface |
314 | 310 | // is through VIO::set_continuation() |
315 | | - virtual void set_continuation(VIO *vio, Continuation *cont); |
| 311 | + virtual void |
| 312 | + set_continuation(VIO *, Continuation *) |
| 313 | + { |
| 314 | + } |
316 | 315 |
|
317 | 316 | // Reenable a given vio. The public interface is through VIO::reenable |
318 | | - virtual void reenable(VIO *vio); |
319 | | - virtual void reenable_re(VIO *vio); |
| 317 | + virtual void |
| 318 | + reenable(VIO *) |
| 319 | + { |
| 320 | + } |
| 321 | + |
| 322 | + virtual void |
| 323 | + reenable_re(VIO *vio) |
| 324 | + { |
| 325 | + reenable(vio); |
| 326 | + } |
320 | 327 |
|
321 | 328 | /** |
322 | 329 | Convenience function to retrieve information from VConnection. |
@@ -411,3 +418,32 @@ struct DummyVConnection : public VConnection, public PluginUserArgs<TS_USER_ARGS |
411 | 418 |
|
412 | 419 | explicit DummyVConnection(ProxyMutex *m) : VConnection(m) {} |
413 | 420 | }; |
| 421 | + |
| 422 | +inline const char * |
| 423 | +get_vc_event_name(int event) |
| 424 | +{ |
| 425 | + switch (event) { |
| 426 | + default: |
| 427 | + return "unknown event"; |
| 428 | + case VC_EVENT_NONE: |
| 429 | + return "VC_EVENT_NONE"; |
| 430 | + case VC_EVENT_IMMEDIATE: |
| 431 | + return "VC_EVENT_IMMEDIATE"; |
| 432 | + case VC_EVENT_READ_READY: |
| 433 | + return "VC_EVENT_READ_READY"; |
| 434 | + case VC_EVENT_WRITE_READY: |
| 435 | + return "VC_EVENT_WRITE_READY"; |
| 436 | + case VC_EVENT_READ_COMPLETE: |
| 437 | + return "VC_EVENT_READ_COMPLETE"; |
| 438 | + case VC_EVENT_WRITE_COMPLETE: |
| 439 | + return "VC_EVENT_WRITE_COMPLETE"; |
| 440 | + case VC_EVENT_EOS: |
| 441 | + return "VC_EVENT_EOS"; |
| 442 | + case VC_EVENT_ERROR: |
| 443 | + return "VC_EVENT_ERROR"; |
| 444 | + case VC_EVENT_INACTIVITY_TIMEOUT: |
| 445 | + return "VC_EVENT_INACTIVITY_TIMEOUT"; |
| 446 | + case VC_EVENT_ACTIVE_TIMEOUT: |
| 447 | + return "VC_EVENT_ACTIVE_TIMEOUT"; |
| 448 | + } |
| 449 | +} |
0 commit comments