webcallbacks.c

来自「小型的web服务器源码」· C语言 代码 · 共 63 行

C
63
字号
////////////////////////////////////////////////////////////////////////////// webcallbacks.c//// Default callback functions to support the webserver////////////////////////////////////////////////////////////////////////////#include <stdio.h>#include <stdlib.h>#include <string.h>#include "httppil.h"#include "httpapi.h"BOOL bMacRead=FALSE;OCTET g_aoWebMacAddr[6];//////////////////////////////////////////////////////////////////////////// DefaultWebSubstCallback//// callback from the web server whenever it needs a substitution of// a parameter in a page. Note this is called from the web server thread//////////////////////////////////////////////////////////////////////////int DefaultWebSubstCallback(SubstParam* sp){  return 1;}//////////////////////////////////////////////////////////////////////////// DefaultWebPostCallback//// callback from the web server whenever it recevies posted data//////////////////////////////////////////////////////////////////////////int DefaultWebPostCallback(PostParam* pp){  int iReturn=WEBPOST_OK;  // by default redirect to config page  strcpy(pp->chFilename,"index.htm");  return iReturn;}//////////////////////////////////////////////////////////////////////////// DefaultWebFileUploadCallback//// callback from the web server whenever it receives a multipart // upload file chunk//////////////////////////////////////////////////////////////////////////int DefaultWebFileUploadCallback(char *pchFilename,                                 OCTET oFileuploadStatus,                                 OCTET *poData,                                 DWORD dwDataChunkSize){  // Do nothing with the data  printf("Received %lu bytes for multipart upload file %s\n",               dwDataChunkSize, pchFilename);  return 0;}////////////////////////////// END OF FILE //////////////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?