Skip to content

Commit

Permalink
Threads-RECV: Reset the cache buffer when copy
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Apr 26, 2021
1 parent 1235b33 commit eb7ce7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trunk/src/app/srs_app_listener.cpp
Expand Up @@ -550,6 +550,12 @@ SrsUdpMuxSocket* SrsUdpMuxSocket::copy()
cp->fast_id_ = fast_id_;
cp->address_changed_ = address_changed_;

if (nread) {
// Reset the fast cache buffer size.
cp->cache_buffer_->set_size(nread);
cp->cache_buffer_->skip(-1 * cache_buffer_->pos());
}

cp->handler_ = handler_;

return cp;
Expand Down

0 comments on commit eb7ce7f

Please sign in to comment.