logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

TSUrlCreate - traffic Server URL object construction API

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.

       TSUrlCreate()  creates a new URL within the marshal buffer bufp. Release the resulting handle with a call
       to TSHandleMLocRelease().

       TSUrlClone() copies the contents of the URL at location src_url within the marshal buffer src_bufp  to  a
       location   within   the   marshal   buffer  dest_bufp.  Release  the  returned  handle  with  a  call  to
       TSHandleMLocRelease().

       TSUrlCopy() copies the contents of the URL at location src_url within the marshal buffer src_bufp to  the
       location  dest_url  within the marshal buffer dest_bufp. TSUrlCopy() works correctly even if src_bufp and
       dest_bufp point to different marshal buffers. It is important for the destination URL (its marshal buffer
       and TSMLoc) to have been created before copying into it.

       TSUrlParse() parses a URL. The start pointer is both an input and an output parameter and marks the start
       of the URL to be parsed. After a successful parse, the start pointer equals  the  end  pointer.  The  end
       pointer must be one byte after the last character you want to parse. The URL parsing routine assumes that
       everything  between  start and end is part of the URL. It is up to higher level parsing routines, such as
       TSHttpHdrParseReq(), to determine the actual end of the URL.

Name

       TSUrlCreate - traffic Server URL object construction API

Return Values

       The TSUrlParse() function returns a TSParseResult, where TS_PARSE_ERROR indicates an  error.  Success  is
       indicated  by one of TS_PARSE_DONE or TS_PARSE_CONT. The other APIs all return a TSReturnCode, indicating
       success (TS_SUCCESS) or failure (TS_ERROR) of the operation.

See Also

TSAPI(3ts),    TSMBufferCreate(3ts),    TSUrlHostGet(3ts),    TSUrlHostSet(3ts),     TSUrlStringGet(3ts),
       TSUrlPercentEncode(3ts)

Synopsis

          #include <ts/ts.h>

       TSReturnCodeTSUrlCreate(TSMBufferbufp,TSMLoc*locp)TSReturnCodeTSUrlClone(TSMBufferdest_bufp,TSMBuffersrc_bufp,TSMLocsrc_url,TSMLoc*locp)TSReturnCodeTSUrlCopy(TSMBufferdest_bufp,TSMLocdest_url,TSMBuffersrc_bufp,TSMLocsrc_url)TSParseResultTSUrlParse(TSMBufferbufp,TSMLocoffset,constchar**start,constchar*end)