diff --git a/plugins/experimental/slice/Data.h b/plugins/experimental/slice/Data.h index f8cdd641ee3..496ebdc3964 100644 --- a/plugins/experimental/slice/Data.h +++ b/plugins/experimental/slice/Data.h @@ -82,6 +82,10 @@ struct Data { int64_t m_bytestosend{0}; // header + content bytes to send int64_t m_bytessent{0}; // number of bytes written to the client + // default buffer size and water mark + TSIOBufferSizeIndex m_buffer_index{TS_IOBUFFER_SIZE_INDEX_32K}; + TSIOBufferWaterMark m_buffer_water_mark{TS_IOBUFFER_WATER_MARK_PLUGIN_VC_DEFAULT}; + bool m_server_block_header_parsed{false}; bool m_server_first_header_parsed{false}; diff --git a/plugins/experimental/slice/slice.cc b/plugins/experimental/slice/slice.cc index f25e6bb5740..4b71363c1c3 100644 --- a/plugins/experimental/slice/slice.cc +++ b/plugins/experimental/slice/slice.cc @@ -161,6 +161,9 @@ read_request(TSHttpTxn txnp, Config *const config) } } + data->m_buffer_index = TSPluginVCIOBufferIndexGet(data->m_txnp); // default of m_buffer_index = 32KB + data->m_buffer_water_mark = TSPluginVCIOBufferWaterMarkGet(data->m_txnp); // default of m_buffer_water_mark = 0 + if (TSIsDebugTagSet(PLUGIN_NAME)) { int len = 0; char *const urlstr = TSUrlStringGet(data->m_urlbuf, data->m_urlloc, &len); diff --git a/plugins/experimental/slice/util.cc b/plugins/experimental/slice/util.cc index 15c68b4f95f..4ca86c3d1a4 100644 --- a/plugins/experimental/slice/util.cc +++ b/plugins/experimental/slice/util.cc @@ -86,7 +86,14 @@ request_block(TSCont contp, Data *const data) } // create virtual connection back into ATS - TSVConn const upvc = TSHttpConnectWithPluginId(reinterpret_cast(&data->m_client_ip), PLUGIN_NAME, 0); + TSHttpConnectOptions options = TSHttpConnectOptionsGet(TS_CONNECT_PLUGIN); + options.addr = reinterpret_cast(&data->m_client_ip); + options.tag = PLUGIN_NAME; + options.id = 0; + options.buffer_index = data->m_buffer_index; + options.buffer_water_mark = data->m_buffer_water_mark; + + TSVConn const upvc = TSHttpConnectPlugin(&options); int const hlen = TSHttpHdrLengthGet(header.m_buffer, header.m_lochdr);