📄 type_ghttpserver.html
字号:
<html><head><title>Generated Documentation</title></head><body> <image src="headerimage.png"> <br><br><table><tr><td><big><big><big style="font-family: arial;"><b>GHttpServer</b></big></big></big><br><br></td><td> This class allows you to implement a simple HTTP daemon</td></tr></table><br><br><big><big><i>Statics (public)</i></big></big><br><div style="margin-left: 40px;">void <big><b>ParseParams</b></big>(<a href="type_GStringHeap.html">GStringHeap</a>* pStringHeap, <a href="type_GConstStringHashTable.html">GConstStringHashTable</a>* pTable, const char* szParams)<br><div style="margin-left: 80px;"><font color=brown> Parses the parameters in a URL and puts them in a table</font></div><br>void <big><b>UnescapeUrl</b></big>(char* szOut, const char* szIn)<br><div style="margin-left: 80px;"><font color=brown> Unescapes a URL. (i.e. replace "%20" with " ", etc.)</font></div><br></div><br><big><big><i>Constructors (public)</i></big></big><br><div style="margin-left: 40px;"><big><b>GHttpServer</b></big>(int nPort)<br></div><br><big><big><i>Destructors</i></big></big><br><div style="margin-left: 40px;"><big><b>~GHttpServer</b></big>()<br></div><br><big><big><i>Abstracts</i></big></big><br><div style="margin-left: 40px;">void <big><b>DoGet</b></big>(const char* szUrl, const char* szParams, int nParamsLen, const char* szCookie, <a href="type_GQueue.html">GQueue</a>* pResponse)<br><div style="margin-left: 80px;"><font color=brown> The primary purpose of this method is to push a response into pResponse. Typically this method will call SetHeaders.</font></div><br>void <big><b>DoPost</b></big>(const char* szUrl, unsigned char* pData, int nDataSize, const char* szCookie, <a href="type_GQueue.html">GQueue</a>* pResponse)<br><div style="margin-left: 80px;"><font color=brown> This method takes ownership of pData. Don't forget to delete it. When the POST is caused by an HTML form, it's common for this method to just call DoGet (passing pData for szParams) and then delete pData. (For convenience, a '\0' is already appended at the end of pData.)</font></div><br>bool <big><b>HasBeenModifiedSince</b></big>(const char* szUrl, const char* szDate)<br><div style="margin-left: 80px;"><font color=brown> This is called when the client does a conditional GET. It should return true if you wish to re-send the file, and DoGet will be called.</font></div><br>void <big><b>SetHeaders</b></big>(const char* szUrl, const char* szParams)<br><div style="margin-left: 80px;"><font color=brown> This method should set the content type and the date headers, and any other headers deemed necessary</font></div><br></div><br><big><big><i>Virtual (non-public)</i></big></big><br><div style="margin-left: 40px;">void <big><b>OnProcessLine</b></big>(int nConnection, const char* szLine)<br></div><br><big><big><i>Public</i></big></big><br><div style="margin-left: 40px;">bool <big><b>Process</b></big>()<br><div style="margin-left: 80px;"><font color=brown> You should call this method constantly inside the main loop. It returns true if it did anything, and false if it didn't, so if it returns false you may want to sleep for a little while.</font></div><br>void <big><b>SetContentType</b></big>(const char* szContentType)<br><div style="margin-left: 80px;"><font color=brown> Specifies the content-type of the response</font></div><br>void <big><b>SetCookie</b></big>(const char* szPayload, bool bPersist)<br><div style="margin-left: 80px;"><font color=brown> Specifies the set-cookie header to be sent with the response</font></div><br></div><br><big><big><i>Protected</i></big></big><br><div style="margin-left: 40px;">void <big><b>BeginRequest</b></big>(GHttpServerBuffer* pClient, int eType, const char* szIn)<br>void <big><b>ProcessHeaderLine</b></big>(int nConnection, GHttpServerBuffer* pClient, const char* szLine)<br>void <big><b>ProcessPostData</b></big>(int nConnection, GHttpServerBuffer* pClient, const unsigned char* pData, int nDataSize)<br>void <big><b>SendNotModifiedResponse</b></big>(GHttpServerBuffer* pClient, int nConnection)<br>void <big><b>SendResponse</b></big>(GHttpServerBuffer* pClient, int nConnection)<br></div><br></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -