TSHTTPCONNECTWITHPLUGINID(3ts) | Apache Traffic Server | TSHTTPCONNECTWITHPLUGINID(3ts) |
TSHttpConnectWithPluginId - allows the plugin to initiate an http connection. This will tag the HTTP state machine with extra data that can be accessed by the logging interface. The connection is treated as an HTTP transaction as if it came from a client
#include <ts/ts.h>
This call attempts to create an HTTP state machine and a virtual connection to that state machine. This is more efficient than using TSNetConnect() because it avoids using the operating system stack via the loopback interface.
The virtual connection returned as the TSVConn is API equivalent to a network virtual connection both to the plugin and to internal mechanisms. Data is read and written to the connection (and thence to the target system) by reading and writing on this virtual connection.
NOTE:
The combination of tag and id is intended to enable correlation in log post processing. The tag identifies the connection as related to the plugin and the id can be used in conjunction with plugin generated logs to correlate the log records.
The H2 implementation uses this to correlate client sessions with H2 streams. Each client connection is assigned a distinct numeric identifier. This is passed as the id to TSHttpConnectWithPluginId(). The tag is selected to be the NPN string for the client session protocol, e.g. "h2". Log post processing can then count the number of connections for the various supported protocols and the number of H2 virtual streams for each real client connection to Traffic Server.
2022, dev@trafficserver.apache.org
May 21, 2022 | 8.0 |