| 49 | } |
| 50 | |
| 51 | int |
| 52 | global_handler(TSCont /* continuation ATS_UNUSED */, TSEvent event, void *data) |
| 53 | { |
| 54 | TSHttpSsn session = static_cast<TSHttpSsn>(data); |
| 55 | TSHttpTxn transaction = static_cast<TSHttpTxn>(data); |
| 56 | |
| 57 | switch (event) { |
| 58 | case TS_EVENT_HTTP_READ_REQUEST_HDR: |
| 59 | if (is_get_request(transaction)) { |
| 60 | const std::string long_line(5000, 's'); |
| 61 | TSTextLogObjectWrite(pluginlog, "Got a GET request. Writing a long line: %s", long_line.c_str()); |
| 62 | } |
| 63 | TSHttpTxnReenable(transaction, TS_EVENT_HTTP_CONTINUE); |
| 64 | return 0; |
| 65 | |
| 66 | default: |
| 67 | TSError("[%s] global_handler: unexpected event: %d\n", plugin_name, event); |
| 68 | break; |
| 69 | } |
| 70 | |
| 71 | TSHttpSsnReenable(session, TS_EVENT_HTTP_CONTINUE); |
| 72 | return 0; |
| 73 | } |
| 74 | |
| 75 | void |
| 76 | TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */) |
nothing calls this directly
no test coverage detected