mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
feat: Close the connection after authentication failed in HTTP API
Improve the safety of HTTP API
This commit is contained in:
parent
8ac957f338
commit
2eed284e61
@ -289,6 +289,8 @@ static inline void addHttpListener(){
|
|||||||
it->second(parser, invoker, sender);
|
it->second(parser, invoker, sender);
|
||||||
} catch (ApiRetException &ex) {
|
} catch (ApiRetException &ex) {
|
||||||
responseApi(ex.code(), ex.what(), invoker);
|
responseApi(ex.code(), ex.what(), invoker);
|
||||||
|
auto helper = static_cast<SocketHelper &>(sender).shared_from_this();
|
||||||
|
helper->getPoller()->async([helper, ex]() { helper->shutdown(SockException(Err_shutdown, ex.what())); }, false);
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_MYSQL
|
#ifdef ENABLE_MYSQL
|
||||||
catch(SqlException &ex){
|
catch(SqlException &ex){
|
||||||
|
Loading…
Reference in New Issue
Block a user