mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
优化代码
This commit is contained in:
parent
4e1876fab8
commit
5f0bbb3f17
@ -88,7 +88,7 @@ API_EXPORT void API_CALL mk_set_option(const char *key, const char *val) {
|
|||||||
API_EXPORT uint16_t API_CALL mk_http_server_start(uint16_t port, int ssl) {
|
API_EXPORT uint16_t API_CALL mk_http_server_start(uint16_t port, int ssl) {
|
||||||
ssl = MAX(0,MIN(ssl,1));
|
ssl = MAX(0,MIN(ssl,1));
|
||||||
try {
|
try {
|
||||||
http_server[ssl].reset(new TcpServer());
|
http_server[ssl] = std::make_shared<TcpServer>();
|
||||||
if(ssl){
|
if(ssl){
|
||||||
http_server[ssl]->start<TcpSessionWithSSL<HttpSession> >(port);
|
http_server[ssl]->start<TcpSessionWithSSL<HttpSession> >(port);
|
||||||
} else{
|
} else{
|
||||||
@ -105,7 +105,7 @@ API_EXPORT uint16_t API_CALL mk_http_server_start(uint16_t port, int ssl) {
|
|||||||
API_EXPORT uint16_t API_CALL mk_rtsp_server_start(uint16_t port, int ssl) {
|
API_EXPORT uint16_t API_CALL mk_rtsp_server_start(uint16_t port, int ssl) {
|
||||||
ssl = MAX(0,MIN(ssl,1));
|
ssl = MAX(0,MIN(ssl,1));
|
||||||
try {
|
try {
|
||||||
rtsp_server[ssl].reset(new TcpServer());
|
rtsp_server[ssl] = std::make_shared<TcpServer>();
|
||||||
if(ssl){
|
if(ssl){
|
||||||
rtsp_server[ssl]->start<TcpSessionWithSSL<RtspSession> >(port);
|
rtsp_server[ssl]->start<TcpSessionWithSSL<RtspSession> >(port);
|
||||||
}else{
|
}else{
|
||||||
@ -122,7 +122,7 @@ API_EXPORT uint16_t API_CALL mk_rtsp_server_start(uint16_t port, int ssl) {
|
|||||||
API_EXPORT uint16_t API_CALL mk_rtmp_server_start(uint16_t port, int ssl) {
|
API_EXPORT uint16_t API_CALL mk_rtmp_server_start(uint16_t port, int ssl) {
|
||||||
ssl = MAX(0,MIN(ssl,1));
|
ssl = MAX(0,MIN(ssl,1));
|
||||||
try {
|
try {
|
||||||
rtmp_server[ssl].reset(new TcpServer());
|
rtmp_server[ssl] = std::make_shared<TcpServer>();
|
||||||
if(ssl){
|
if(ssl){
|
||||||
rtmp_server[ssl]->start<TcpSessionWithSSL<RtmpSession> >(port);
|
rtmp_server[ssl]->start<TcpSessionWithSSL<RtmpSession> >(port);
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
Reference in New Issue
Block a user