trantor icon indicating copy to clipboard operation
trantor copied to clipboard

off_t type error on windows

Open sinnren opened this issue 2 years ago • 1 comments

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......

sinnren avatar Jun 20 '23 03:06 sinnren

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?

ctsiaousis avatar Jun 23 '23 11:06 ctsiaousis