| 944 | } |
| 945 | |
| 946 | static void |
| 947 | compress_transform_add(TSHttpTxn txnp, HostConfiguration *hc, int compress_type, int algorithms) |
| 948 | { |
| 949 | TSVConn connp; |
| 950 | Data *data; |
| 951 | |
| 952 | TSHttpTxnUntransformedRespCache(txnp, 1); |
| 953 | |
| 954 | if (!hc->cache()) { |
| 955 | debug("TransformedRespCache not enabled"); |
| 956 | TSHttpTxnTransformedRespCache(txnp, 0); |
| 957 | } else { |
| 958 | debug("TransformedRespCache enabled"); |
| 959 | TSHttpTxnUntransformedRespCache(txnp, 0); |
| 960 | TSHttpTxnTransformedRespCache(txnp, 1); |
| 961 | } |
| 962 | |
| 963 | connp = TSTransformCreate(compress_transform, txnp); |
| 964 | data = data_alloc(compress_type, algorithms); |
| 965 | data->txn = txnp; |
| 966 | data->hc = hc; |
| 967 | |
| 968 | TSContDataSet(connp, data); |
| 969 | TSHttpTxnHookAdd(txnp, TS_HTTP_RESPONSE_TRANSFORM_HOOK, connp); |
| 970 | } |
| 971 | |
| 972 | static void |
| 973 | handle_compression_and_vary(TSHttpTxn txnp, bool server, HostConfiguration *hc, int *compress_type, int *algorithms) |
no test coverage detected