winlin

fix #138, fix http hooks bug, regression bug. 0.9.184.

@@ -207,6 +207,7 @@ Supported operating systems and hardware: @@ -207,6 +207,7 @@ Supported operating systems and hardware:
207 * 2013-10-17, Created.<br/> 207 * 2013-10-17, Created.<br/>
208 208
209 ## History 209 ## History
  210 +* v1.0, 2014-08-02, fix [#138](https://github.com/winlinvip/simple-rtmp-server/issues/138), fix http hooks bug, regression bug. 0.9.184.
210 * v1.0, 2014-08-02, fix [#142](https://github.com/winlinvip/simple-rtmp-server/issues/142), fix tcp stat slow bug, use /proc/net/sockstat instead, refer to 'ss -s'. 0.9.183. 211 * v1.0, 2014-08-02, fix [#142](https://github.com/winlinvip/simple-rtmp-server/issues/142), fix tcp stat slow bug, use /proc/net/sockstat instead, refer to 'ss -s'. 0.9.183.
211 * v1.0, 2014-07-31, fix [#141](https://github.com/winlinvip/simple-rtmp-server/issues/141), support tun0(vpn network device) ip retrieve. 0.9.179. 212 * v1.0, 2014-07-31, fix [#141](https://github.com/winlinvip/simple-rtmp-server/issues/141), support tun0(vpn network device) ip retrieve. 0.9.179.
212 * v1.0, 2014-07-27, support build on OSX(Darwin). 0.9.177 213 * v1.0, 2014-07-27, support build on OSX(Darwin). 0.9.177
@@ -14,6 +14,5 @@ vhost __defaultVhost__ { @@ -14,6 +14,5 @@ vhost __defaultVhost__ {
14 on_unpublish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams; 14 on_unpublish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams;
15 on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; 15 on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
16 on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; 16 on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
17 - on_dvr_hss_reap_flv http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs;  
18 } 17 }
19 } 18 }
@@ -984,7 +984,7 @@ int SrsRtmpConn::http_hooks_on_connect() @@ -984,7 +984,7 @@ int SrsRtmpConn::http_hooks_on_connect()
984 int ret = ERROR_SUCCESS; 984 int ret = ERROR_SUCCESS;
985 985
986 #ifdef SRS_AUTO_HTTP_CALLBACK 986 #ifdef SRS_AUTO_HTTP_CALLBACK
987 - if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 987 + if (_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
988 // HTTP: on_connect 988 // HTTP: on_connect
989 SrsConfDirective* on_connect = _srs_config->get_vhost_on_connect(req->vhost); 989 SrsConfDirective* on_connect = _srs_config->get_vhost_on_connect(req->vhost);
990 if (!on_connect) { 990 if (!on_connect) {
@@ -1009,7 +1009,7 @@ int SrsRtmpConn::http_hooks_on_connect() @@ -1009,7 +1009,7 @@ int SrsRtmpConn::http_hooks_on_connect()
1009 void SrsRtmpConn::http_hooks_on_close() 1009 void SrsRtmpConn::http_hooks_on_close()
1010 { 1010 {
1011 #ifdef SRS_AUTO_HTTP_CALLBACK 1011 #ifdef SRS_AUTO_HTTP_CALLBACK
1012 - if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1012 + if (_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
1013 // whatever the ret code, notify the api hooks. 1013 // whatever the ret code, notify the api hooks.
1014 // HTTP: on_close 1014 // HTTP: on_close
1015 SrsConfDirective* on_close = _srs_config->get_vhost_on_close(req->vhost); 1015 SrsConfDirective* on_close = _srs_config->get_vhost_on_close(req->vhost);
@@ -1032,7 +1032,7 @@ int SrsRtmpConn::http_hooks_on_publish() @@ -1032,7 +1032,7 @@ int SrsRtmpConn::http_hooks_on_publish()
1032 int ret = ERROR_SUCCESS; 1032 int ret = ERROR_SUCCESS;
1033 1033
1034 #ifdef SRS_AUTO_HTTP_CALLBACK 1034 #ifdef SRS_AUTO_HTTP_CALLBACK
1035 - if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1035 + if (_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
1036 // HTTP: on_publish 1036 // HTTP: on_publish
1037 SrsConfDirective* on_publish = _srs_config->get_vhost_on_publish(req->vhost); 1037 SrsConfDirective* on_publish = _srs_config->get_vhost_on_publish(req->vhost);
1038 if (!on_publish) { 1038 if (!on_publish) {
@@ -1057,7 +1057,7 @@ int SrsRtmpConn::http_hooks_on_publish() @@ -1057,7 +1057,7 @@ int SrsRtmpConn::http_hooks_on_publish()
1057 void SrsRtmpConn::http_hooks_on_unpublish() 1057 void SrsRtmpConn::http_hooks_on_unpublish()
1058 { 1058 {
1059 #ifdef SRS_AUTO_HTTP_CALLBACK 1059 #ifdef SRS_AUTO_HTTP_CALLBACK
1060 - if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1060 + if (_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
1061 // whatever the ret code, notify the api hooks. 1061 // whatever the ret code, notify the api hooks.
1062 // HTTP: on_unpublish 1062 // HTTP: on_unpublish
1063 SrsConfDirective* on_unpublish = _srs_config->get_vhost_on_unpublish(req->vhost); 1063 SrsConfDirective* on_unpublish = _srs_config->get_vhost_on_unpublish(req->vhost);
@@ -1080,7 +1080,7 @@ int SrsRtmpConn::http_hooks_on_play() @@ -1080,7 +1080,7 @@ int SrsRtmpConn::http_hooks_on_play()
1080 int ret = ERROR_SUCCESS; 1080 int ret = ERROR_SUCCESS;
1081 1081
1082 #ifdef SRS_AUTO_HTTP_CALLBACK 1082 #ifdef SRS_AUTO_HTTP_CALLBACK
1083 - if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1083 + if (_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
1084 // HTTP: on_play 1084 // HTTP: on_play
1085 SrsConfDirective* on_play = _srs_config->get_vhost_on_play(req->vhost); 1085 SrsConfDirective* on_play = _srs_config->get_vhost_on_play(req->vhost);
1086 if (!on_play) { 1086 if (!on_play) {
@@ -1105,7 +1105,7 @@ int SrsRtmpConn::http_hooks_on_play() @@ -1105,7 +1105,7 @@ int SrsRtmpConn::http_hooks_on_play()
1105 void SrsRtmpConn::http_hooks_on_stop() 1105 void SrsRtmpConn::http_hooks_on_stop()
1106 { 1106 {
1107 #ifdef SRS_AUTO_HTTP_CALLBACK 1107 #ifdef SRS_AUTO_HTTP_CALLBACK
1108 - if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1108 + if (_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
1109 // whatever the ret code, notify the api hooks. 1109 // whatever the ret code, notify the api hooks.
1110 // HTTP: on_stop 1110 // HTTP: on_stop
1111 SrsConfDirective* on_stop = _srs_config->get_vhost_on_stop(req->vhost); 1111 SrsConfDirective* on_stop = _srs_config->get_vhost_on_stop(req->vhost);
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR "0" 32 #define VERSION_MAJOR "0"
33 #define VERSION_MINOR "9" 33 #define VERSION_MINOR "9"
34 -#define VERSION_REVISION "183" 34 +#define VERSION_REVISION "184"
35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "SRS" 37 #define RTMP_SIG_SRS_KEY "SRS"