\hypertarget{htp__util_8c}{\section{htp\-\_\-util.\-c File Reference} \label{htp__util_8c}\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}} } {\ttfamily \#include \char`\"{}htp\-\_\-private.\-h\char`\"{}}\\* \subsection*{Functions} \begin{DoxyCompactItemize} \item int \hyperlink{htp__util_8c_a01068fcd4418a90ea81a2ad5e4eb8c81}{htp\-\_\-is\-\_\-lws} (int c) \item int \hyperlink{htp__util_8c_a238c39a6d7fd7f35735f9c97a1b2aa66}{htp\-\_\-is\-\_\-separator} (int c) \item int \hyperlink{htp__util_8c_acd9999e11e39f8434023b786416fdc43}{htp\-\_\-is\-\_\-text} (int c) \item int \hyperlink{htp__util_8c_a7a0e47fdda476b38045a7d3406fb51ee}{htp\-\_\-is\-\_\-token} (int c) \item int \hyperlink{htp__util_8c_aa5e02fbff064b8409e1307bd30fffab8}{htp\-\_\-chomp} (unsigned char $\ast$data, size\-\_\-t $\ast$len) \item int \hyperlink{htp__util_8c_a8154aaa13d12e1fea9b066e0881bd125}{htp\-\_\-is\-\_\-space} (int c) \item int \hyperlink{htp__util_8c_a78c6b46f18005b1746de2e0da8b2bdc2}{htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$method) \item int \hyperlink{htp__util_8c_aa515e1e25cc42162e95469b4d6c575c9}{htp\-\_\-is\-\_\-line\-\_\-empty} (unsigned char $\ast$data, size\-\_\-t len) \item int \hyperlink{htp__util_8c_a8b599459708fac234b83e8d8fe58b258}{htp\-\_\-is\-\_\-line\-\_\-whitespace} (unsigned char $\ast$data, size\-\_\-t len) \item int64\-\_\-t \hyperlink{htp__util_8c_a50d9fb619fe71bfee3ab812d96ba0b6c}{htp\-\_\-parse\-\_\-content\-\_\-length} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$b) \item int64\-\_\-t \hyperlink{htp__util_8c_abe97fa5fa00905db42afe94366adcc6a}{htp\-\_\-parse\-\_\-chunked\-\_\-length} (unsigned char $\ast$data, size\-\_\-t len) \item int64\-\_\-t \hyperlink{htp__util_8c_ae73f7889b2bec1d7c2605c154cc4ecda}{htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace} (unsigned char $\ast$data, size\-\_\-t len, int base) \item void \hyperlink{htp__util_8c_a3eef4d9c98d7bbfbbcb1ff7c5317f3c6}{htp\-\_\-log} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp, const char $\ast$file, int line, enum \hyperlink{htp__core_8h_ae91a6ad07977423dd1ec14a44156d799}{htp\-\_\-log\-\_\-level\-\_\-t} level, int code, const char $\ast$fmt,...) \item int \hyperlink{htp__util_8c_a6328d9ce315c36afc0a3396f28b482a5}{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded} (unsigned char $\ast$data, size\-\_\-t len) \item int \hyperlink{htp__util_8c_a9e2d1a484a0504ed6475a9d89a6608a3}{htp\-\_\-is\-\_\-folding\-\_\-char} (int c) \item int \hyperlink{htp__util_8c_a90ec198a62babe0db3d63024ec9d5118}{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp, unsigned char $\ast$data, size\-\_\-t len) \item int \hyperlink{htp__util_8c_a1497c1d24aca2e016fc04475d48616c7}{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp, unsigned char $\ast$data, size\-\_\-t len) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a812a0f3de059baf63e4be07effe51620}{htp\-\_\-parse\-\_\-hostport} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$hostport, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$$\ast$hostname, int $\ast$port, int $\ast$invalid) \item int \hyperlink{htp__util_8c_aaef00410cceff9ae804c86f316e425de}{htp\-\_\-parse\-\_\-uri\-\_\-hostport} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$hostport, \hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} $\ast$uri) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a4d502ec2a4632cc8e1e9326c6ab36811}{htp\-\_\-parse\-\_\-header\-\_\-hostport} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$hostport, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$$\ast$hostname, int $\ast$port, uint64\-\_\-t $\ast$flags) \item int \hyperlink{htp__util_8c_a330b435a16a1f366eed76bf7b7bddba6}{htp\-\_\-parse\-\_\-uri} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$input, \hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} $\ast$$\ast$uri) \item void \hyperlink{htp__util_8c_ac19fd0827df78d7618a6360a0a9e2ac2}{htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace} (\hyperlink{structhtp__cfg__t}{htp\-\_\-cfg\-\_\-t} $\ast$cfg, \hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$path) \item void \hyperlink{htp__util_8c_a75ad702e0957be72f80dc27900f83ec7}{htp\-\_\-utf8\-\_\-validate\-\_\-path} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$path) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a70e79f229a542a4d99c89680d39217e2}{htp\-\_\-decode\-\_\-path\-\_\-inplace} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$path) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a14e44933747475b68b36ea4b4ec7f1eb}{htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$input) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a3290cc3c0233d21dd5c3e8e97883ea18}{htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$input) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a2a01a96c537538cdefec78b9628b5e93}{htp\-\_\-urldecode\-\_\-inplace} (\hyperlink{structhtp__cfg__t}{htp\-\_\-cfg\-\_\-t} $\ast$cfg, enum \hyperlink{htp__config_8h_afa49656ef495bb1c8d129342681f62e7}{htp\-\_\-decoder\-\_\-ctx\-\_\-t} ctx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$input, uint64\-\_\-t $\ast$flags) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a6a6849d2b4e2477402760923aae8d527}{htp\-\_\-urldecode\-\_\-inplace\-\_\-ex} (\hyperlink{structhtp__cfg__t}{htp\-\_\-cfg\-\_\-t} $\ast$cfg, enum \hyperlink{htp__config_8h_afa49656ef495bb1c8d129342681f62e7}{htp\-\_\-decoder\-\_\-ctx\-\_\-t} ctx, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$input, uint64\-\_\-t $\ast$flags, int $\ast$expected\-\_\-status\-\_\-code) \item int \hyperlink{htp__util_8c_a227804ea2d625f14c44e423326042f9a}{htp\-\_\-normalize\-\_\-parsed\-\_\-uri} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx, \hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} $\ast$incomplete, \hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} $\ast$normalized) \item \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$ \hyperlink{htp__util_8c_aa9fcbe29596fb22c40345bec42416f52}{htp\-\_\-normalize\-\_\-hostname\-\_\-inplace} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$hostname) \item void \hyperlink{htp__util_8c_ae3b688cf78f951a218afde6d2bb3b763}{htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$s) \item void \hyperlink{htp__util_8c_a1dfe07ee3d981b6bfaaf6c88d01224b0}{fprint\-\_\-bstr} (F\-I\-L\-E $\ast$stream, const char $\ast$name, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$b) \item void \hyperlink{htp__util_8c_a0ec8330cb428004d467f69e7c6acdb84}{fprint\-\_\-raw\-\_\-data} (F\-I\-L\-E $\ast$stream, const char $\ast$name, const void $\ast$data, size\-\_\-t len) \item void \hyperlink{htp__util_8c_a303aba5516dabecd55bb558228b76d84}{fprint\-\_\-raw\-\_\-data\-\_\-ex} (F\-I\-L\-E $\ast$stream, const char $\ast$name, const void $\ast$\-\_\-data, size\-\_\-t offset, size\-\_\-t printlen) \item char $\ast$ \hyperlink{htp__util_8c_a81fca26cac57032120c6796bda2a660c}{htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp) \item char $\ast$ \hyperlink{htp__util_8c_af31ead38ae0851c906b72d93d9a29d5a}{htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp) \item char $\ast$ \hyperlink{htp__util_8c_a7745dfd28ae341b34cde2bb1f333b1b8}{htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx) \item char $\ast$ \hyperlink{htp__util_8c_a9469285f23ba429b8358c9385ccd6eef}{htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx) \item int \hyperlink{htp__util_8c_a989808ba8cacae96e9c5e0e052a73a3c}{htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body} (\hyperlink{structhtp__tx__t}{htp\-\_\-tx\-\_\-t} $\ast$tx) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_ae9186694fa6cb9d4985d3c66698f0968}{htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp, \hyperlink{structhtp__tx__data__t}{htp\-\_\-tx\-\_\-data\-\_\-t} $\ast$d) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_aa60cc60143dfb38260549c4df5219727}{htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data} (\hyperlink{structhtp__connp__t}{htp\-\_\-connp\-\_\-t} $\ast$connp, \hyperlink{structhtp__tx__data__t}{htp\-\_\-tx\-\_\-data\-\_\-t} $\ast$d) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a0ca5d553420839786a3102bc3ab3cb80}{htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr} (unsigned char $\ast$data, size\-\_\-t len, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$$\ast$out, size\-\_\-t $\ast$endoffset) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__util_8c_a3742fd84a15ebfa867623dd7bf26c0e9}{htp\-\_\-parse\-\_\-ct\-\_\-header} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$header, \hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$$\ast$ct) \item int \hyperlink{htp__util_8c_a31cca701d490472a8cdb778a6c0e6560}{htp\-\_\-validate\-\_\-hostname} (\hyperlink{bstr_8h_ad24e3759c8d17c13ae2f05d9dde4d0b6}{bstr} $\ast$hostname) \item void \hyperlink{htp__util_8c_af834d04e2f2dcf25ed5f8cf49efb626a}{htp\-\_\-uri\-\_\-free} (\hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} $\ast$uri) \item \hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} $\ast$ \hyperlink{htp__util_8c_a6037e8e01478c4aa8bce304c873c182d}{htp\-\_\-uri\-\_\-alloc} () \item char $\ast$ \hyperlink{htp__util_8c_aafd2659394bb762f2a623bc9b2ee59bd}{htp\-\_\-get\-\_\-version} (void) \end{DoxyCompactItemize} \subsection{Detailed Description} \begin{DoxyAuthor}{Author} Ivan Ristic \href{mailto:ivanr@webkreator.com}{\tt ivanr@webkreator.\-com} \end{DoxyAuthor} \subsection{Function Documentation} \hypertarget{htp__util_8c_a1dfe07ee3d981b6bfaaf6c88d01224b0}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!fprint\-\_\-bstr@{fprint\-\_\-bstr}} \index{fprint\-\_\-bstr@{fprint\-\_\-bstr}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{fprint\-\_\-bstr}]{\setlength{\rightskip}{0pt plus 5cm}void fprint\-\_\-bstr ( \begin{DoxyParamCaption} \item[{F\-I\-L\-E $\ast$}]{stream, } \item[{const char $\ast$}]{name, } \item[{{\bf bstr} $\ast$}]{b} \end{DoxyParamCaption} )}}\label{htp__util_8c_a1dfe07ee3d981b6bfaaf6c88d01224b0} \hypertarget{htp__util_8c_a0ec8330cb428004d467f69e7c6acdb84}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!fprint\-\_\-raw\-\_\-data@{fprint\-\_\-raw\-\_\-data}} \index{fprint\-\_\-raw\-\_\-data@{fprint\-\_\-raw\-\_\-data}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{fprint\-\_\-raw\-\_\-data}]{\setlength{\rightskip}{0pt plus 5cm}void fprint\-\_\-raw\-\_\-data ( \begin{DoxyParamCaption} \item[{F\-I\-L\-E $\ast$}]{stream, } \item[{const char $\ast$}]{name, } \item[{const void $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_a0ec8330cb428004d467f69e7c6acdb84} \hypertarget{htp__util_8c_a303aba5516dabecd55bb558228b76d84}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!fprint\-\_\-raw\-\_\-data\-\_\-ex@{fprint\-\_\-raw\-\_\-data\-\_\-ex}} \index{fprint\-\_\-raw\-\_\-data\-\_\-ex@{fprint\-\_\-raw\-\_\-data\-\_\-ex}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{fprint\-\_\-raw\-\_\-data\-\_\-ex}]{\setlength{\rightskip}{0pt plus 5cm}void fprint\-\_\-raw\-\_\-data\-\_\-ex ( \begin{DoxyParamCaption} \item[{F\-I\-L\-E $\ast$}]{stream, } \item[{const char $\ast$}]{name, } \item[{const void $\ast$}]{\-\_\-data, } \item[{size\-\_\-t}]{offset, } \item[{size\-\_\-t}]{printlen} \end{DoxyParamCaption} )}}\label{htp__util_8c_a303aba5516dabecd55bb558228b76d84} \hypertarget{htp__util_8c_aa5e02fbff064b8409e1307bd30fffab8}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-chomp@{htp\-\_\-chomp}} \index{htp\-\_\-chomp@{htp\-\_\-chomp}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-chomp}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-chomp ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t $\ast$}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_aa5e02fbff064b8409e1307bd30fffab8} Remove all line terminators (L\-F or C\-R\-L\-F) from the end of the line provided as input. \begin{DoxyReturn}{Returns} 0 if nothing was removed, 1 if one or more L\-F characters were removed, or 2 if one or more C\-R and/or L\-F characters were removed. \end{DoxyReturn} \hypertarget{htp__util_8c_a81fca26cac57032120c6796bda2a660c}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string@{htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string}} \index{htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string@{htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ htp\-\_\-connp\-\_\-in\-\_\-state\-\_\-as\-\_\-string ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp} \end{DoxyParamCaption} )}}\label{htp__util_8c_a81fca26cac57032120c6796bda2a660c} \hypertarget{htp__util_8c_a6328d9ce315c36afc0a3396f28b482a5}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded@{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded}} \index{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded@{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-folded ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_a6328d9ce315c36afc0a3396f28b482a5} Determines if the given line is a continuation (of some previous line). \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 for false and true, respectively. Returns -\/1 on error (N\-U\-L\-L pointer or length zero). \end{DoxyReturn} \hypertarget{htp__util_8c_a1497c1d24aca2e016fc04475d48616c7}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable@{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable}} \index{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable@{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-ignorable ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp, } \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_a1497c1d24aca2e016fc04475d48616c7} Determines if the given line can be ignored when it appears before a request. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a90ec198a62babe0db3d63024ec9d5118}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator@{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator}} \index{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator@{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-connp\-\_\-is\-\_\-line\-\_\-terminator ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp, } \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_a90ec198a62babe0db3d63024ec9d5118} Determines if the given line is a request terminator. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_af31ead38ae0851c906b72d93d9a29d5a}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string@{htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string}} \index{htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string@{htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ htp\-\_\-connp\-\_\-out\-\_\-state\-\_\-as\-\_\-string ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp} \end{DoxyParamCaption} )}}\label{htp__util_8c_af31ead38ae0851c906b72d93d9a29d5a} \hypertarget{htp__util_8c_a78c6b46f18005b1746de2e0da8b2bdc2}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number@{htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number}} \index{htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number@{htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-convert\-\_\-method\-\_\-to\-\_\-number ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{method} \end{DoxyParamCaption} )}}\label{htp__util_8c_a78c6b46f18005b1746de2e0da8b2bdc2} Converts request method, given as a string, into a number. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em method} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Method number of M\-\_\-\-U\-N\-K\-N\-O\-W\-N \end{DoxyReturn} \hypertarget{htp__util_8c_a70e79f229a542a4d99c89680d39217e2}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-decode\-\_\-path\-\_\-inplace@{htp\-\_\-decode\-\_\-path\-\_\-inplace}} \index{htp\-\_\-decode\-\_\-path\-\_\-inplace@{htp\-\_\-decode\-\_\-path\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-decode\-\_\-path\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-decode\-\_\-path\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx, } \item[{{\bf bstr} $\ast$}]{path} \end{DoxyParamCaption} )}}\label{htp__util_8c_a70e79f229a542a4d99c89680d39217e2} Decode a request path according to the settings in the provided configuration structure. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em cfg} & \\ \hline \mbox{\tt in} & {\em tx} & \\ \hline \mbox{\tt in} & {\em path} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_a0ca5d553420839786a3102bc3ab3cb80}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr@{htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr}} \index{htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr@{htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-extract\-\_\-quoted\-\_\-string\-\_\-as\-\_\-bstr ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len, } \item[{{\bf bstr} $\ast$$\ast$}]{out, } \item[{size\-\_\-t $\ast$}]{endoffset} \end{DoxyParamCaption} )}}\label{htp__util_8c_a0ca5d553420839786a3102bc3ab3cb80} Parses the provided memory region, extracting the double-\/quoted string. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \mbox{\tt out} & {\em out} & \\ \hline \mbox{\tt out} & {\em endoffset} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success, H\-T\-P\-\_\-\-D\-E\-C\-L\-I\-N\-E\-D if the input is not well formed, and H\-T\-P\-\_\-\-E\-R\-R\-O\-R on fatal errors. \end{DoxyReturn} \hypertarget{htp__util_8c_aafd2659394bb762f2a623bc9b2ee59bd}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-get\-\_\-version@{htp\-\_\-get\-\_\-version}} \index{htp\-\_\-get\-\_\-version@{htp\-\_\-get\-\_\-version}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-get\-\_\-version}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ htp\-\_\-get\-\_\-version ( \begin{DoxyParamCaption} \item[{void}]{} \end{DoxyParamCaption} )}}\label{htp__util_8c_aafd2659394bb762f2a623bc9b2ee59bd} Returns the Lib\-H\-T\-P version string. \begin{DoxyReturn}{Returns} Lib\-H\-T\-P version, for example \char`\"{}\-Lib\-H\-T\-P v0.\-5.\-x\char`\"{}. \end{DoxyReturn} \hypertarget{htp__util_8c_a9e2d1a484a0504ed6475a9d89a6608a3}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-folding\-\_\-char@{htp\-\_\-is\-\_\-folding\-\_\-char}} \index{htp\-\_\-is\-\_\-folding\-\_\-char@{htp\-\_\-is\-\_\-folding\-\_\-char}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-folding\-\_\-char}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-folding\-\_\-char ( \begin{DoxyParamCaption} \item[{int}]{c} \end{DoxyParamCaption} )}}\label{htp__util_8c_a9e2d1a484a0504ed6475a9d89a6608a3} \hypertarget{htp__util_8c_aa515e1e25cc42162e95469b4d6c575c9}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-line\-\_\-empty@{htp\-\_\-is\-\_\-line\-\_\-empty}} \index{htp\-\_\-is\-\_\-line\-\_\-empty@{htp\-\_\-is\-\_\-line\-\_\-empty}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-line\-\_\-empty}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-line\-\_\-empty ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_aa515e1e25cc42162e95469b4d6c575c9} Is the given line empty? This function expects the line to have a terminating L\-F. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a8b599459708fac234b83e8d8fe58b258}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-line\-\_\-whitespace@{htp\-\_\-is\-\_\-line\-\_\-whitespace}} \index{htp\-\_\-is\-\_\-line\-\_\-whitespace@{htp\-\_\-is\-\_\-line\-\_\-whitespace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-line\-\_\-whitespace}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-line\-\_\-whitespace ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_a8b599459708fac234b83e8d8fe58b258} Does line consist entirely of whitespace characters? \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a01068fcd4418a90ea81a2ad5e4eb8c81}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-lws@{htp\-\_\-is\-\_\-lws}} \index{htp\-\_\-is\-\_\-lws@{htp\-\_\-is\-\_\-lws}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-lws}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-lws ( \begin{DoxyParamCaption} \item[{int}]{c} \end{DoxyParamCaption} )}}\label{htp__util_8c_a01068fcd4418a90ea81a2ad5e4eb8c81} Is character a linear white space character? \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em c} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a238c39a6d7fd7f35735f9c97a1b2aa66}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-separator@{htp\-\_\-is\-\_\-separator}} \index{htp\-\_\-is\-\_\-separator@{htp\-\_\-is\-\_\-separator}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-separator}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-separator ( \begin{DoxyParamCaption} \item[{int}]{c} \end{DoxyParamCaption} )}}\label{htp__util_8c_a238c39a6d7fd7f35735f9c97a1b2aa66} Is character a separator character? \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em c} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a8154aaa13d12e1fea9b066e0881bd125}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-space@{htp\-\_\-is\-\_\-space}} \index{htp\-\_\-is\-\_\-space@{htp\-\_\-is\-\_\-space}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-space}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-space ( \begin{DoxyParamCaption} \item[{int}]{c} \end{DoxyParamCaption} )}}\label{htp__util_8c_a8154aaa13d12e1fea9b066e0881bd125} Is character a white space character? \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em c} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_acd9999e11e39f8434023b786416fdc43}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-text@{htp\-\_\-is\-\_\-text}} \index{htp\-\_\-is\-\_\-text@{htp\-\_\-is\-\_\-text}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-text}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-text ( \begin{DoxyParamCaption} \item[{int}]{c} \end{DoxyParamCaption} )}}\label{htp__util_8c_acd9999e11e39f8434023b786416fdc43} Is character a text character? \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em c} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a7a0e47fdda476b38045a7d3406fb51ee}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-is\-\_\-token@{htp\-\_\-is\-\_\-token}} \index{htp\-\_\-is\-\_\-token@{htp\-\_\-is\-\_\-token}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-is\-\_\-token}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-is\-\_\-token ( \begin{DoxyParamCaption} \item[{int}]{c} \end{DoxyParamCaption} )}}\label{htp__util_8c_a7a0e47fdda476b38045a7d3406fb51ee} Is character a token character? \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em c} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 0 or 1 \end{DoxyReturn} \hypertarget{htp__util_8c_a3eef4d9c98d7bbfbbcb1ff7c5317f3c6}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-log@{htp\-\_\-log}} \index{htp\-\_\-log@{htp\-\_\-log}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-log}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-log ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp, } \item[{const char $\ast$}]{file, } \item[{int}]{line, } \item[{enum {\bf htp\-\_\-log\-\_\-level\-\_\-t}}]{level, } \item[{int}]{code, } \item[{const char $\ast$}]{fmt, } \item[{}]{...} \end{DoxyParamCaption} )}}\label{htp__util_8c_a3eef4d9c98d7bbfbbcb1ff7c5317f3c6} Records one log message. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em file} & \\ \hline \mbox{\tt in} & {\em line} & \\ \hline \mbox{\tt in} & {\em level} & \\ \hline \mbox{\tt in} & {\em code} & \\ \hline \mbox{\tt in} & {\em fmt} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_aa9fcbe29596fb22c40345bec42416f52}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-normalize\-\_\-hostname\-\_\-inplace@{htp\-\_\-normalize\-\_\-hostname\-\_\-inplace}} \index{htp\-\_\-normalize\-\_\-hostname\-\_\-inplace@{htp\-\_\-normalize\-\_\-hostname\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-normalize\-\_\-hostname\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}{\bf bstr}$\ast$ htp\-\_\-normalize\-\_\-hostname\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{hostname} \end{DoxyParamCaption} )}}\label{htp__util_8c_aa9fcbe29596fb22c40345bec42416f52} Normalize request hostname. Convert all characters to lowercase and remove trailing dots from the end, if present. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em hostname} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Normalized hostname. \end{DoxyReturn} \hypertarget{htp__util_8c_a227804ea2d625f14c44e423326042f9a}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-normalize\-\_\-parsed\-\_\-uri@{htp\-\_\-normalize\-\_\-parsed\-\_\-uri}} \index{htp\-\_\-normalize\-\_\-parsed\-\_\-uri@{htp\-\_\-normalize\-\_\-parsed\-\_\-uri}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-normalize\-\_\-parsed\-\_\-uri}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-normalize\-\_\-parsed\-\_\-uri ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx, } \item[{{\bf htp\-\_\-uri\-\_\-t} $\ast$}]{incomplete, } \item[{{\bf htp\-\_\-uri\-\_\-t} $\ast$}]{normalized} \end{DoxyParamCaption} )}}\label{htp__util_8c_a227804ea2d625f14c44e423326042f9a} Normalize a previously-\/parsed request U\-R\-I. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em incomplete} & \\ \hline \mbox{\tt in} & {\em normalized} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K or H\-T\-P\-\_\-\-E\-R\-R\-O\-R \end{DoxyReturn} \hypertarget{htp__util_8c_ae3b688cf78f951a218afde6d2bb3b763}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace@{htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace}} \index{htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace@{htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-normalize\-\_\-uri\-\_\-path\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{s} \end{DoxyParamCaption} )}}\label{htp__util_8c_ae3b688cf78f951a218afde6d2bb3b763} Normalize U\-R\-L path. This function implements the remove dot segments algorithm specified in R\-F\-C 3986, section 5.\-2.\-4. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em s} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_abe97fa5fa00905db42afe94366adcc6a}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-chunked\-\_\-length@{htp\-\_\-parse\-\_\-chunked\-\_\-length}} \index{htp\-\_\-parse\-\_\-chunked\-\_\-length@{htp\-\_\-parse\-\_\-chunked\-\_\-length}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-chunked\-\_\-length}]{\setlength{\rightskip}{0pt plus 5cm}int64\-\_\-t htp\-\_\-parse\-\_\-chunked\-\_\-length ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len} \end{DoxyParamCaption} )}}\label{htp__util_8c_abe97fa5fa00905db42afe94366adcc6a} Parses chunk length (positive hexadecimal number). White space is allowed before and after the number. An error will be returned if the chunk length is greater than I\-N\-T32\-\_\-\-M\-A\-X. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Chunk length, or a negative number on error. \end{DoxyReturn} \hypertarget{htp__util_8c_a50d9fb619fe71bfee3ab812d96ba0b6c}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-content\-\_\-length@{htp\-\_\-parse\-\_\-content\-\_\-length}} \index{htp\-\_\-parse\-\_\-content\-\_\-length@{htp\-\_\-parse\-\_\-content\-\_\-length}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-content\-\_\-length}]{\setlength{\rightskip}{0pt plus 5cm}int64\-\_\-t htp\-\_\-parse\-\_\-content\-\_\-length ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{b} \end{DoxyParamCaption} )}}\label{htp__util_8c_a50d9fb619fe71bfee3ab812d96ba0b6c} Parses Content-\/\-Length string (positive decimal number). White space is allowed before and after the number. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em b} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Content-\/\-Length as a number, or -\/1 on error. \end{DoxyReturn} \hypertarget{htp__util_8c_a3742fd84a15ebfa867623dd7bf26c0e9}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-ct\-\_\-header@{htp\-\_\-parse\-\_\-ct\-\_\-header}} \index{htp\-\_\-parse\-\_\-ct\-\_\-header@{htp\-\_\-parse\-\_\-ct\-\_\-header}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-ct\-\_\-header}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-parse\-\_\-ct\-\_\-header ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{header, } \item[{{\bf bstr} $\ast$$\ast$}]{ct} \end{DoxyParamCaption} )}}\label{htp__util_8c_a3742fd84a15ebfa867623dd7bf26c0e9} \hypertarget{htp__util_8c_a4d502ec2a4632cc8e1e9326c6ab36811}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-header\-\_\-hostport@{htp\-\_\-parse\-\_\-header\-\_\-hostport}} \index{htp\-\_\-parse\-\_\-header\-\_\-hostport@{htp\-\_\-parse\-\_\-header\-\_\-hostport}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-header\-\_\-hostport}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-parse\-\_\-header\-\_\-hostport ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{hostport, } \item[{{\bf bstr} $\ast$$\ast$}]{hostname, } \item[{int $\ast$}]{port, } \item[{uint64\-\_\-t $\ast$}]{flags} \end{DoxyParamCaption} )}}\label{htp__util_8c_a4d502ec2a4632cc8e1e9326c6ab36811} Parses hostport provided in the Host header. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em hostport} & \\ \hline \mbox{\tt out} & {\em hostname} & \\ \hline \mbox{\tt out} & {\em port} & \\ \hline \mbox{\tt out} & {\em flags} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success or H\-T\-P\-\_\-\-E\-R\-R\-O\-R error. \end{DoxyReturn} \hypertarget{htp__util_8c_a812a0f3de059baf63e4be07effe51620}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-hostport@{htp\-\_\-parse\-\_\-hostport}} \index{htp\-\_\-parse\-\_\-hostport@{htp\-\_\-parse\-\_\-hostport}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-hostport}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-parse\-\_\-hostport ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{hostport, } \item[{{\bf bstr} $\ast$$\ast$}]{hostname, } \item[{int $\ast$}]{port, } \item[{int $\ast$}]{invalid} \end{DoxyParamCaption} )}}\label{htp__util_8c_a812a0f3de059baf63e4be07effe51620} Parses an authority string, which consists of a hostname with an optional port number; username and password are not allowed and will not be handled. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em hostport} & \\ \hline \mbox{\tt out} & {\em hostname} & A bstring containing the hostname, or N\-U\-L\-L if the hostname is invalid. If this value is not N\-U\-L\-L, the caller assumes responsibility for memory management. \\ \hline \mbox{\tt out} & {\em port} & Port number, or -\/1 if the port is not present or invalid. \\ \hline \mbox{\tt out} & {\em invalid} & Set to 1 if any part of the authority is invalid. \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success, H\-T\-P\-\_\-\-E\-R\-R\-O\-R on memory allocation failure. \end{DoxyReturn} \hypertarget{htp__util_8c_ae73f7889b2bec1d7c2605c154cc4ecda}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace@{htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace}} \index{htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace@{htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace}]{\setlength{\rightskip}{0pt plus 5cm}int64\-\_\-t htp\-\_\-parse\-\_\-positive\-\_\-integer\-\_\-whitespace ( \begin{DoxyParamCaption} \item[{unsigned char $\ast$}]{data, } \item[{size\-\_\-t}]{len, } \item[{int}]{base} \end{DoxyParamCaption} )}}\label{htp__util_8c_ae73f7889b2bec1d7c2605c154cc4ecda} A somewhat forgiving parser for a positive integer in a given base. Only L\-W\-S is allowed before and after the number. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em data} & \\ \hline \mbox{\tt in} & {\em len} & \\ \hline \mbox{\tt in} & {\em base} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} The parsed number on success; a negative number on error. \end{DoxyReturn} \hypertarget{htp__util_8c_a330b435a16a1f366eed76bf7b7bddba6}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-uri@{htp\-\_\-parse\-\_\-uri}} \index{htp\-\_\-parse\-\_\-uri@{htp\-\_\-parse\-\_\-uri}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-uri}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-parse\-\_\-uri ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{input, } \item[{{\bf htp\-\_\-uri\-\_\-t} $\ast$$\ast$}]{uri} \end{DoxyParamCaption} )}}\label{htp__util_8c_a330b435a16a1f366eed76bf7b7bddba6} Parses request U\-R\-I, making no attempt to validate the contents. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em input} & \\ \hline \mbox{\tt in} & {\em uri} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-E\-R\-R\-O\-R on memory allocation failure, H\-T\-P\-\_\-\-O\-K otherwise \end{DoxyReturn} \hypertarget{htp__util_8c_aaef00410cceff9ae804c86f316e425de}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-parse\-\_\-uri\-\_\-hostport@{htp\-\_\-parse\-\_\-uri\-\_\-hostport}} \index{htp\-\_\-parse\-\_\-uri\-\_\-hostport@{htp\-\_\-parse\-\_\-uri\-\_\-hostport}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-parse\-\_\-uri\-\_\-hostport}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-parse\-\_\-uri\-\_\-hostport ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp, } \item[{{\bf bstr} $\ast$}]{hostport, } \item[{{\bf htp\-\_\-uri\-\_\-t} $\ast$}]{uri} \end{DoxyParamCaption} )}}\label{htp__util_8c_aaef00410cceff9ae804c86f316e425de} Parses hostport provided in the U\-R\-I. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em hostport} & \\ \hline \mbox{\tt in} & {\em uri} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success or H\-T\-P\-\_\-\-E\-R\-R\-O\-R error. \end{DoxyReturn} \hypertarget{htp__util_8c_ae9186694fa6cb9d4985d3c66698f0968}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data@{htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data}} \index{htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data@{htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-req\-\_\-run\-\_\-hook\-\_\-body\-\_\-data ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp, } \item[{{\bf htp\-\_\-tx\-\_\-data\-\_\-t} $\ast$}]{d} \end{DoxyParamCaption} )}}\label{htp__util_8c_ae9186694fa6cb9d4985d3c66698f0968} Run the R\-E\-Q\-U\-E\-S\-T\-\_\-\-B\-O\-D\-Y\-\_\-\-D\-A\-T\-A hook. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em d} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_aa60cc60143dfb38260549c4df5219727}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data@{htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data}} \index{htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data@{htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-res\-\_\-run\-\_\-hook\-\_\-body\-\_\-data ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-connp\-\_\-t} $\ast$}]{connp, } \item[{{\bf htp\-\_\-tx\-\_\-data\-\_\-t} $\ast$}]{d} \end{DoxyParamCaption} )}}\label{htp__util_8c_aa60cc60143dfb38260549c4df5219727} Run the R\-E\-S\-P\-O\-N\-S\-E\-\_\-\-B\-O\-D\-Y\-\_\-\-D\-A\-T\-A hook. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em connp} & \\ \hline \mbox{\tt in} & {\em d} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_a989808ba8cacae96e9c5e0e052a73a3c}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body@{htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body}} \index{htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body@{htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-treat\-\_\-response\-\_\-line\-\_\-as\-\_\-body ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx} \end{DoxyParamCaption} )}}\label{htp__util_8c_a989808ba8cacae96e9c5e0e052a73a3c} Determine if the information provided on the response line is good enough. Browsers are lax when it comes to response line parsing. In most cases they will only look for the words \char`\"{}http\char`\"{} at the beginning. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em tx} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 1 for good enough or 0 for not good enough \end{DoxyReturn} \hypertarget{htp__util_8c_a7745dfd28ae341b34cde2bb1f333b1b8}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string@{htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string}} \index{htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string@{htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ htp\-\_\-tx\-\_\-request\-\_\-progress\-\_\-as\-\_\-string ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx} \end{DoxyParamCaption} )}}\label{htp__util_8c_a7745dfd28ae341b34cde2bb1f333b1b8} \hypertarget{htp__util_8c_a9469285f23ba429b8358c9385ccd6eef}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string@{htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string}} \index{htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string@{htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ htp\-\_\-tx\-\_\-response\-\_\-progress\-\_\-as\-\_\-string ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx} \end{DoxyParamCaption} )}}\label{htp__util_8c_a9469285f23ba429b8358c9385ccd6eef} \hypertarget{htp__util_8c_a3290cc3c0233d21dd5c3e8e97883ea18}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace@{htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace}} \index{htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace@{htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-tx\-\_\-urldecode\-\_\-params\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx, } \item[{{\bf bstr} $\ast$}]{input} \end{DoxyParamCaption} )}}\label{htp__util_8c_a3290cc3c0233d21dd5c3e8e97883ea18} \hypertarget{htp__util_8c_a14e44933747475b68b36ea4b4ec7f1eb}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace@{htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace}} \index{htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace@{htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-tx\-\_\-urldecode\-\_\-uri\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx, } \item[{{\bf bstr} $\ast$}]{input} \end{DoxyParamCaption} )}}\label{htp__util_8c_a14e44933747475b68b36ea4b4ec7f1eb} \hypertarget{htp__util_8c_a6037e8e01478c4aa8bce304c873c182d}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-uri\-\_\-alloc@{htp\-\_\-uri\-\_\-alloc}} \index{htp\-\_\-uri\-\_\-alloc@{htp\-\_\-uri\-\_\-alloc}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-uri\-\_\-alloc}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-uri\-\_\-t}$\ast$ htp\-\_\-uri\-\_\-alloc ( \begin{DoxyParamCaption} \item[{void}]{} \end{DoxyParamCaption} )}}\label{htp__util_8c_a6037e8e01478c4aa8bce304c873c182d} Allocates and initializes a new \hyperlink{structhtp__uri__t}{htp\-\_\-uri\-\_\-t} structure. \begin{DoxyReturn}{Returns} New structure, or N\-U\-L\-L on memory allocation failure. \end{DoxyReturn} \hypertarget{htp__util_8c_af834d04e2f2dcf25ed5f8cf49efb626a}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-uri\-\_\-free@{htp\-\_\-uri\-\_\-free}} \index{htp\-\_\-uri\-\_\-free@{htp\-\_\-uri\-\_\-free}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-uri\-\_\-free}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-uri\-\_\-free ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-uri\-\_\-t} $\ast$}]{uri} \end{DoxyParamCaption} )}}\label{htp__util_8c_af834d04e2f2dcf25ed5f8cf49efb626a} Frees all data contained in the uri, and then the uri itself. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em uri} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_a2a01a96c537538cdefec78b9628b5e93}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-urldecode\-\_\-inplace@{htp\-\_\-urldecode\-\_\-inplace}} \index{htp\-\_\-urldecode\-\_\-inplace@{htp\-\_\-urldecode\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-urldecode\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-urldecode\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-cfg\-\_\-t} $\ast$}]{cfg, } \item[{enum {\bf htp\-\_\-decoder\-\_\-ctx\-\_\-t}}]{ctx, } \item[{{\bf bstr} $\ast$}]{input, } \item[{uint64\-\_\-t $\ast$}]{flags} \end{DoxyParamCaption} )}}\label{htp__util_8c_a2a01a96c537538cdefec78b9628b5e93} Performs in-\/place decoding of the input string, according to the configuration specified by cfg and ctx. On output, various flags (H\-T\-P\-\_\-\-U\-R\-L\-E\-N\-\_\-$\ast$) might be set. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em cfg} & \\ \hline \mbox{\tt in} & {\em ctx} & \\ \hline \mbox{\tt in} & {\em input} & \\ \hline \mbox{\tt out} & {\em flags} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success, H\-T\-P\-\_\-\-E\-R\-R\-O\-R on failure. \end{DoxyReturn} \hypertarget{htp__util_8c_a6a6849d2b4e2477402760923aae8d527}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-urldecode\-\_\-inplace\-\_\-ex@{htp\-\_\-urldecode\-\_\-inplace\-\_\-ex}} \index{htp\-\_\-urldecode\-\_\-inplace\-\_\-ex@{htp\-\_\-urldecode\-\_\-inplace\-\_\-ex}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-urldecode\-\_\-inplace\-\_\-ex}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-urldecode\-\_\-inplace\-\_\-ex ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-cfg\-\_\-t} $\ast$}]{cfg, } \item[{enum {\bf htp\-\_\-decoder\-\_\-ctx\-\_\-t}}]{ctx, } \item[{{\bf bstr} $\ast$}]{input, } \item[{uint64\-\_\-t $\ast$}]{flags, } \item[{int $\ast$}]{expected\-\_\-status\-\_\-code} \end{DoxyParamCaption} )}}\label{htp__util_8c_a6a6849d2b4e2477402760923aae8d527} Performs in-\/place decoding of the input string, according to the configuration specified by cfg and ctx. On output, various flags (H\-T\-P\-\_\-\-U\-R\-L\-E\-N\-\_\-$\ast$) might be set. If something in the input would cause a particular server to respond with an error, the appropriate status code will be set. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em cfg} & \\ \hline \mbox{\tt in} & {\em ctx} & \\ \hline \mbox{\tt in} & {\em input} & \\ \hline \mbox{\tt out} & {\em flags} & \\ \hline \mbox{\tt out} & {\em expected\-\_\-status\-\_\-code} & 0 by default, or status code as necessary\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success, H\-T\-P\-\_\-\-E\-R\-R\-O\-R on failure. \end{DoxyReturn} \hypertarget{htp__util_8c_ac19fd0827df78d7618a6360a0a9e2ac2}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace@{htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace}} \index{htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace@{htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-utf8\-\_\-decode\-\_\-path\-\_\-inplace ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-cfg\-\_\-t} $\ast$}]{cfg, } \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx, } \item[{{\bf bstr} $\ast$}]{path} \end{DoxyParamCaption} )}}\label{htp__util_8c_ac19fd0827df78d7618a6360a0a9e2ac2} Decode a U\-T\-F-\/8 encoded path. Overlong characters will be decoded, invalid characters will be left as-\/is. Best-\/fit mapping will be used to convert U\-T\-F-\/8 into a single-\/byte stream. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em cfg} & \\ \hline \mbox{\tt in} & {\em tx} & \\ \hline \mbox{\tt in} & {\em path} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_a75ad702e0957be72f80dc27900f83ec7}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-utf8\-\_\-validate\-\_\-path@{htp\-\_\-utf8\-\_\-validate\-\_\-path}} \index{htp\-\_\-utf8\-\_\-validate\-\_\-path@{htp\-\_\-utf8\-\_\-validate\-\_\-path}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-utf8\-\_\-validate\-\_\-path}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-utf8\-\_\-validate\-\_\-path ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-tx\-\_\-t} $\ast$}]{tx, } \item[{{\bf bstr} $\ast$}]{path} \end{DoxyParamCaption} )}}\label{htp__util_8c_a75ad702e0957be72f80dc27900f83ec7} Validate a path that is quite possibly U\-T\-F-\/8 encoded. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em tx} & \\ \hline \mbox{\tt in} & {\em path} & \\ \hline \end{DoxyParams} \hypertarget{htp__util_8c_a31cca701d490472a8cdb778a6c0e6560}{\index{htp\-\_\-util.\-c@{htp\-\_\-util.\-c}!htp\-\_\-validate\-\_\-hostname@{htp\-\_\-validate\-\_\-hostname}} \index{htp\-\_\-validate\-\_\-hostname@{htp\-\_\-validate\-\_\-hostname}!htp_util.c@{htp\-\_\-util.\-c}} \subsubsection[{htp\-\_\-validate\-\_\-hostname}]{\setlength{\rightskip}{0pt plus 5cm}int htp\-\_\-validate\-\_\-hostname ( \begin{DoxyParamCaption} \item[{{\bf bstr} $\ast$}]{hostname} \end{DoxyParamCaption} )}}\label{htp__util_8c_a31cca701d490472a8cdb778a6c0e6560} Implements relaxed (not strictly R\-F\-C) hostname validation. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em hostname} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} 1 if the supplied hostname is valid; 0 if it is not. \end{DoxyReturn}