mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #913, coroutine support complex error.
This commit is contained in:
parent
9ae54850bf
commit
9db2a04c3b
38 changed files with 620 additions and 414 deletions
|
@ -41,8 +41,7 @@ bool srs_is_client_gracefully_close(int error_code)
|
|||
{
|
||||
return error_code == ERROR_SOCKET_READ
|
||||
|| error_code == ERROR_SOCKET_READ_FULLY
|
||||
|| error_code == ERROR_SOCKET_WRITE
|
||||
|| error_code == ERROR_SOCKET_TIMEOUT;
|
||||
|| error_code == ERROR_SOCKET_WRITE;
|
||||
}
|
||||
|
||||
SrsError::SrsError()
|
||||
|
@ -137,6 +136,27 @@ SrsError* SrsError::success() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SrsError* SrsError::copy(SrsError* from)
|
||||
{
|
||||
if (from == srs_success) {
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
SrsError* err = new SrsError();
|
||||
|
||||
err->code = from->code;
|
||||
err->wrapped = srs_error_copy(from->wrapped);
|
||||
err->msg = from->msg;
|
||||
err->func = from->func;
|
||||
err->file = from->file;
|
||||
err->line = from->line;
|
||||
err->cid = from->cid;
|
||||
err->rerrno = from->rerrno;
|
||||
err->desc = from->desc;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
string SrsError::description(SrsError* err)
|
||||
{
|
||||
return err? err->description() : "Success";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue