Skip to content

Commit

Permalink
Merge pull request #1651 from lam2003/3.0release
Browse files Browse the repository at this point in the history
修复srs_write_large_iovs中nwrite未累加的错误
  • Loading branch information
winlinvip authored Mar 21, 2020
2 parents 75f62dc + bbfb03f commit 355f351
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions trunk/src/protocol/srs_protocol_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,19 @@ srs_error_t srs_write_large_iovs(ISrsProtocolReadWriter* skt, iovec* iovs, int s
}
return err;
}

// send in multiple times.
int cur_iov = 0;
ssize_t nwrite = 0;
while (cur_iov < size) {
int cur_count = srs_min(limits, size - cur_iov);
if ((err = skt->writev(iovs + cur_iov, cur_count, pnwrite)) != srs_success) {
if ((err = skt->writev(iovs + cur_iov, cur_count, &nwrite)) != srs_success) {
return srs_error_wrap(err, "writev");
}
cur_iov += cur_count;
if (pnwrite) {
*pnwrite += nwrite;
}
}

return err;
Expand Down

0 comments on commit 355f351

Please sign in to comment.