2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20#ifndef WEB_HTTP_SERVER_SOCKETCONTEXTUPGRADEFACTORY_H
21#define WEB_HTTP_SERVER_SOCKETCONTEXTUPGRADEFACTORY_H
23#include "web/http/SocketContextUpgradeFactory.h"
25namespace web::http::server {
30#ifndef DOXYGEN_SHOULD_SKIP_THIS
36namespace web::http::server {
38 class SocketContextUpgradeFactory
39 :
public web::http::SocketContextUpgradeFactory<web::http::server::Request, web::http::server::Response> {
41 using Resquest = web::http::server::
Request;
45 SocketContextUpgradeFactory();
48 void checkRefCount() final;
50 static void link(
const std::string& upgradeContextName, SocketContextUpgradeFactory* (*linkedPlugin)());
52 friend class SocketContextUpgradeFactorySelector;
57extern template class web::http::SocketContextUpgradeFactory<web::http::server::
Request, web::http::server::
Response>;
void onSourceData(const char *chunk, std::size_t chunkLen) override
Response(SocketContext *socketContext)
SocketContext * getSocketContext() const
void onSourceConnect(core::pipe::Source *source) override
Response & status(int statusCode)
void send(const std::string &chunk)
void send(const char *chunk, std::size_t chunkLen)
Response & setTrailer(const std::string &field, const std::string &value, bool overwrite=true)
Response & set(const std::map< std::string, std::string > &headers, bool overwrite=true)
Response & set(const std::string &field, const std::string &value, bool overwrite=true)
void upgrade(const std::shared_ptr< Request > &request, const std::function< void(const std::string &)> &status)
Response & type(const std::string &type)
void onSourceError(int errnum) override
Response & sendFragment(const std::string &chunk)
Response & cookie(const std::string &name, const std::string &value, const std::map< std::string, std::string > &options={})
Response & append(const std::string &field, const std::string &value)
void sendStatus(int statusCode)
Response & sendFragment(const char *chunk, std::size_t chunkLen)
void onSourceEof() override
void sendFile(const std::string &file, const std::function< void(int)> &callback)
Response & clearCookie(const std::string &name, const std::map< std::string, std::string > &options={})
const std::string & header(const std::string &field)
#define to_hex_str(int_val)