\doxysection{http.\+h}
\hypertarget{http_8h_source}{}\label{http_8h_source}\index{src/http.h@{src/http.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*******************************************************************************}}
\DoxyCodeLine{00002\ \textcolor{comment}{Copyright\ (c)\ 2014,\ Jan\ Koester\ jan.koester@gmx.net}}
\DoxyCodeLine{00003\ \textcolor{comment}{All\ rights\ reserved.}}
\DoxyCodeLine{00004\ \textcolor{comment}{}}
\DoxyCodeLine{00005\ \textcolor{comment}{Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00006\ \textcolor{comment}{modification,\ are\ permitted\ provided\ that\ the\ following\ conditions\ are\ met:}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ \ \ \ *\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ \ \ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ \ \ \ *\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ \ \ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in\ the}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ \ \ \ \ \ documentation\ and/or\ other\ materials\ provided\ with\ the\ distribution.}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ \ \ \ *\ Neither\ the\ name\ of\ the\ <organization>\ nor\ the}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ \ \ \ \ \ names\ of\ its\ contributors\ may\ be\ used\ to\ endorse\ or\ promote\ products}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ \ \ \ \ \ derived\ from\ this\ software\ without\ specific\ prior\ written\ permission.}}
\DoxyCodeLine{00015\ \textcolor{comment}{}}
\DoxyCodeLine{00016\ \textcolor{comment}{THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ THE\ COPYRIGHT\ HOLDERS\ AND\ CONTRIBUTORS\ "{}AS\ IS"{}\ AND}}
\DoxyCodeLine{00017\ \textcolor{comment}{ANY\ EXPRESS\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ THE\ IMPLIED}}
\DoxyCodeLine{00018\ \textcolor{comment}{WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE\ ARE}}
\DoxyCodeLine{00019\ \textcolor{comment}{DISCLAIMED.\ IN\ NO\ EVENT\ SHALL\ <COPYRIGHT\ HOLDER>\ BE\ LIABLE\ FOR\ ANY}}
\DoxyCodeLine{00020\ \textcolor{comment}{DIRECT,\ INDIRECT,\ INCIDENTAL,\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES}}
\DoxyCodeLine{00021\ \textcolor{comment}{(INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;}}
\DoxyCodeLine{00022\ \textcolor{comment}{LOSS\ OF\ USE,\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND}}
\DoxyCodeLine{00023\ \textcolor{comment}{ON\ ANY\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT}}
\DoxyCodeLine{00024\ \textcolor{comment}{(INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ OF\ THIS}}
\DoxyCodeLine{00025\ \textcolor{comment}{SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00026\ \textcolor{comment}{*******************************************************************************/}}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#include\ <stddef.h>}}
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\#include\ <sys/types.h>}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00034\ \textcolor{preprocessor}{\#include\ <deque>}}
\DoxyCodeLine{00035\ \textcolor{preprocessor}{\#include\ <map>}}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00037\ \textcolor{preprocessor}{\#include\ <netplus/socket.h>}}
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\#include\ <netplus/connection.h>}}
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\#include\ <netplus/eventapi.h>}}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#include\ "{}config.h"{}}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#include\ "{}httpdefinitions.h"{}}}
\DoxyCodeLine{00044\ \textcolor{preprocessor}{\#include\ "{}hpack.h"{}}}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \textcolor{keyword}{namespace\ }libhttppp::qpack\ \{\ \textcolor{keyword}{struct\ }HeaderField;\ \}}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \textcolor{keyword}{namespace\ }libhttppp\ \{}
\DoxyCodeLine{00051\ \ \ \textcolor{keyword}{class\ }HttpRequest;}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\ \{}
\DoxyCodeLine{00054\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00055\ \ \ \ \ \textcolor{keyword}{enum}\ HttpProtocol\{}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ HTTP=0,}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HTTPS}{HTTPS}}=1,}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ HTTP3=2}
\DoxyCodeLine{00059\ \ \ \ \ \};}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}();}
\DoxyCodeLine{00062\ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}(\textcolor{keyword}{const}\ std::string\ \&url,\textcolor{keywordtype}{bool}\ http3=\textcolor{keyword}{false});}
\DoxyCodeLine{00063\ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\ \&src);}
\DoxyCodeLine{00064\ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{\string~HttpUrl}}();}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \ \ \ \ \ \textcolor{keywordtype}{bool}\ operator==(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\&\ other)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00067\ \ \ \ \ \ \textcolor{keywordtype}{bool}\ operator<(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\&\ other)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \ \ \ \ \ \textcolor{keywordtype}{int}\ getProtocol()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00070\ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getHost()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00071\ \ \ \ \ \ \textcolor{keywordtype}{int}\ getPort()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00072\ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getPath()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00074\ \ \ \ \ \ \textcolor{keywordtype}{void}\ clear();}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ \ \ \ \ \ std::string\ print()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00077\ }
\DoxyCodeLine{00078\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00079\ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \_protocol;}
\DoxyCodeLine{00080\ \ \ \ \ \ \ std::string\ \_host;}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \_port;}
\DoxyCodeLine{00082\ \ \ \ \ \ \ std::string\ \_path;}
\DoxyCodeLine{00083\ \ \ \};}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpClient}{HttpClient}}\{}
\DoxyCodeLine{00086\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpClient}{HttpClient}}(\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\ \&desturl);}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpClient}{\string~HttpClient}}()=\textcolor{keywordflow}{default};}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ reconnect();}
\DoxyCodeLine{00090\ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<char>\ Get(\mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}\ \&nreq);}
\DoxyCodeLine{00091\ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<char>\ Post(\mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}\ \&nreq,\textcolor{keyword}{const}\ std::vector<char>\ \&post);}
\DoxyCodeLine{00092\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ resetConnection();}
\DoxyCodeLine{00094\ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ readchunk(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *data,\textcolor{keywordtype}{int}\ datasize,\textcolor{keywordtype}{int}\ \&pos);}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ \ \ \ \ \ \ \textcolor{comment}{//\ HTTP/2\ client\ helpers}}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \_isH2\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<char>\ \_h2Request(\textcolor{keyword}{const}\ std::string\ \&method,}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}\ \&nreq,}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<char>\ *postBody\ =\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00101\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\ \_url;}
\DoxyCodeLine{00103\ \ \ \ \ \ \ std::unique\_ptr<netplus::socket>\ \_cltsock;}
\DoxyCodeLine{00104\ \ \ \ \ \ \ netplus::x509cert\ \_cert;}
\DoxyCodeLine{00105\ \ \ \};}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00108\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpHeader}{HttpHeader}}\ \{}
\DoxyCodeLine{00109\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\{}
\DoxyCodeLine{00111\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\{}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator=(\textcolor{keyword}{const}\ std::string\ \&val);}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator=(\textcolor{keywordtype}{size\_t}\ val);}
\DoxyCodeLine{00116\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator=(\textcolor{keywordtype}{int}\ val);}
\DoxyCodeLine{00117\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\&\ operator=(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&val);}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00119\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator<<(\textcolor{keyword}{const}\ std::string\ \&value);}
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator<<(\textcolor{keywordtype}{size\_t}\ value);}
\DoxyCodeLine{00121\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator<<(\textcolor{keywordtype}{int}\ value);}
\DoxyCodeLine{00122\ }
\DoxyCodeLine{00123\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getvalue();}
\DoxyCodeLine{00124\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ getIntvalue();}
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ getSizetValue();}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \ \ \ \ \ *nextvalue();}
\DoxyCodeLine{00128\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}(\textcolor{keyword}{const}\ std::string\&\ val);}
\DoxyCodeLine{00129\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\&\ val);}
\DoxyCodeLine{00130\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}()=\textcolor{keywordflow}{default};}
\DoxyCodeLine{00131\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{\string~Values}}()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00132\ \ \ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00133\ \ \ \ \ \ \ \ \ std::string\ \ \_value;}
\DoxyCodeLine{00134\ \ \ \ \ \ \ \ \ std::unique\_ptr<Values>\ \_nextvalue=\textcolor{keyword}{nullptr};}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}};}
\DoxyCodeLine{00136\ \ \ \ \ \ \ \};}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00138\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ *getfirstValue();}
\DoxyCodeLine{00139\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&at(\textcolor{keywordtype}{int}\ pos);}
\DoxyCodeLine{00140\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&operator[](\textcolor{keywordtype}{int}\ pos);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00142\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ push\_back(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \&val);}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ push\_back(\textcolor{keyword}{const}\ std::string\ \&val);}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ push\_back(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ val);}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ push\_back(\textcolor{keywordtype}{size\_t}\ val);}
\DoxyCodeLine{00146\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ push\_back(\textcolor{keywordtype}{int}\ val);}
\DoxyCodeLine{00147\ }
\DoxyCodeLine{00148\ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ empty();}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ erase(\textcolor{keywordtype}{int}\ pos);}
\DoxyCodeLine{00151\ }
\DoxyCodeLine{00152\ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ clear();}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00154\ \ \ \ \ \ \ \textcolor{keyword}{const}\ std\ ::string\ \&getkey();}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ *nextHeaderData();}
\DoxyCodeLine{00157\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}(\textcolor{keyword}{const}\ std\ ::string\ \&key);}
\DoxyCodeLine{00158\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{\string~HeaderData}}()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00160\ \ \ \ \ \ \ std::string\ \ \_Key;}
\DoxyCodeLine{00161\ \ \ \ \ \ \ std::unique\_ptr<Values>\ \_firstValue=\textcolor{keyword}{nullptr};}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{Values}}\ \ \ \ \ \ *\_lastValue=\textcolor{keyword}{nullptr};}
\DoxyCodeLine{00163\ \ \ \ \ \ \ std::unique\_ptr<HeaderData>\ \ \_nextHeaderData=\textcolor{keyword}{nullptr};}
\DoxyCodeLine{00164\ \ \ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpHeader}{HttpHeader}};}
\DoxyCodeLine{00165\ \ \ \ \ \};}
\DoxyCodeLine{00166\ \ \ \ \ }
\DoxyCodeLine{00167\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ \ \ \ *getfirstHeaderData();}
\DoxyCodeLine{00168\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ \ \ \ *getHeaderData(\textcolor{keyword}{const}\ std\ ::string\ \&key)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00169\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ \ \ \ *setHeaderData(\textcolor{keyword}{const}\ std\ ::string\ \&key);}
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ deldata(\textcolor{keyword}{const}\ std\ ::string\ \&key);}
\DoxyCodeLine{00172\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ deldata(\mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}*pos);}
\DoxyCodeLine{00173\ \ \ \ \ }
\DoxyCodeLine{00174\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ getElements();}
\DoxyCodeLine{00175\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ getHeaderSize();}
\DoxyCodeLine{00176\ }
\DoxyCodeLine{00177\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ clear();}
\DoxyCodeLine{00178\ \ \ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00179\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader}{HttpHeader}}();}
\DoxyCodeLine{00180\ \ \ \ \ \textcolor{keyword}{virtual}\ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader}{\string~HttpHeader}}()=\textcolor{keywordflow}{default};}
\DoxyCodeLine{00181\ \ \ \ \ std::unique\_ptr<HeaderData>\ \_firstHeaderData;}
\DoxyCodeLine{00182\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ *\_lastHeaderData;}
\DoxyCodeLine{00183\ \ \ \};}
\DoxyCodeLine{00184\ \ \ }
\DoxyCodeLine{00185\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{HttpResponse}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader}{HttpHeader}},\textcolor{keyword}{public}\ netplus::con\ \{}
\DoxyCodeLine{00186\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00187\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{HttpResponse}}();}
\DoxyCodeLine{00188\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{HttpResponse}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{HttpResponse}}\ \&src);}
\DoxyCodeLine{00189\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{\string~HttpResponse}}();}
\DoxyCodeLine{00190\ }
\DoxyCodeLine{00191\ \ \ \ \ \textcolor{comment}{/*server\ methods*/}}
\DoxyCodeLine{00192\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ setState(\textcolor{keyword}{const}\ std\ ::string\ \&httpstate);}
\DoxyCodeLine{00193\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ setContentType(\textcolor{keyword}{const}\ std\ ::string\ \&type);}
\DoxyCodeLine{00194\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ setContentLength(\textcolor{keywordtype}{size\_t}\ len);}
\DoxyCodeLine{00195\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ setConnection(\textcolor{keyword}{const}\ std\ ::string\ \&type);}
\DoxyCodeLine{00196\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ setTransferEncoding(\textcolor{keyword}{const}\ std\ ::string\ \&enc);}
\DoxyCodeLine{00197\ }
\DoxyCodeLine{00198\ \ \ \ \ \textcolor{comment}{/*client\ methods*/}}
\DoxyCodeLine{00199\ \ \ \ \ \textcolor{keyword}{const}\ std\ ::string\ \&getState()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00200\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getStatusCode()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00201\ \ \ \ \ \textcolor{keyword}{const}\ std\ ::string\ \&getContentType()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00202\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ \ \ getContentLength()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00203\ \ \ \ \ \textcolor{keyword}{const}\ std\ ::string\ \&getConnection()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00204\ \ \ \ \ \textcolor{keyword}{const}\ std\ ::string\ \&getVersion()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00205\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData_1_1Values}{HttpHeader::HeaderData::Values}}\ *getTransferEncoding()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00206\ }
\DoxyCodeLine{00207\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ printHeader(std::vector<char>\ \&buffer);}
\DoxyCodeLine{00208\ }
\DoxyCodeLine{00209\ \ \ \ \ \textcolor{comment}{/*server\ methods*/}}
\DoxyCodeLine{00210\ \ \ \ \ \textcolor{keywordtype}{void}\ send(netplus::con\ \&curconnection,\textcolor{keyword}{const}\ std::string\ \&data,\textcolor{keywordtype}{int}\ datalen=0);\ \textcolor{comment}{//only\ use\ as\ server}}
\DoxyCodeLine{00211\ \ \ \ \ \textcolor{keywordtype}{void}\ send(netplus::con\ \&curconnection,\textcolor{keyword}{const}\ \textcolor{keywordtype}{unsigned}\ \ \textcolor{keywordtype}{char}\ *data,\textcolor{keywordtype}{int}\ datalen);\ \textcolor{comment}{//only\ use\ as\ server}}
\DoxyCodeLine{00212\ \ \ \ \ \textcolor{keywordtype}{void}\ send(netplus::con\ \&curconnection,\textcolor{keyword}{const}\ std::vector<char>\ \&data,\textcolor{keywordtype}{int}\ datalen=0);\ \textcolor{comment}{//only\ use\ as\ server}}
\DoxyCodeLine{00213\ }
\DoxyCodeLine{00214\ \ \ \ \ \textcolor{comment}{/*client\ method*/}}
\DoxyCodeLine{00215\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ parse(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *in,\textcolor{keywordtype}{size\_t}\ inlen);}
\DoxyCodeLine{00216\ }
\DoxyCodeLine{00217\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00218\ \ \ \ \ \textcolor{keywordtype}{bool}\ \_storeResponseInfo(netplus::con\ \&curconnection,\ \textcolor{keywordtype}{int}\ datalen);}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00220\ \ \ \ \ std::string\ \ \ \ \ \ \_State=HTTP200;}
\DoxyCodeLine{00221\ \ \ \ \ std::string\ \ \ \ \ \ \_Version;}
\DoxyCodeLine{00222\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \_StatusCode=200;}
\DoxyCodeLine{00223\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ *\_TransferEncoding;}
\DoxyCodeLine{00224\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ *\_Connection;}
\DoxyCodeLine{00225\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ *\_ContentType;}
\DoxyCodeLine{00226\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader_1_1HeaderData}{HeaderData}}\ \ \ \ \ \ *\_ContentLength;}
\DoxyCodeLine{00227\ \ \ \ \ \textcolor{keyword}{mutable}\ std::string\ \_ContentTypeCache;}
\DoxyCodeLine{00228\ \ \ \};}
\DoxyCodeLine{00229\ \ \ }
\DoxyCodeLine{00230\ \ }
\DoxyCodeLine{00231\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{classlibhttppp_1_1HttpHeader}{HttpHeader}},\ \textcolor{keyword}{public}\ netplus::con\{}
\DoxyCodeLine{00232\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00233\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}();}
\DoxyCodeLine{00234\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}(netplus::eventapi\ *evapi);}
\DoxyCodeLine{00235\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{\string~HttpRequest}}();}
\DoxyCodeLine{00236\ }
\DoxyCodeLine{00237\ \ \ \ \ \textcolor{keywordtype}{void}\ clear();}
\DoxyCodeLine{00238\ }
\DoxyCodeLine{00239\ \ \ \ \ \textcolor{comment}{/*server\ methods*/}}
\DoxyCodeLine{00240\ }
\DoxyCodeLine{00241\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ parse();\ \textcolor{comment}{//only\ use\ as\ server}}
\DoxyCodeLine{00242\ }
\DoxyCodeLine{00243\ \ \ \ \ \textcolor{comment}{/*protocol-\/specific\ parse\ helpers\ (all\ store\ into\ \_firstHeaderData)*/}}
\DoxyCodeLine{00244\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ parseH2(\textcolor{keyword}{const}\ std::vector<hpack::HeaderField>\ \&headers,\ uint32\_t\ stream\_id\ =\ 0);}
\DoxyCodeLine{00245\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ parseH3(\textcolor{keyword}{const}\ std::vector<qpack::HeaderField>\ \&headers);}
\DoxyCodeLine{00246\ }
\DoxyCodeLine{00247\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ printHeader(std::string\ \&buffer);}
\DoxyCodeLine{00248\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getRequestType();}
\DoxyCodeLine{00249\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getRequestURL();}
\DoxyCodeLine{00250\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getRequest();}
\DoxyCodeLine{00251\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getRequestLength();}
\DoxyCodeLine{00252\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getRequestVersion();}
\DoxyCodeLine{00253\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getContentLength();}
\DoxyCodeLine{00254\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getMaxUploadSize();}
\DoxyCodeLine{00255\ }
\DoxyCodeLine{00256\ \ \ \ \ \textcolor{comment}{/*mobilphone\ switch*/}}
\DoxyCodeLine{00257\ \ \ \ \ \textcolor{keywordtype}{bool}\ isMobile();}
\DoxyCodeLine{00258\ }
\DoxyCodeLine{00259\ \ \ \ \ \textcolor{comment}{/*Client\ methods*/}}
\DoxyCodeLine{00260\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ setRequestType(\textcolor{keywordtype}{int}\ req);}
\DoxyCodeLine{00261\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ setRequestURL(\textcolor{keyword}{const}\ std::string\ \&url);}
\DoxyCodeLine{00262\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ setRequestVersion(\textcolor{keyword}{const}\ std::string\ \&version);}
\DoxyCodeLine{00263\ \ \ \ \ \textcolor{comment}{/*only\ for\ post\ Reuquesttype*/}}
\DoxyCodeLine{00264\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ setRequestData(\textcolor{keyword}{const}\ std::string\ \&data,\textcolor{keywordtype}{size\_t}\ len);}
\DoxyCodeLine{00265\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ setMaxUploadSize(\textcolor{keywordtype}{size\_t}\ upsize);}
\DoxyCodeLine{00266\ }
\DoxyCodeLine{00267\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ \ \ \ \ \ \ send(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpUrl}{HttpUrl}}\ \&dest,std::unique\_ptr<netplus::socket>\ \&sock);}
\DoxyCodeLine{00268\ }
\DoxyCodeLine{00269\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00270\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ parseH1();\ \textcolor{comment}{//\ HTTP/1.x\ request\ parsing}}
\DoxyCodeLine{00271\ }
\DoxyCodeLine{00272\ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00273\ \textcolor{comment}{\ \ \ \ \ *\ Helper:\ extracts\ URL\ path\ from\ :path\ header\ (strips\ query\ string).}}
\DoxyCodeLine{00274\ \textcolor{comment}{\ \ \ \ \ *\ Used\ by\ getRequestURL()\ and\ parse\ helpers.}}
\DoxyCodeLine{00275\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{00276\ \ \ \ \ \textcolor{keyword}{static}\ std::string\ extractPath(\textcolor{keyword}{const}\ std::string\ \&target);}
\DoxyCodeLine{00277\ }
\DoxyCodeLine{00278\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_RequestType\ =\ PARSEREQUEST;}
\DoxyCodeLine{00279\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ \_MaxUploadSize\ =\ DEFAULT\_UPLOADSIZE;}
\DoxyCodeLine{00280\ }
\DoxyCodeLine{00281\ \ \ \ \ \textcolor{comment}{//\ Cached\ strings\ derived\ from\ \_firstHeaderData\ pseudo-\/headers.}}
\DoxyCodeLine{00282\ \ \ \ \ \textcolor{comment}{//\ Populated\ by\ parseH1/parseH2/parseH3,\ read\ by\ getters.}}
\DoxyCodeLine{00283\ \ \ \ \ \textcolor{keyword}{mutable}\ std::string\ \_cachedRequestURL;}
\DoxyCodeLine{00284\ \ \ \ \ \textcolor{keyword}{mutable}\ std::string\ \_cachedRequest;}
\DoxyCodeLine{00285\ \ \ \ \ \textcolor{keyword}{mutable}\ std::string\ \_cachedRequestVersion;}
\DoxyCodeLine{00286\ }
\DoxyCodeLine{00287\ \ \ \ \ \textcolor{comment}{//\ HTTP/2\ and\ HTTP/3\ protocol\ state\ (managed\ by\ HttpEvent).}}
\DoxyCodeLine{00288\ \ \ \ \ \textcolor{comment}{//\ All\ H2-\/specific\ mutable\ state\ lives\ in\ a\ heap-\/allocated\ struct\ so}}
\DoxyCodeLine{00289\ \ \ \ \ \textcolor{comment}{//\ that\ inline-\/layout\ corruption\ of\ HttpRequest\ cannot\ trash\ the}}
\DoxyCodeLine{00290\ \ \ \ \ \textcolor{comment}{//\ deque\ /\ map\ /\ decoder\ internals.}}
\DoxyCodeLine{00291\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_httpProtocol\ =\ 0;\ \ \textcolor{comment}{//\ 0=HTTP/1.x,\ 1=HTTP/2,\ 2=HTTP/3}}
\DoxyCodeLine{00292\ }
\DoxyCodeLine{00293\ \ \ \ \ \textcolor{keyword}{struct\ }H2PendingResponse\ \{}
\DoxyCodeLine{00294\ \ \ \ \ \ \ uint32\_t\ \ \ \ streamId;}
\DoxyCodeLine{00295\ \ \ \ \ \ \ std::string\ body;\ \ \ \ \ \ \ \textcolor{comment}{//\ remaining\ body\ data\ to\ send\ as\ DATA\ frames}}
\DoxyCodeLine{00296\ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ offset\ =\ 0;\ \textcolor{comment}{//\ how\ far\ into\ body\ we've\ sent}}
\DoxyCodeLine{00297\ \ \ \ \ \};}
\DoxyCodeLine{00298\ }
\DoxyCodeLine{00299\ \ \ \ \ \textcolor{keyword}{struct\ }H2PendingIncoming\ \{}
\DoxyCodeLine{00300\ \ \ \ \ \ \ std::vector<hpack::HeaderField>\ headers;}
\DoxyCodeLine{00301\ \ \ \ \ \ \ std::string\ body;}
\DoxyCodeLine{00302\ \ \ \ \ \};}
\DoxyCodeLine{00303\ }
\DoxyCodeLine{00304\ \ \ \ \ \textcolor{keyword}{struct\ }H2State\ \{}
\DoxyCodeLine{00305\ \ \ \ \ \ \ uint32\_t\ \ \ \ \ \ \ \ \ \ streamId\ =\ 0;}
\DoxyCodeLine{00306\ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \ \ \ \ \ \ headersSent\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{00307\ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ expectedContentLength\ =\ 0;}
\DoxyCodeLine{00308\ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \ \ \ \ \ \ \ \ \ \ \ bodyBytesSent\ =\ 0;}
\DoxyCodeLine{00309\ \ \ \ \ \ \ std::deque<H2PendingResponse>\ \ \ \ \ \ \ \ \ \ \ \ pendingResponses;}
\DoxyCodeLine{00310\ \ \ \ \ \ \ std::map<uint32\_t,\ H2PendingIncoming>\ \ \ \ pendingIncoming;}
\DoxyCodeLine{00311\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1hpack_1_1Decoder}{hpack::Decoder}}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ hpackDecoder;}
\DoxyCodeLine{00312\ \ \ \ \ \};}
\DoxyCodeLine{00313\ }
\DoxyCodeLine{00314\ \ \ \ \ \textcolor{comment}{//\ Lazily\ allocated\ when\ the\ connection\ is\ upgraded\ to\ HTTP/2.}}
\DoxyCodeLine{00315\ \ \ \ \ std::unique\_ptr<H2State>\ \_h2;}
\DoxyCodeLine{00316\ }
\DoxyCodeLine{00317\ \ \ \ \ \textcolor{comment}{//\ Allocate\ H2\ state\ if\ not\ yet\ present;\ return\ reference.}}
\DoxyCodeLine{00318\ \ \ \ \ H2State\ \&h2state()\ \{}
\DoxyCodeLine{00319\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\_h2)\ \_h2\ =\ std::make\_unique<H2State>();}
\DoxyCodeLine{00320\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\_h2;}
\DoxyCodeLine{00321\ \ \ \ \ \}}
\DoxyCodeLine{00322\ }
\DoxyCodeLine{00323\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpForm}{HttpForm}};}
\DoxyCodeLine{00324\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{HttpResponse}};}
\DoxyCodeLine{00325\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpEvent}{HttpEvent}};}
\DoxyCodeLine{00326\ \ \ \};}
\DoxyCodeLine{00327\ \ \ }
\DoxyCodeLine{00328\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpForm}{HttpForm}}\ \{}
\DoxyCodeLine{00329\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00330\ \ \ \ \ \textcolor{comment}{//\ ───\ Multipart\ form-\/data\ (RFC\ 2046)\ ───────────────────}}
\DoxyCodeLine{00331\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structlibhttppp_1_1HttpForm_1_1MultipartEntry}{MultipartEntry}}\ \{}
\DoxyCodeLine{00332\ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structlibhttppp_1_1HttpForm_1_1MultipartEntry_1_1Header}{Header}}\ \{}
\DoxyCodeLine{00333\ \ \ \ \ \ \ \ \ std::string\ key;\ \ \ \ \textcolor{comment}{//\ lowercased\ header\ name\ (e.g.\ "{}content-\/disposition"{})}}
\DoxyCodeLine{00334\ \ \ \ \ \ \ \ \ std::string\ value;\ \ \textcolor{comment}{//\ full\ header\ value}}
\DoxyCodeLine{00335\ \ \ \ \ \ \ \};}
\DoxyCodeLine{00336\ }
\DoxyCodeLine{00337\ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structlibhttppp_1_1HttpForm_1_1MultipartEntry_1_1Disposition}{Disposition}}\ \{}
\DoxyCodeLine{00338\ \ \ \ \ \ \ \ \ std::string\ key;\ \ \ \ \textcolor{comment}{//\ e.g.\ "{}name"{},\ "{}filename"{}}}
\DoxyCodeLine{00339\ \ \ \ \ \ \ \ \ std::string\ value;\ \ \textcolor{comment}{//\ e.g.\ "{}field1"{},\ "{}upload.txt"{}}}
\DoxyCodeLine{00340\ \ \ \ \ \ \ \};}
\DoxyCodeLine{00341\ }
\DoxyCodeLine{00342\ \ \ \ \ \ \ std::vector<Header>\ \ \ \ \ \ headers;}
\DoxyCodeLine{00343\ \ \ \ \ \ \ std::vector<Disposition>\ dispositions;}
\DoxyCodeLine{00344\ \ \ \ \ \ \ std::vector<char>\ \ \ \ \ \ \ \ value;\ \ \textcolor{comment}{//\ raw\ body\ (binary-\/safe\ for\ file\ uploads)}}
\DoxyCodeLine{00345\ \ \ \ \ \};}
\DoxyCodeLine{00346\ }
\DoxyCodeLine{00347\ \ \ \ \ \textcolor{comment}{//\ ───\ URL-\/encoded\ form\ data\ ────────────────────────────}}
\DoxyCodeLine{00348\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structlibhttppp_1_1HttpForm_1_1UrlEntry}{UrlEntry}}\ \{}
\DoxyCodeLine{00349\ \ \ \ \ \ \ std::string\ key;}
\DoxyCodeLine{00350\ \ \ \ \ \ \ std::string\ value;}
\DoxyCodeLine{00351\ \ \ \ \ \};}
\DoxyCodeLine{00352\ }
\DoxyCodeLine{00353\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpForm}{HttpForm}}()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00354\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpForm}{\string~HttpForm}}()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00355\ }
\DoxyCodeLine{00356\ \ \ \ \ \textcolor{keywordtype}{void}\ parse(\mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{HttpRequest}}\ \&request);}
\DoxyCodeLine{00357\ }
\DoxyCodeLine{00358\ \ \ \ \ \textcolor{comment}{//\ Accessors}}
\DoxyCodeLine{00359\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \&getContentType()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ \_contentType;\ \}}
\DoxyCodeLine{00360\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \&getBoundary()\textcolor{keyword}{\ \ \ \ const\ }\{\ \textcolor{keywordflow}{return}\ \_boundary;\ \}}
\DoxyCodeLine{00361\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<MultipartEntry>\ \ \&multipartData()\textcolor{keyword}{\ \ const\ }\{\ \textcolor{keywordflow}{return}\ \_multipartEntries;\ \}}
\DoxyCodeLine{00362\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<UrlEntry>\ \ \ \ \ \ \ \ \&urlData()\textcolor{keyword}{\ \ \ \ \ \ \ \ const\ }\{\ \textcolor{keywordflow}{return}\ \_urlEntries;\ \}}
\DoxyCodeLine{00363\ }
\DoxyCodeLine{00364\ \ \ \ \ \textcolor{comment}{//\ URL\ encoding\ /\ decoding\ utilities}}
\DoxyCodeLine{00365\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ urlDecode(\textcolor{keyword}{const}\ std::string\ \&in,\ std::string\ \&out);}
\DoxyCodeLine{00366\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ urlEncode(\textcolor{keyword}{const}\ std::string\ \&in,\ std::string\ \&out);}
\DoxyCodeLine{00367\ }
\DoxyCodeLine{00368\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00369\ \ \ \ \ \textcolor{keywordtype}{void}\ \_parseMultipart(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *data,\ \textcolor{keywordtype}{size\_t}\ len);}
\DoxyCodeLine{00370\ \ \ \ \ \textcolor{keywordtype}{void}\ \_parseMultiSection(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *data,\ \textcolor{keywordtype}{size\_t}\ len,\ \textcolor{keywordtype}{size\_t}\ start,\ \textcolor{keywordtype}{size\_t}\ end);}
\DoxyCodeLine{00371\ \ \ \ \ \textcolor{keywordtype}{void}\ \_parseUrlDecode(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *data,\ \textcolor{keywordtype}{size\_t}\ len);}
\DoxyCodeLine{00372\ }
\DoxyCodeLine{00373\ \ \ \ \ std::string\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_boundary;}
\DoxyCodeLine{00374\ \ \ \ \ std::string\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_contentType;}
\DoxyCodeLine{00375\ \ \ \ \ std::vector<MultipartEntry>\ \ \_multipartEntries;}
\DoxyCodeLine{00376\ \ \ \ \ std::vector<UrlEntry>\ \ \ \ \ \ \ \ \_urlEntries;}
\DoxyCodeLine{00377\ \ \ \};}
\DoxyCodeLine{00378\ }
\DoxyCodeLine{00379\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpCookie}{HttpCookie}}\ \{}
\DoxyCodeLine{00380\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00381\ \ \ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\ \{}
\DoxyCodeLine{00382\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00383\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\ *nextCookieData()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00384\ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getKey()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00385\ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getValue()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00386\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}()=\textcolor{keywordflow}{default};}
\DoxyCodeLine{00387\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\&\ src);}
\DoxyCodeLine{00388\ \ \ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{\string~CookieData}}();}
\DoxyCodeLine{00389\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00390\ \ \ \ \ \ \ std::string\ \_Key;}
\DoxyCodeLine{00391\ \ \ \ \ \ \ std::string\ \_Value;}
\DoxyCodeLine{00392\ \ \ \ \ \ \ std::unique\_ptr\ <CookieData>\ \_nextCookieData=\textcolor{keyword}{nullptr};}
\DoxyCodeLine{00393\ }
\DoxyCodeLine{00394\ \ \ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpCookie}{HttpCookie}};}
\DoxyCodeLine{00395\ \ \ \ \ \};}
\DoxyCodeLine{00396\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie}{HttpCookie}}();}
\DoxyCodeLine{00397\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie}{\string~HttpCookie}}();}
\DoxyCodeLine{00398\ \ \ \ \ \textcolor{keywordtype}{void}\ parse(\mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{libhttppp::HttpRequest}}\&\ curreq);}
\DoxyCodeLine{00399\ \ \ \ \ \textcolor{keywordtype}{void}\ setcookie(\mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{libhttppp::HttpResponse}}\&\ curresp,}
\DoxyCodeLine{00400\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&key,\textcolor{keyword}{const}\ std::string\ \&value,}
\DoxyCodeLine{00401\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&comment=\textcolor{stringliteral}{"{}"{}},\textcolor{keyword}{const}\ std::string\ \&domain=\textcolor{stringliteral}{"{}"{}},}
\DoxyCodeLine{00402\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ maxage=-\/1,\textcolor{keyword}{const}\ std::string\ \&path=\textcolor{stringliteral}{"{}"{}},}
\DoxyCodeLine{00403\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ secure=\textcolor{keyword}{false},\textcolor{keyword}{const}\ std::string\ \&version=\textcolor{stringliteral}{"{}1"{}},\textcolor{keyword}{const}\ std::string\ \&samesite=\textcolor{stringliteral}{"{}"{}},\textcolor{keywordtype}{bool}\ httponly=\textcolor{keyword}{false});}
\DoxyCodeLine{00404\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\ \ \ \ *getfirstCookieData();}
\DoxyCodeLine{00405\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\ \ \ \ *getlastCookieData();}
\DoxyCodeLine{00406\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\ \ \ \ *addCookieData();}
\DoxyCodeLine{00407\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00408\ \ \ \ \ std::unique\_ptr\ <CookieData>\ \_firstCookieData;}
\DoxyCodeLine{00409\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpCookie_1_1CookieData}{CookieData}}\ \ \ \ \ *\_lastCookieData;}
\DoxyCodeLine{00410\ \ \ \};}
\DoxyCodeLine{00411\ }
\DoxyCodeLine{00412\ \textcolor{preprocessor}{\#define\ BASICAUTH\ \ 0}}
\DoxyCodeLine{00413\ \textcolor{preprocessor}{\#define\ DIGESTAUTH\ 1}}
\DoxyCodeLine{00414\ \textcolor{preprocessor}{\#define\ NTLMAUTH\ \ \ 2}}
\DoxyCodeLine{00415\ \ \ }
\DoxyCodeLine{00416\ \ \ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1HttpAuth}{HttpAuth}}\ \{}
\DoxyCodeLine{00417\ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00418\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpAuth}{HttpAuth}}();}
\DoxyCodeLine{00419\ \ \ \ \ \mbox{\hyperlink{classlibhttppp_1_1HttpAuth}{\string~HttpAuth}}();}
\DoxyCodeLine{00420\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ parse(\mbox{\hyperlink{classlibhttppp_1_1HttpRequest}{libhttppp::HttpRequest}}\ \&curreq);}
\DoxyCodeLine{00421\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ setAuth(\mbox{\hyperlink{classlibhttppp_1_1HttpResponse}{libhttppp::HttpResponse}}\ \&curresp);}
\DoxyCodeLine{00422\ \ \ \ \ }
\DoxyCodeLine{00423\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ setAuthType(\textcolor{keywordtype}{int}\ authtype);}
\DoxyCodeLine{00424\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ setRealm(\textcolor{keyword}{const}\ std::string\ \&realm);}
\DoxyCodeLine{00425\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ setUsername(\textcolor{keyword}{const}\ std::string\ \&username);}
\DoxyCodeLine{00426\ \ \ \ \ \textcolor{keywordtype}{void}\ \ \ \ \ \ \ \ setPassword(\textcolor{keyword}{const}\ std::string\ \&password);}
\DoxyCodeLine{00427\ \ \ \ \ }
\DoxyCodeLine{00428\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getUsername();}
\DoxyCodeLine{00429\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getPassword();}
\DoxyCodeLine{00430\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ getAuthType();}
\DoxyCodeLine{00431\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&getAuthRequest();}
\DoxyCodeLine{00432\ \ \ \ \ }
\DoxyCodeLine{00433\ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00434\ \ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \_Authtype;}
\DoxyCodeLine{00435\ \ \ \ \ std::string\ \_Username;}
\DoxyCodeLine{00436\ \ \ \ \ std::string\ \_Password;}
\DoxyCodeLine{00437\ \ \ \ \ std::string\ \_Realm;}
\DoxyCodeLine{00438\ \ \ \ \ std::string\ \_Nonce;}
\DoxyCodeLine{00439\ \ \ \ \ }
\DoxyCodeLine{00440\ \ \ \};}
\DoxyCodeLine{00441\ \};}

\end{DoxyCode}
