trantor
trantor copied to clipboard
off_t type error on windows
TcpConnectionImpl::sendFile
node->offset_ = static_cast<off_t>(offset);
TcpConnectionImpl::sendFileInLoop
filePtr->offset_ += static_cast<off_t>(nSend);
on windows,off_t is defined with long, not longlong,so big file(more than 4G) will be error offset......
This should be compiler specific, since off_t is defined by the C standard.
Maybe use the off64_t instead?
Note: in the file TcpConnectionImpl.h it uses #ifndef _WIN32 so it correctly uses long and not long long. For the long long definition the _WIN64 flag should be defined.
What is your OS and compiler configuration?