get__request__line_8c.tex 2 KB
\hypertarget{get__request__line_8c}{
\section{src/http/request/parser/get\_\-request\_\-line.c File Reference}
\label{get__request__line_8c}\index{src/http/request/parser/get\_\-request\_\-line.c@{src/http/request/parser/get\_\-request\_\-line.c}}
}
{\ttfamily \#include $<$string.h$>$}\par
{\ttfamily \#include \char`\"{}http/request.h\char`\"{}}\par
Include dependency graph for get\_\-request\_\-line.c:
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{get__request__line_8c_a47a4a36f54b295507a2599488a4a6077}{httpRequestParserGetRequestLine} (\hyperlink{structHttpRequest}{HttpRequest} request, char $\ast$line)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{get__request__line_8c_a47a4a36f54b295507a2599488a4a6077}{
\index{get\_\-request\_\-line.c@{get\_\-request\_\-line.c}!httpRequestParserGetRequestLine@{httpRequestParserGetRequestLine}}
\index{httpRequestParserGetRequestLine@{httpRequestParserGetRequestLine}!get_request_line.c@{get\_\-request\_\-line.c}}
\subsubsection[{httpRequestParserGetRequestLine}]{\setlength{\rightskip}{0pt plus 5cm}void httpRequestParserGetRequestLine (
\begin{DoxyParamCaption}
\item[{{\bf HttpRequest}}]{request, }
\item[{char $\ast$}]{line}
\end{DoxyParamCaption}
)}}
\label{get__request__line_8c_a47a4a36f54b295507a2599488a4a6077}


Definition at line 7 of file get\_\-request\_\-line.c.


\begin{DoxyCode}
{
        char * method, * uri, * version;

        method = line;

        uri    = strchr(line, ' ');
        *uri++ = 0;
        for (; *uri == ' ' && *uri != 0; uri++);

        version    = strchr(uri, ' ');
        *version++ = 0;
        for (; *version == ' ' && *version != 0; version++);

        request->method  = malloc(strlen(method) + 1);
        strcpy(request->method, method);
        request->uri     = malloc(strlen(uri) + 1);
        strcpy(request->uri, uri);
        request->version = malloc(strlen(version) + 1);
        strcpy(request->version, method);
}
\end{DoxyCode}


Here is the caller graph for this function: