MCPcopy Create free account
hub / github.com/aria2/aria2 / HttpServerCommand

Method HttpServerCommand

src/HttpServerCommand.cc:62–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60namespace aria2 {
61
62HttpServerCommand::HttpServerCommand(cuid_t cuid, DownloadEngine* e,
63 const std::shared_ptr<SocketCore>& socket,
64 bool secure)
65 : Command(cuid),
66 e_(e),
67 socket_(socket),
68 httpServer_(std::make_shared<HttpServer>(socket)),
69 writeCheck_(false)
70{
71 setStatus(Command::STATUS_ONESHOT_REALTIME);
72 e_->addSocketForReadCheck(socket_, this);
73 httpServer_->setSecure(secure);
74 httpServer_->setUsernamePassword(e_->getOption()->get(PREF_RPC_USER),
75 e_->getOption()->get(PREF_RPC_PASSWD));
76 if (e_->getOption()->getAsBool(PREF_RPC_ALLOW_ORIGIN_ALL)) {
77 httpServer_->setAllowOrigin("*");
78 }
79#ifdef HAVE_ZLIB
80 httpServer_->enableGZip();
81#else // !HAVE_ZLIB
82 httpServer_->disableGZip();
83#endif // !HAVE_ZLIB
84 checkSocketRecvBuffer();
85}
86
87HttpServerCommand::HttpServerCommand(
88 cuid_t cuid, const std::shared_ptr<HttpServer>& httpServer,

Callers

nothing calls this directly

Calls 9

addSocketForReadCheckMethod · 0.80
setUsernamePasswordMethod · 0.80
getOptionMethod · 0.80
getAsBoolMethod · 0.80
setAllowOriginMethod · 0.80
enableGZipMethod · 0.80
disableGZipMethod · 0.80
setSecureMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected