| 101 | } |
| 102 | |
| 103 | int |
| 104 | inliner_transform(TSCont c, TSEvent e, void *) |
| 105 | { |
| 106 | if (TSVConnClosedGet(c)) { |
| 107 | Dbg(dbg_ctl, "connection closed"); |
| 108 | MyData *const data = static_cast<MyData *>(TSContDataGet(c)); |
| 109 | if (data != nullptr) { |
| 110 | TSContDataSet(c, nullptr); |
| 111 | data->handler.abort(); |
| 112 | delete data; |
| 113 | } |
| 114 | TSContDestroy(c); |
| 115 | } else { |
| 116 | switch (e) { |
| 117 | case TS_EVENT_ERROR: { |
| 118 | const TSVIO vio = TSVConnWriteVIOGet(c); |
| 119 | assert(vio != nullptr); |
| 120 | TSContCall(TSVIOContGet(vio), TS_EVENT_ERROR, vio); |
| 121 | } break; |
| 122 | |
| 123 | case TS_EVENT_IMMEDIATE: |
| 124 | handle_transform(c); |
| 125 | break; |
| 126 | |
| 127 | default: |
| 128 | TSError("[" PLUGIN_TAG "] Unknown event: %i", e); |
| 129 | assert(false); // UNREACHABLE |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | return 0; |
| 134 | } |
| 135 | |
| 136 | bool |
| 137 | transformable(TSHttpTxn txnp) |
nothing calls this directly
no test coverage detected