| 68 | namespace aria2 { |
| 69 | |
| 70 | HttpServerBodyCommand::HttpServerBodyCommand( |
| 71 | cuid_t cuid, const std::shared_ptr<HttpServer>& httpServer, |
| 72 | DownloadEngine* e, const std::shared_ptr<SocketCore>& socket) |
| 73 | : Command(cuid), |
| 74 | e_(e), |
| 75 | socket_(socket), |
| 76 | httpServer_(httpServer), |
| 77 | writeCheck_(false) |
| 78 | { |
| 79 | // To handle Content-Length == 0 case |
| 80 | setStatus(Command::STATUS_ONESHOT_REALTIME); |
| 81 | e_->addSocketForReadCheck(socket_, this); |
| 82 | if (!httpServer_->getSocketRecvBuffer()->bufferEmpty() || |
| 83 | socket_->getRecvBufferedLength()) { |
| 84 | e_->setNoWait(true); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | HttpServerBodyCommand::~HttpServerBodyCommand() |
| 89 | { |
nothing calls this directly
no test coverage detected