| 60 | namespace aria2 { |
| 61 | |
| 62 | HttpServerCommand::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 | |
| 87 | HttpServerCommand::HttpServerCommand( |
| 88 | cuid_t cuid, const std::shared_ptr<HttpServer>& httpServer, |
nothing calls this directly
no test coverage detected