mirror of https://github.com/aria2/aria2
Enabled TCP_NODELAY in SocketCore::establishConnection and acceptConnection
parent
e781e6eac1
commit
16e25ef4e1
|
@ -220,7 +220,6 @@ bool HttpServerCommand::execute()
|
|||
httpServer_->feedUpgradeResponse("websocket",
|
||||
fmt("Sec-WebSocket-Accept: %s\r\n",
|
||||
serverKey.c_str()));
|
||||
httpServer_->getSocket()->setTcpNodelay(true);
|
||||
command = new rpc::WebSocketResponseCommand(getCuid(), httpServer_,
|
||||
e_, socket_);
|
||||
} else {
|
||||
|
|
|
@ -369,6 +369,7 @@ SharedHandle<SocketCore> SocketCore::acceptConnection() const
|
|||
}
|
||||
SharedHandle<SocketCore> sock(new SocketCore(fd, sockType_));
|
||||
sock->setNonBlockingMode();
|
||||
sock->setTcpNodelay(true);
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
@ -461,6 +462,7 @@ void SocketCore::establishConnection(const std::string& host, uint16_t port)
|
|||
sockfd_ = fd;
|
||||
// make socket non-blocking mode
|
||||
setNonBlockingMode();
|
||||
setTcpNodelay(true);
|
||||
if(connect(fd, rp->ai_addr, rp->ai_addrlen) == -1 &&
|
||||
SOCKET_ERRNO != A2_EINPROGRESS) {
|
||||
errNum = SOCKET_ERRNO;
|
||||
|
|
Loading…
Reference in New Issue