Skip to content

Commit fa3b994

Browse files
sinnrenbakurise
andauthored
Fix off_t(on windows off_t defined with long, not longlong) (#264)
Co-authored-by: fenlog <bakurise@qq.com>
1 parent 73fb8d4 commit fa3b994

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

trantor/net/inner/TcpConnectionImpl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ void TcpConnectionImpl::sendFile(FILE *fp, size_t offset, size_t length)
878878
BufferNodePtr node = std::make_shared<BufferNode>();
879879
node->sendFp_ = fp;
880880
#endif
881-
node->offset_ = static_cast<off_t>(offset);
881+
node->offset_ = offset;
882882
node->fileBytesToSend_ = length;
883883
if (loop_->isInLoopThread())
884884
{
@@ -1159,7 +1159,7 @@ void TcpConnectionImpl::sendFileInLoop(const BufferNodePtr &filePtr)
11591159
if (nSend >= 0)
11601160
{
11611161
filePtr->fileBytesToSend_ -= nSend;
1162-
filePtr->offset_ += static_cast<off_t>(nSend);
1162+
filePtr->offset_ += nSend;
11631163
if (static_cast<size_t>(nSend) < static_cast<size_t>(n))
11641164
{
11651165
if (!ioChannelPtr_->isWriting())

0 commit comments

Comments
 (0)