mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
kafka use topic and partition cache
This commit is contained in:
parent
7013993c7a
commit
61486a82aa
5 changed files with 244 additions and 31 deletions
|
@ -1267,7 +1267,7 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
|
|||
|
||||
SrsConnection* conn = NULL;
|
||||
if (type == SrsListenerRtmpStream) {
|
||||
conn = new SrsRtmpConn(this, client_stfd);
|
||||
conn = new SrsRtmpConn(this, kafka, client_stfd);
|
||||
} else if (type == SrsListenerHttpApi) {
|
||||
#ifdef SRS_AUTO_HTTP_API
|
||||
conn = new SrsHttpApi(this, client_stfd, http_api_mux);
|
||||
|
@ -1289,14 +1289,6 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
|
|||
}
|
||||
srs_assert(conn);
|
||||
|
||||
#ifdef SRS_AUTO_KAFKA
|
||||
// notify kafka cluster.
|
||||
if ((ret = kafka->on_client(type, client_stfd)) != ERROR_SUCCESS) {
|
||||
srs_error("kafka handler on_client failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
// directly enqueue, the cycle thread will remove the client.
|
||||
conns.push_back(conn);
|
||||
srs_verbose("add conn to vector.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue