-
Dridi Boukelmoune authored
The tunnel acts like a client and a server and forwards bytes between two parties. It can then pause in the middle of a session and control how much data can go in either direction. Combined with barriers it can be used to trigger socket timeouts, possibly in the middle of protocol frames. A tunnel works with two threads: one to execute its spec and one to poll both parties and transfer data accordingly. The two threads synchronize via basic pthread primitives and follow a very simplistic state machine: ACCEPT -> RUNNING <-> PAUSED -> SPEC DONE -> POLL DONE -> STOPPED Despite being simplistic, the coordination of two threads would likely complicate the implementation of a `-repeat` action, but it is still possible to `start` a tunnel again as shown in the c106 test case that exercises basic coverage involving a varnish instance. Usage is documented in the vtc(7) manual.
e1e52264