?? httpauth.c
字號:
///////////////////////////////////////////////////////////////////////////////// http.c//// MiniWeb HTTP authentication implementation///////////////////////////////////////////////////////////////////////////////#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include "httppil.h"#include "httpapi.h"#include "httpint.h"#ifdef HTTPAUTH extern HttpParam g_httpParam;////////////////////////////////////////////////////////////////////////////// _mwCheckAuthentication// Check if a connected peer is authenticated////////////////////////////////////////////////////////////////////////////BOOL _mwCheckAuthentication(HttpSocket* phsSocket){ if (!ISFLAGSET(phsSocket,FLAG_AUTHENTICATION)) return TRUE; if (g_httpParam.dwAuthenticatedNode!=phsSocket->ipAddr.laddr) { // Not authenticated g_httpParam.stats.authFailCount++; return FALSE; } // Extend authentication period g_httpParam.tmAuthExpireTime = time(NULL) + HTTPAUTHTIMEOUT; return TRUE;}#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -