| 652 | } |
| 653 | |
| 654 | static int |
| 655 | compress_transform(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */) |
| 656 | { |
| 657 | if (TSVConnClosedGet(contp)) { |
| 658 | data_destroy(static_cast<Data *>(TSContDataGet(contp))); |
| 659 | TSContDestroy(contp); |
| 660 | return 0; |
| 661 | } else { |
| 662 | switch (event) { |
| 663 | case TS_EVENT_ERROR: { |
| 664 | debug("compress_transform: TS_EVENT_ERROR starts"); |
| 665 | TSVIO upstream_vio = TSVConnWriteVIOGet(contp); |
| 666 | TSContCall(TSVIOContGet(upstream_vio), TS_EVENT_ERROR, upstream_vio); |
| 667 | } break; |
| 668 | case TS_EVENT_VCONN_WRITE_COMPLETE: |
| 669 | TSVConnShutdown(TSTransformOutputVConnGet(contp), 0, 1); |
| 670 | break; |
| 671 | case TS_EVENT_VCONN_WRITE_READY: |
| 672 | compress_transform_do(contp); |
| 673 | break; |
| 674 | case TS_EVENT_IMMEDIATE: |
| 675 | compress_transform_do(contp); |
| 676 | break; |
| 677 | default: |
| 678 | warning("unknown event [%d]", event); |
| 679 | compress_transform_do(contp); |
| 680 | break; |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | return 0; |
| 685 | } |
| 686 | |
| 687 | static int |
| 688 | is_content_compressible(TSHttpTxn txnp, bool server, HostConfiguration *host_configuration) |
nothing calls this directly
no test coverage detected