@@ -1654,27 +1654,13 @@ srs_error_t SrsConfig::reload_conf(SrsConfig* conf)
1654
1654
// bandcheck, http_hooks, heartbeat,
1655
1655
// security
1656
1656
1657
- // merge config: listen
1658
- if (!srs_directive_equals (root->get (" listen" ), old_root->get (" listen" ))) {
1659
- if ((err = do_reload_listen ()) != srs_success) {
1660
- return srs_error_wrap (err, " listen" );
1661
- }
1662
- }
1663
-
1664
1657
// merge config: pid
1665
1658
if (!srs_directive_equals (root->get (" pid" ), old_root->get (" pid" ))) {
1666
1659
if ((err = do_reload_pid ()) != srs_success) {
1667
1660
return srs_error_wrap (err, " pid" );;
1668
1661
}
1669
1662
}
1670
1663
1671
- // merge config: max_connections
1672
- if (!srs_directive_equals (root->get (" max_connections" ), old_root->get (" max_connections" ))) {
1673
- if ((err = do_reload_max_connections ()) != srs_success) {
1674
- return srs_error_wrap (err, " max connections" );;
1675
- }
1676
- }
1677
-
1678
1664
// merge config: pithy_print_ms
1679
1665
if (!srs_directive_equals (root->get (" pithy_print_ms" ), old_root->get (" pithy_print_ms" ))) {
1680
1666
if ((err = do_reload_pithy_print_ms ()) != srs_success) {
@@ -1686,15 +1672,10 @@ srs_error_t SrsConfig::reload_conf(SrsConfig* conf)
1686
1672
if ((err = reload_http_api (old_root)) != srs_success) {
1687
1673
return srs_error_wrap (err, " http api" );;
1688
1674
}
1689
-
1690
- // merge config: http_stream
1691
- if ((err = reload_http_stream (old_root)) != srs_success) {
1692
- return srs_error_wrap (err, " http steram" );;
1693
- }
1694
1675
1695
- // Merge config: rtc_server
1696
- if ((err = reload_rtc_server (old_root)) != srs_success) {
1697
- return srs_error_wrap (err, " http steram " );;
1676
+ // merge config: streams
1677
+ if ((err = reload_streams (old_root)) != srs_success) {
1678
+ return srs_error_wrap (err, " streams " );;
1698
1679
}
1699
1680
1700
1681
// TODO: FIXME: support reload stream_caster.
@@ -1785,17 +1766,10 @@ srs_error_t SrsConfig::reload_http_api(SrsConfDirective* old_root)
1785
1766
return err;
1786
1767
}
1787
1768
1788
- srs_error_t SrsConfig::reload_http_stream (SrsConfDirective* old_root)
1789
- {
1790
- srs_error_t err = srs_success;
1791
- // TODO: FIXME: We never support reload HTTP stream.
1792
- return err;
1793
- }
1794
-
1795
- srs_error_t SrsConfig::reload_rtc_server (SrsConfDirective* old_root)
1769
+ srs_error_t SrsConfig::reload_streams (SrsConfDirective* old_root)
1796
1770
{
1797
1771
srs_error_t err = srs_success;
1798
- // TODO: FIXME: Do not support reloading RTC Server .
1772
+ // TODO: FIXME: We never support reload streams .
1799
1773
return err;
1800
1774
}
1801
1775
@@ -2901,31 +2875,6 @@ srs_error_t SrsConfig::raw_to_json(SrsJsonObject* obj)
2901
2875
return err;
2902
2876
}
2903
2877
2904
- srs_error_t SrsConfig::raw_set_listen (const vector<string>& eps, bool & applied)
2905
- {
2906
- srs_error_t err = srs_success;
2907
-
2908
- applied = false ;
2909
-
2910
- SrsConfDirective* conf = root->get (" listen" );
2911
-
2912
- // nothing changed, ignore.
2913
- if (srs_vector_actual_equals (conf->args , eps)) {
2914
- return err;
2915
- }
2916
-
2917
- // changed, apply and reload.
2918
- conf->args = eps;
2919
-
2920
- if ((err = do_reload_listen ()) != srs_success) {
2921
- return srs_error_wrap (err, " reload listen" );
2922
- }
2923
-
2924
- applied = true ;
2925
-
2926
- return err;
2927
- }
2928
-
2929
2878
srs_error_t SrsConfig::raw_set_pid (string pid, bool & applied)
2930
2879
{
2931
2880
srs_error_t err = srs_success;
@@ -2994,30 +2943,6 @@ srs_error_t SrsConfig::raw_set_ff_log_dir(string ff_log_dir, bool& applied)
2994
2943
return err;
2995
2944
}
2996
2945
2997
- srs_error_t SrsConfig::raw_set_max_connections (string max_connections, bool & applied)
2998
- {
2999
- srs_error_t err = srs_success;
3000
-
3001
- applied = false ;
3002
-
3003
- SrsConfDirective* conf = root->get_or_create (" max_connections" );
3004
-
3005
- if (conf->arg0 () == max_connections) {
3006
- return err;
3007
- }
3008
-
3009
- conf->args .clear ();
3010
- conf->args .push_back (max_connections);
3011
-
3012
- if ((err = do_reload_max_connections ()) != srs_success) {
3013
- return srs_error_wrap (err, " reload max connection" );
3014
- }
3015
-
3016
- applied = true ;
3017
-
3018
- return err;
3019
- }
3020
-
3021
2946
srs_error_t SrsConfig::raw_set_pithy_print_ms (string pithy_print_ms, bool & applied)
3022
2947
{
3023
2948
srs_error_t err = srs_success;
@@ -3185,22 +3110,6 @@ srs_error_t SrsConfig::raw_disable_dvr(string vhost, string stream, bool& applie
3185
3110
}
3186
3111
// LCOV_EXCL_STOP
3187
3112
3188
- srs_error_t SrsConfig::do_reload_listen ()
3189
- {
3190
- srs_error_t err = srs_success;
3191
-
3192
- vector<ISrsReloadHandler*>::iterator it;
3193
- for (it = subscribes.begin (); it != subscribes.end (); ++it) {
3194
- ISrsReloadHandler* subscribe = *it;
3195
- if ((err = subscribe->on_reload_listen ()) != srs_success) {
3196
- return srs_error_wrap (err, " notify subscribes reload listen failed" );
3197
- }
3198
- }
3199
- srs_trace (" reload listen success." );
3200
-
3201
- return err;
3202
- }
3203
-
3204
3113
srs_error_t SrsConfig::do_reload_pid ()
3205
3114
{
3206
3115
srs_error_t err = srs_success;
@@ -3217,22 +3126,6 @@ srs_error_t SrsConfig::do_reload_pid()
3217
3126
return err;
3218
3127
}
3219
3128
3220
- srs_error_t SrsConfig::do_reload_max_connections ()
3221
- {
3222
- srs_error_t err = srs_success;
3223
-
3224
- vector<ISrsReloadHandler*>::iterator it;
3225
- for (it = subscribes.begin (); it != subscribes.end (); ++it) {
3226
- ISrsReloadHandler* subscribe = *it;
3227
- if ((err = subscribe->on_reload_max_conns ()) != srs_success) {
3228
- return srs_error_wrap (err, " notify subscribes reload max_connections failed" );
3229
- }
3230
- }
3231
- srs_trace (" reload max_connections success." );
3232
-
3233
- return err;
3234
- }
3235
-
3236
3129
srs_error_t SrsConfig::do_reload_pithy_print_ms ()
3237
3130
{
3238
3131
srs_error_t err = srs_success;
0 commit comments