mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix the log cid display error, merge the publish recv thread log to publish connection.
This commit is contained in:
parent
3c402cb908
commit
c75f05c88b
9 changed files with 84 additions and 6 deletions
|
@ -76,4 +76,9 @@ int ISrsThreadContext::get_id()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ISrsThreadContext::set_id(int /*v*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -95,6 +95,13 @@ public:
|
|||
virtual void error(const char* tag, int context_id, const char* fmt, ...);
|
||||
};
|
||||
|
||||
/**
|
||||
* the context id manager to identify context, for instance, the green-thread.
|
||||
* usage:
|
||||
* _srs_context->generate_id(); // when thread start.
|
||||
* _srs_context->get_id(); // get current generated id.
|
||||
* int old_id = _srs_context->set_id(1000); // set context id if need to merge thread context.
|
||||
*/
|
||||
// the context for multiple clients.
|
||||
class ISrsThreadContext
|
||||
{
|
||||
|
@ -102,8 +109,19 @@ public:
|
|||
ISrsThreadContext();
|
||||
virtual ~ISrsThreadContext();
|
||||
public:
|
||||
/**
|
||||
* generate the id for current context.
|
||||
*/
|
||||
virtual int generate_id();
|
||||
/**
|
||||
* get the generated id of current context.
|
||||
*/
|
||||
virtual int get_id();
|
||||
/**
|
||||
* set the id of current context.
|
||||
* @return the previous id value; 0 if no context.
|
||||
*/
|
||||
virtual int set_id(int v);
|
||||
};
|
||||
|
||||
// user must provides a log object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue