Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/experimental/slice/Data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
3 changes: 3 additions & 0 deletions plugins/experimental/slice/slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 8 additions & 1 deletion plugins/experimental/slice/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ request_block(TSCont contp, Data *const data)
}

// create virtual connection back into ATS
TSVConn const upvc = TSHttpConnectWithPluginId(reinterpret_cast<sockaddr *>(&data->m_client_ip), PLUGIN_NAME, 0);
TSHttpConnectOptions options = TSHttpConnectOptionsGet(TS_CONNECT_PLUGIN);
options.addr = reinterpret_cast<sockaddr *>(&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);

Expand Down