1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix #2311, Copy the request for stat client. 3.0.162

This commit is contained in:
winlin 2021-05-12 21:17:57 +08:00
parent b7af726ffc
commit 71dda68f62
4 changed files with 9 additions and 2 deletions

View file

@ -938,6 +938,7 @@ srs_error_t SrsHttpStreamServer::http_mount(SrsSource* s, SrsRequest* r)
}
srs_trace("http: mount flv stream for sid=%s, mount=%s", sid.c_str(), mount.c_str());
} else {
// The entry exists, we reuse it and update the request of stream and cache.
entry = sflvs[sid];
entry->stream->update(s, r);
entry->cache->update(s, r);

View file

@ -425,10 +425,14 @@ srs_error_t SrsStatistic::on_client(std::string id, SrsRequest* req, SrsConnecti
// got client.
client->conn = conn;
client->req = req;
client->type = type;
stream->nb_clients++;
vhost->nb_clients++;
// The req might be freed, in such as SrsLiveStream::update, so we must copy it.
// @see https://github.com/ossrs/srs/issues/2311
srs_freep(client->req);
client->req = req->copy();
return err;
}

View file

@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION3_HPP
#define SRS_CORE_VERSION3_HPP
#define SRS_VERSION3_REVISION 161
#define SRS_VERSION3_REVISION 162
#endif