3 Star 11 Fork 1

风闲21/WHttpServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
HttpExample.h 916 Bytes
一键复制 编辑 原始数据 按行查看 历史
wenke 提交于 2023-09-18 15:19 . add timeoutMs param in run
#pragma once
#include "WHttpServer.h"
#include <stdio.h>
#define HTTP_OK 0
#define HTTP_UPLOAD_FAIL 106
#define MIN_FORM_DATA_PARSE_SIZE (100 * 1024)
class HttpExample
{
public:
HttpExample();
virtual ~HttpExample();
void start();
bool httpFilter(shared_ptr<HttpReqMsg> &httpMsg);
void handleHttpRequestTest(shared_ptr<HttpReqMsg> &httpMsg);
void handleHttpBigFileUpload(shared_ptr<HttpReqMsg> &httpMsg);
void handleHttpDownloadFile(shared_ptr<HttpReqMsg> &httpMsg);
void handleHttpChunkDownloadFile(shared_ptr<HttpReqMsg> &httpMsg);
void run(int timeoutMs);
private:
WHttpServer *_httpServer = nullptr;
bool parseMultipartStream(string &parseBuf, string &extraDataBuf, std::map<string, FILE *> &fileWriterMap,
std::map<string, string> &formParamsMap, string &filePathPrefix, string &errMsg);
static string intToHexStr(int num);
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/fengxian21/whttp-server.git
[email protected]:fengxian21/whttp-server.git
fengxian21
whttp-server
WHttpServer
master

搜索帮助