forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSendfile.h
More file actions
41 lines (36 loc) · 1.04 KB
/
Sendfile.h
File metadata and controls
41 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "../ServerProtocol.h"
#include "../../Request.h"
namespace HttpServer
{
class Sendfile
{
private:
static int transferFilePart(
const ServerProtocol &prot,
const struct Request &rp,
const std::string &fileName,
const std::unordered_map<std::string, std::string> &mimesTypes,
const time_t fileTime,
const size_t fileSize,
const std::string &rangeHeader,
std::vector<std::pair<std::string, std::string> > &additionalHeaders,
const bool headersOnly
) noexcept;
static int transferFile(
const ServerProtocol &prot,
const struct Request &req,
const std::string &fileName,
const std::unordered_map<std::string, std::string> &mimesTypes,
std::vector<std::pair<std::string, std::string> > &additionalHeaders,
const bool headersOnly
) noexcept;
public:
static bool isConnectionReuse(const struct Request &req) noexcept;
static void xSendfile(
const ServerProtocol &prot,
struct Request &req,
const std::unordered_map<std::string, std::string> &mimesTypes
) noexcept;
};
}