TSUrlHostSet - traffic Server URL component manipulation API
Contents
Copyright
2025, dev@trafficserver.apache.org
9.2 May 22, 2025 TSURLHOSTSET(3ts)
Description
The URL data structure is a parsed version of a standard internet URL. The Traffic Server URL API
provides access to URL data stored in marshal buffers. The URL functions can create, copy, retrieve or
delete entire URLs, and retrieve or modify parts of URLs, such as their host, port or scheme information.
TSUrlSchemeSet(), TSUrlUserSet(), TSUrlPasswordSet(), TSUrlHostSet(), TSUrlHttpParamsSet(),
TSUrlHttpQuerySet() and TSUrlHttpFragmentSet() each set the specified portion of the URL located at
offset within the marshal buffer bufp to the string value. If length is -1 then these functions assume
that value is NULL-terminated. Otherwise, the length of the string value is taken to be the value of
length. These functions copy the string to within bufp, so it can be subsequently modified or deleted.
TSUrlPortSet() sets the port number portion of the URL located at offset within the marshal buffer bufp
to the value port. Normal canonicalization based on the URL scheme still applies.
Name
TSUrlHostSet - traffic Server URL component manipulation API
Return Values
All these APIs returns a TSReturnCode, indicating success (TS_SUCCESS) or failure (TS_ERROR) of the
operation.
See Also
TSAPI(3ts), TSUrlCreate(3ts), TSUrlHostGet(3ts), TSUrlStringGet(3ts), TSUrlPercentEncode(3ts)
Synopsis
#include <ts/ts.h>
TSReturnCodeTSUrlHostSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlSchemeSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlUserSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlPasswordSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlPortSet(TSMBufferbufp,TSMLocoffset,intport)TSReturnCodeTSUrlPathSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlHttpQuerySet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlHttpParamsSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)TSReturnCodeTSUrlHttpFragmentSet(TSMBufferbufp,TSMLocoffset,constchar*value,intlength)