winlin

for #742, always enable http utilities.

@@ -79,18 +79,6 @@ fi @@ -79,18 +79,6 @@ fi
79 echo "" >> $SRS_AUTO_HEADERS_H 79 echo "" >> $SRS_AUTO_HEADERS_H
80 80
81 # auto headers in depends. 81 # auto headers in depends.
82 -if [ $SRS_HTTP_CORE = YES ]; then  
83 - srs_define_macro "SRS_AUTO_HTTP_CORE" $SRS_AUTO_HEADERS_H  
84 -else  
85 - srs_undefine_macro "SRS_AUTO_HTTP_CORE" $SRS_AUTO_HEADERS_H  
86 -fi  
87 -  
88 -if [ $SRS_HTTP_SERVER = YES ]; then  
89 - srs_define_macro "SRS_AUTO_HTTP_SERVER" $SRS_AUTO_HEADERS_H  
90 -else  
91 - srs_undefine_macro "SRS_AUTO_HTTP_SERVER" $SRS_AUTO_HEADERS_H  
92 -fi  
93 -  
94 if [ $SRS_STREAM_CASTER = YES ]; then 82 if [ $SRS_STREAM_CASTER = YES ]; then
95 srs_define_macro "SRS_AUTO_STREAM_CASTER" $SRS_AUTO_HEADERS_H 83 srs_define_macro "SRS_AUTO_STREAM_CASTER" $SRS_AUTO_HEADERS_H
96 else 84 else
@@ -103,12 +91,6 @@ else @@ -103,12 +91,6 @@ else
103 srs_undefine_macro "SRS_AUTO_KAFKA" $SRS_AUTO_HEADERS_H 91 srs_undefine_macro "SRS_AUTO_KAFKA" $SRS_AUTO_HEADERS_H
104 fi 92 fi
105 93
106 -if [ $SRS_HTTP_API = YES ]; then  
107 - srs_define_macro "SRS_AUTO_HTTP_API" $SRS_AUTO_HEADERS_H  
108 -else  
109 - srs_undefine_macro "SRS_AUTO_HTTP_API" $SRS_AUTO_HEADERS_H  
110 -fi  
111 -  
112 if [ $SRS_NGINX = YES ]; then 94 if [ $SRS_NGINX = YES ]; then
113 srs_define_macro "SRS_AUTO_NGINX" $SRS_AUTO_HEADERS_H 95 srs_define_macro "SRS_AUTO_NGINX" $SRS_AUTO_HEADERS_H
114 else 96 else
@@ -133,12 +115,6 @@ else @@ -133,12 +115,6 @@ else
133 srs_undefine_macro "SRS_AUTO_HDS" $SRS_AUTO_HEADERS_H 115 srs_undefine_macro "SRS_AUTO_HDS" $SRS_AUTO_HEADERS_H
134 fi 116 fi
135 117
136 -if [ $SRS_HTTP_CALLBACK = YES ]; then  
137 - srs_define_macro "SRS_AUTO_HTTP_CALLBACK" $SRS_AUTO_HEADERS_H  
138 -else  
139 - srs_undefine_macro "SRS_AUTO_HTTP_CALLBACK" $SRS_AUTO_HEADERS_H  
140 -fi  
141 -  
142 if [ $SRS_SSL = YES ]; then 118 if [ $SRS_SSL = YES ]; then
143 srs_define_macro "SRS_AUTO_SSL" $SRS_AUTO_HEADERS_H 119 srs_define_macro "SRS_AUTO_SSL" $SRS_AUTO_HEADERS_H
144 else 120 else
@@ -478,14 +478,6 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then @@ -478,14 +478,6 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
478 fi 478 fi
479 479
480 ##################################################################################### 480 #####################################################################################
481 -# http-parser-2.1  
482 -#####################################################################################  
483 -# check the cross build flag file, if flag changed, need to rebuild the st.  
484 -if [ $SRS_HTTP_CORE = YES ]; then  
485 - echo "The http-parser is copied into srs_http_stack.*pp"  
486 -fi  
487 -  
488 -#####################################################################################  
489 # nginx for HLS, nginx-1.5.0 481 # nginx for HLS, nginx-1.5.0
490 ##################################################################################### 482 #####################################################################################
491 function write_nginx_html5() 483 function write_nginx_html5()
@@ -557,10 +549,9 @@ fi @@ -557,10 +549,9 @@ fi
557 ##################################################################################### 549 #####################################################################################
558 # cherrypy for http hooks callback, CherryPy-3.2.4 550 # cherrypy for http hooks callback, CherryPy-3.2.4
559 ##################################################################################### 551 #####################################################################################
560 -if [ $SRS_HTTP_CALLBACK = YES ]; then  
561 - if [[ -f ${SRS_OBJS}/CherryPy-3.2.4/setup.py ]]; then 552 +if [[ -f ${SRS_OBJS}/CherryPy-3.2.4/setup.py ]]; then
562 echo "CherryPy-3.2.4 is ok."; 553 echo "CherryPy-3.2.4 is ok.";
563 - else 554 +else
564 require_sudoer "install CherryPy-3.2.4" 555 require_sudoer "install CherryPy-3.2.4"
565 echo "Installing CherryPy-3.2.4"; 556 echo "Installing CherryPy-3.2.4";
566 ( 557 (
@@ -568,11 +559,10 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then @@ -568,11 +559,10 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then
568 unzip -q ../3rdparty/CherryPy-3.2.4.zip && cd CherryPy-3.2.4 && 559 unzip -q ../3rdparty/CherryPy-3.2.4.zip && cd CherryPy-3.2.4 &&
569 sudo python setup.py install 560 sudo python setup.py install
570 ) 561 )
571 - fi  
572 - # check status  
573 - ret=$?; if [[ $ret -ne 0 ]]; then echo "build CherryPy-3.2.4 failed, ret=$ret"; exit $ret; fi  
574 - if [ ! -f ${SRS_OBJS}/CherryPy-3.2.4/setup.py ]; then echo "build CherryPy-3.2.4 failed."; exit -1; fi  
575 fi 562 fi
  563 +# check status
  564 +ret=$?; if [[ $ret -ne 0 ]]; then echo "build CherryPy-3.2.4 failed, ret=$ret"; exit $ret; fi
  565 +if [ ! -f ${SRS_OBJS}/CherryPy-3.2.4/setup.py ]; then echo "build CherryPy-3.2.4 failed."; exit -1; fi
576 566
577 if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then 567 if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
578 echo "Link players to cherrypy static-dir" 568 echo "Link players to cherrypy static-dir"
@@ -597,13 +587,11 @@ if [ $__SRS_BUILD_NGINX = YES ]; then @@ -597,13 +587,11 @@ if [ $__SRS_BUILD_NGINX = YES ]; then
597 rm -f ${SRS_OBJS}/nginx/html/index.html && 587 rm -f ${SRS_OBJS}/nginx/html/index.html &&
598 ln -sf `pwd`/research/players/nginx_index.html ${SRS_OBJS}/nginx/html/index.html 588 ln -sf `pwd`/research/players/nginx_index.html ${SRS_OBJS}/nginx/html/index.html
599 fi 589 fi
600 -# if http-server enalbed, use srs embeded http-server  
601 -if [ $SRS_HTTP_SERVER = YES ]; then 590 +if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
  591 + # if http-server enalbed, use srs embeded http-server
602 rm -f ${SRS_OBJS}/nginx/html/index.html && 592 rm -f ${SRS_OBJS}/nginx/html/index.html &&
603 ln -sf `pwd`/research/players/srs-http-server_index.html ${SRS_OBJS}/nginx/html/index.html 593 ln -sf `pwd`/research/players/srs-http-server_index.html ${SRS_OBJS}/nginx/html/index.html
604 -fi  
605 -# if api-server enabled, generate for api server.  
606 -if [ $SRS_HTTP_CALLBACK = YES ]; then 594 + # if api-server enabled, generate for api server.
607 rm -f ${SRS_OBJS}/nginx/html/index.html && 595 rm -f ${SRS_OBJS}/nginx/html/index.html &&
608 ln -sf `pwd`/research/players/api-server_index.html ${SRS_OBJS}/nginx/html/index.html 596 ln -sf `pwd`/research/players/api-server_index.html ${SRS_OBJS}/nginx/html/index.html
609 fi 597 fi
@@ -24,11 +24,8 @@ SRS_FFMPEG_TOOL=RESERVED @@ -24,11 +24,8 @@ SRS_FFMPEG_TOOL=RESERVED
24 SRS_TRANSCODE=RESERVED 24 SRS_TRANSCODE=RESERVED
25 SRS_INGEST=RESERVED 25 SRS_INGEST=RESERVED
26 SRS_STAT=RESERVED 26 SRS_STAT=RESERVED
27 -SRS_HTTP_CALLBACK=RESERVED  
28 -SRS_HTTP_SERVER=RESERVED  
29 SRS_STREAM_CASTER=RESERVED 27 SRS_STREAM_CASTER=RESERVED
30 SRS_KAFKA=RESERVED 28 SRS_KAFKA=RESERVED
31 -SRS_HTTP_API=RESERVED  
32 SRS_LIBRTMP=RESERVED 29 SRS_LIBRTMP=RESERVED
33 SRS_RESEARCH=RESERVED 30 SRS_RESEARCH=RESERVED
34 SRS_UTEST=RESERVED 31 SRS_UTEST=RESERVED
@@ -45,10 +42,15 @@ SRS_GPERF_CP=RESERVED @@ -45,10 +42,15 @@ SRS_GPERF_CP=RESERVED
45 # gprof 42 # gprof
46 SRS_GPROF=RESERVED 43 SRS_GPROF=RESERVED
47 # 44 #
  45 +# Always enable the HTTP features.
  46 +SRS_HTTP_CALLBACK=YES
  47 +SRS_HTTP_SERVER=YES
  48 +SRS_HTTP_API=YES
  49 +SRS_HTTP_CORE=YES
  50 +#
48 ################################################################ 51 ################################################################
49 # libraries 52 # libraries
50 SRS_FFMPEG_STUB=RESERVED 53 SRS_FFMPEG_STUB=RESERVED
51 -SRS_HTTP_CORE=RESERVED  
52 # arguments 54 # arguments
53 SRS_PREFIX=/usr/local/srs 55 SRS_PREFIX=/usr/local/srs
54 SRS_JOBS=1 56 SRS_JOBS=1
@@ -235,11 +237,8 @@ function parse_user_option() { @@ -235,11 +237,8 @@ function parse_user_option() {
235 --with-transcode) SRS_TRANSCODE=YES ;; 237 --with-transcode) SRS_TRANSCODE=YES ;;
236 --with-ingest) SRS_INGEST=YES ;; 238 --with-ingest) SRS_INGEST=YES ;;
237 --with-stat) SRS_STAT=YES ;; 239 --with-stat) SRS_STAT=YES ;;
238 - --with-http-callback) SRS_HTTP_CALLBACK=YES ;;  
239 - --with-http-server) SRS_HTTP_SERVER=YES ;;  
240 --with-stream-caster) SRS_STREAM_CASTER=YES ;; 240 --with-stream-caster) SRS_STREAM_CASTER=YES ;;
241 --with-kafka) SRS_KAFKA=YES ;; 241 --with-kafka) SRS_KAFKA=YES ;;
242 - --with-http-api) SRS_HTTP_API=YES ;;  
243 --with-librtmp) SRS_LIBRTMP=YES ;; 242 --with-librtmp) SRS_LIBRTMP=YES ;;
244 --with-research) SRS_RESEARCH=YES ;; 243 --with-research) SRS_RESEARCH=YES ;;
245 --with-utest) SRS_UTEST=YES ;; 244 --with-utest) SRS_UTEST=YES ;;
@@ -261,11 +260,8 @@ function parse_user_option() { @@ -261,11 +260,8 @@ function parse_user_option() {
261 --without-transcode) SRS_TRANSCODE=NO ;; 260 --without-transcode) SRS_TRANSCODE=NO ;;
262 --without-ingest) SRS_INGEST=NO ;; 261 --without-ingest) SRS_INGEST=NO ;;
263 --without-stat) SRS_STAT=NO ;; 262 --without-stat) SRS_STAT=NO ;;
264 - --without-http-callback) SRS_HTTP_CALLBACK=NO ;;  
265 - --without-http-server) SRS_HTTP_SERVER=NO ;;  
266 --without-stream-caster) SRS_STREAM_CASTER=NO ;; 263 --without-stream-caster) SRS_STREAM_CASTER=NO ;;
267 --without-kafka) SRS_KAFKA=NO ;; 264 --without-kafka) SRS_KAFKA=NO ;;
268 - --without-http-api) SRS_HTTP_API=NO ;;  
269 --without-librtmp) SRS_LIBRTMP=NO ;; 265 --without-librtmp) SRS_LIBRTMP=NO ;;
270 --without-research) SRS_RESEARCH=NO ;; 266 --without-research) SRS_RESEARCH=NO ;;
271 --without-utest) SRS_UTEST=NO ;; 267 --without-utest) SRS_UTEST=NO ;;
@@ -306,6 +302,13 @@ function parse_user_option() { @@ -306,6 +302,13 @@ function parse_user_option() {
306 --export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;; 302 --export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;;
307 --export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;; 303 --export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;;
308 304
  305 + --with-http-callback) SRS_HTTP_CALLBACK=YES ;;
  306 + --with-http-api) SRS_HTTP_API=YES ;;
  307 + --with-http-server) SRS_HTTP_SERVER=YES ;;
  308 + --without-http-callback) SRS_HTTP_CALLBACK=NO ;;
  309 + --without-http-api) SRS_HTTP_API=NO ;;
  310 + --without-http-server) SRS_HTTP_SERVER=NO ;;
  311 +
309 *) 312 *)
310 echo "$0: error: invalid option \"$option\"" 313 echo "$0: error: invalid option \"$option\""
311 exit 1 314 exit 1
@@ -396,12 +399,8 @@ function apply_user_presets() { @@ -396,12 +399,8 @@ function apply_user_presets() {
396 SRS_TRANSCODE=NO 399 SRS_TRANSCODE=NO
397 SRS_INGEST=NO 400 SRS_INGEST=NO
398 SRS_STAT=NO 401 SRS_STAT=NO
399 - SRS_HTTP_CORE=NO  
400 - SRS_HTTP_CALLBACK=NO  
401 - SRS_HTTP_SERVER=NO  
402 SRS_STREAM_CASTER=NO 402 SRS_STREAM_CASTER=NO
403 SRS_KAFKA=NO 403 SRS_KAFKA=NO
404 - SRS_HTTP_API=NO  
405 SRS_LIBRTMP=NO 404 SRS_LIBRTMP=NO
406 SRS_RESEARCH=NO 405 SRS_RESEARCH=NO
407 SRS_UTEST=NO 406 SRS_UTEST=NO
@@ -425,12 +424,8 @@ function apply_user_presets() { @@ -425,12 +424,8 @@ function apply_user_presets() {
425 SRS_TRANSCODE=YES 424 SRS_TRANSCODE=YES
426 SRS_INGEST=YES 425 SRS_INGEST=YES
427 SRS_STAT=YES 426 SRS_STAT=YES
428 - SRS_HTTP_CORE=YES  
429 - SRS_HTTP_CALLBACK=YES  
430 - SRS_HTTP_SERVER=YES  
431 SRS_STREAM_CASTER=YES 427 SRS_STREAM_CASTER=YES
432 SRS_KAFKA=YES 428 SRS_KAFKA=YES
433 - SRS_HTTP_API=YES  
434 SRS_LIBRTMP=YES 429 SRS_LIBRTMP=YES
435 SRS_RESEARCH=YES 430 SRS_RESEARCH=YES
436 SRS_UTEST=YES 431 SRS_UTEST=YES
@@ -454,12 +449,8 @@ function apply_user_presets() { @@ -454,12 +449,8 @@ function apply_user_presets() {
454 SRS_TRANSCODE=NO 449 SRS_TRANSCODE=NO
455 SRS_INGEST=NO 450 SRS_INGEST=NO
456 SRS_STAT=NO 451 SRS_STAT=NO
457 - SRS_HTTP_CORE=NO  
458 - SRS_HTTP_CALLBACK=NO  
459 - SRS_HTTP_SERVER=NO  
460 SRS_STREAM_CASTER=NO 452 SRS_STREAM_CASTER=NO
461 SRS_KAFKA=NO 453 SRS_KAFKA=NO
462 - SRS_HTTP_API=NO  
463 SRS_LIBRTMP=NO 454 SRS_LIBRTMP=NO
464 SRS_RESEARCH=NO 455 SRS_RESEARCH=NO
465 SRS_UTEST=NO 456 SRS_UTEST=NO
@@ -483,12 +474,8 @@ function apply_user_presets() { @@ -483,12 +474,8 @@ function apply_user_presets() {
483 SRS_TRANSCODE=NO 474 SRS_TRANSCODE=NO
484 SRS_INGEST=NO 475 SRS_INGEST=NO
485 SRS_STAT=NO 476 SRS_STAT=NO
486 - SRS_HTTP_CORE=NO  
487 - SRS_HTTP_CALLBACK=NO  
488 - SRS_HTTP_SERVER=NO  
489 SRS_STREAM_CASTER=NO 477 SRS_STREAM_CASTER=NO
490 SRS_KAFKA=NO 478 SRS_KAFKA=NO
491 - SRS_HTTP_API=NO  
492 SRS_LIBRTMP=NO 479 SRS_LIBRTMP=NO
493 SRS_RESEARCH=NO 480 SRS_RESEARCH=NO
494 SRS_UTEST=NO 481 SRS_UTEST=NO
@@ -512,12 +499,8 @@ function apply_user_presets() { @@ -512,12 +499,8 @@ function apply_user_presets() {
512 SRS_TRANSCODE=NO 499 SRS_TRANSCODE=NO
513 SRS_INGEST=NO 500 SRS_INGEST=NO
514 SRS_STAT=NO 501 SRS_STAT=NO
515 - SRS_HTTP_CORE=NO  
516 - SRS_HTTP_CALLBACK=NO  
517 - SRS_HTTP_SERVER=NO  
518 SRS_STREAM_CASTER=NO 502 SRS_STREAM_CASTER=NO
519 SRS_KAFKA=NO 503 SRS_KAFKA=NO
520 - SRS_HTTP_API=NO  
521 SRS_LIBRTMP=NO 504 SRS_LIBRTMP=NO
522 SRS_RESEARCH=NO 505 SRS_RESEARCH=NO
523 SRS_UTEST=NO 506 SRS_UTEST=NO
@@ -541,12 +524,8 @@ function apply_user_presets() { @@ -541,12 +524,8 @@ function apply_user_presets() {
541 SRS_TRANSCODE=YES 524 SRS_TRANSCODE=YES
542 SRS_INGEST=YES 525 SRS_INGEST=YES
543 SRS_STAT=YES 526 SRS_STAT=YES
544 - SRS_HTTP_CORE=YES  
545 - SRS_HTTP_CALLBACK=YES  
546 - SRS_HTTP_SERVER=YES  
547 SRS_STREAM_CASTER=YES 527 SRS_STREAM_CASTER=YES
548 SRS_KAFKA=YES 528 SRS_KAFKA=YES
549 - SRS_HTTP_API=YES  
550 SRS_LIBRTMP=YES 529 SRS_LIBRTMP=YES
551 SRS_RESEARCH=NO 530 SRS_RESEARCH=NO
552 SRS_UTEST=NO 531 SRS_UTEST=NO
@@ -571,12 +550,8 @@ function apply_user_presets() { @@ -571,12 +550,8 @@ function apply_user_presets() {
571 SRS_TRANSCODE=YES 550 SRS_TRANSCODE=YES
572 SRS_INGEST=YES 551 SRS_INGEST=YES
573 SRS_STAT=YES 552 SRS_STAT=YES
574 - SRS_HTTP_CORE=YES  
575 - SRS_HTTP_CALLBACK=YES  
576 - SRS_HTTP_SERVER=YES  
577 SRS_STREAM_CASTER=YES 553 SRS_STREAM_CASTER=YES
578 SRS_KAFKA=YES 554 SRS_KAFKA=YES
579 - SRS_HTTP_API=YES  
580 SRS_LIBRTMP=YES 555 SRS_LIBRTMP=YES
581 SRS_RESEARCH=NO 556 SRS_RESEARCH=NO
582 SRS_UTEST=NO 557 SRS_UTEST=NO
@@ -600,12 +575,8 @@ function apply_user_presets() { @@ -600,12 +575,8 @@ function apply_user_presets() {
600 SRS_TRANSCODE=YES 575 SRS_TRANSCODE=YES
601 SRS_INGEST=YES 576 SRS_INGEST=YES
602 SRS_STAT=YES 577 SRS_STAT=YES
603 - SRS_HTTP_CORE=YES  
604 - SRS_HTTP_CALLBACK=YES  
605 - SRS_HTTP_SERVER=YES  
606 SRS_STREAM_CASTER=YES 578 SRS_STREAM_CASTER=YES
607 SRS_KAFKA=YES 579 SRS_KAFKA=YES
608 - SRS_HTTP_API=YES  
609 SRS_LIBRTMP=YES 580 SRS_LIBRTMP=YES
610 SRS_RESEARCH=NO 581 SRS_RESEARCH=NO
611 SRS_UTEST=YES 582 SRS_UTEST=YES
@@ -629,12 +600,8 @@ function apply_user_presets() { @@ -629,12 +600,8 @@ function apply_user_presets() {
629 SRS_TRANSCODE=YES 600 SRS_TRANSCODE=YES
630 SRS_INGEST=YES 601 SRS_INGEST=YES
631 SRS_STAT=YES 602 SRS_STAT=YES
632 - SRS_HTTP_CORE=YES  
633 - SRS_HTTP_CALLBACK=YES  
634 - SRS_HTTP_SERVER=YES  
635 SRS_STREAM_CASTER=YES 603 SRS_STREAM_CASTER=YES
636 SRS_KAFKA=YES 604 SRS_KAFKA=YES
637 - SRS_HTTP_API=YES  
638 SRS_LIBRTMP=YES 605 SRS_LIBRTMP=YES
639 SRS_RESEARCH=NO 606 SRS_RESEARCH=NO
640 SRS_UTEST=YES 607 SRS_UTEST=YES
@@ -658,12 +625,8 @@ function apply_user_presets() { @@ -658,12 +625,8 @@ function apply_user_presets() {
658 SRS_TRANSCODE=YES 625 SRS_TRANSCODE=YES
659 SRS_INGEST=YES 626 SRS_INGEST=YES
660 SRS_STAT=YES 627 SRS_STAT=YES
661 - SRS_HTTP_CORE=YES  
662 - SRS_HTTP_CALLBACK=YES  
663 - SRS_HTTP_SERVER=YES  
664 SRS_STREAM_CASTER=YES 628 SRS_STREAM_CASTER=YES
665 SRS_KAFKA=YES 629 SRS_KAFKA=YES
666 - SRS_HTTP_API=YES  
667 SRS_LIBRTMP=YES 630 SRS_LIBRTMP=YES
668 SRS_RESEARCH=YES 631 SRS_RESEARCH=YES
669 SRS_UTEST=YES 632 SRS_UTEST=YES
@@ -687,12 +650,8 @@ function apply_user_presets() { @@ -687,12 +650,8 @@ function apply_user_presets() {
687 SRS_TRANSCODE=YES 650 SRS_TRANSCODE=YES
688 SRS_INGEST=YES 651 SRS_INGEST=YES
689 SRS_STAT=YES 652 SRS_STAT=YES
690 - SRS_HTTP_CORE=YES  
691 - SRS_HTTP_CALLBACK=YES  
692 - SRS_HTTP_SERVER=YES  
693 SRS_STREAM_CASTER=YES 653 SRS_STREAM_CASTER=YES
694 SRS_KAFKA=YES 654 SRS_KAFKA=YES
695 - SRS_HTTP_API=YES  
696 SRS_LIBRTMP=NO 655 SRS_LIBRTMP=NO
697 SRS_RESEARCH=NO 656 SRS_RESEARCH=NO
698 SRS_UTEST=NO 657 SRS_UTEST=NO
@@ -716,12 +675,8 @@ function apply_user_presets() { @@ -716,12 +675,8 @@ function apply_user_presets() {
716 SRS_TRANSCODE=YES 675 SRS_TRANSCODE=YES
717 SRS_INGEST=YES 676 SRS_INGEST=YES
718 SRS_STAT=YES 677 SRS_STAT=YES
719 - SRS_HTTP_CORE=YES  
720 - SRS_HTTP_CALLBACK=YES  
721 - SRS_HTTP_SERVER=YES  
722 SRS_STREAM_CASTER=YES 678 SRS_STREAM_CASTER=YES
723 SRS_KAFKA=YES 679 SRS_KAFKA=YES
724 - SRS_HTTP_API=YES  
725 SRS_LIBRTMP=YES 680 SRS_LIBRTMP=YES
726 SRS_RESEARCH=NO 681 SRS_RESEARCH=NO
727 SRS_UTEST=YES 682 SRS_UTEST=YES
@@ -745,12 +700,8 @@ function apply_user_presets() { @@ -745,12 +700,8 @@ function apply_user_presets() {
745 SRS_TRANSCODE=YES 700 SRS_TRANSCODE=YES
746 SRS_INGEST=YES 701 SRS_INGEST=YES
747 SRS_STAT=YES 702 SRS_STAT=YES
748 - SRS_HTTP_CORE=YES  
749 - SRS_HTTP_CALLBACK=YES  
750 - SRS_HTTP_SERVER=YES  
751 SRS_STREAM_CASTER=YES 703 SRS_STREAM_CASTER=YES
752 SRS_KAFKA=YES 704 SRS_KAFKA=YES
753 - SRS_HTTP_API=YES  
754 SRS_LIBRTMP=YES 705 SRS_LIBRTMP=YES
755 SRS_RESEARCH=NO 706 SRS_RESEARCH=NO
756 SRS_UTEST=NO 707 SRS_UTEST=NO
@@ -774,12 +725,8 @@ function apply_user_presets() { @@ -774,12 +725,8 @@ function apply_user_presets() {
774 SRS_TRANSCODE=YES 725 SRS_TRANSCODE=YES
775 SRS_INGEST=YES 726 SRS_INGEST=YES
776 SRS_STAT=YES 727 SRS_STAT=YES
777 - SRS_HTTP_CORE=YES  
778 - SRS_HTTP_CALLBACK=YES  
779 - SRS_HTTP_SERVER=YES  
780 SRS_STREAM_CASTER=NO 728 SRS_STREAM_CASTER=NO
781 SRS_KAFKA=YES 729 SRS_KAFKA=YES
782 - SRS_HTTP_API=YES  
783 SRS_LIBRTMP=YES 730 SRS_LIBRTMP=YES
784 SRS_RESEARCH=NO 731 SRS_RESEARCH=NO
785 SRS_UTEST=NO 732 SRS_UTEST=NO
@@ -809,11 +756,11 @@ function apply_user_detail_options() { @@ -809,11 +756,11 @@ function apply_user_detail_options() {
809 if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi 756 if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi
810 if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi 757 if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi
811 758
812 - # if http-xxxx specified, open the SRS_HTTP_CORE  
813 - SRS_HTTP_CORE=NO  
814 - if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_CORE=YES; fi  
815 - if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_CORE=YES; fi  
816 - if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_CORE=YES; fi 759 + # Always enable HTTP utilies.
  760 + if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable http utilies.${BLACK}"; fi
  761 + if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable http callback.${BLACK}"; fi
  762 + if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable http server.${BLACK}"; fi
  763 + if [ $SRS_HTTP_API = NO ]; then SRS_HTTP_API=YES; echo -e "${YELLOW}[WARN] Always enable http api.${BLACK}"; fi
817 764
818 # parse the jobs for make 765 # parse the jobs for make
819 if [[ "" -eq SRS_JOBS ]]; then 766 if [[ "" -eq SRS_JOBS ]]; then
@@ -838,12 +785,8 @@ function apply_user_detail_options() { @@ -838,12 +785,8 @@ function apply_user_detail_options() {
838 SRS_TRANSCODE=NO 785 SRS_TRANSCODE=NO
839 SRS_INGEST=NO 786 SRS_INGEST=NO
840 SRS_STAT=NO 787 SRS_STAT=NO
841 - SRS_HTTP_CORE=NO  
842 - SRS_HTTP_CALLBACK=NO  
843 - SRS_HTTP_SERVER=NO  
844 SRS_STREAM_CASTER=NO 788 SRS_STREAM_CASTER=NO
845 SRS_KAFKA=NO 789 SRS_KAFKA=NO
846 - SRS_HTTP_API=NO  
847 SRS_LIBRTMP=YES 790 SRS_LIBRTMP=YES
848 SRS_RESEARCH=YES 791 SRS_RESEARCH=YES
849 SRS_UTEST=NO 792 SRS_UTEST=NO
@@ -915,9 +858,6 @@ function check_option_conflicts() { @@ -915,9 +858,6 @@ function check_option_conflicts() {
915 echo "Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time"; 858 echo "Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time";
916 __check_ok=NO 859 __check_ok=NO
917 fi 860 fi
918 - if [[ $SRS_HTTP_CORE = NO && $SRS_STREAM_CASTER = YES ]]; then  
919 - echo "stream-caster depends on http-api or http-server, see: ./configure --help"; __check_ok=NO;  
920 - fi  
921 # generate the group option: SRS_GPERF 861 # generate the group option: SRS_GPERF
922 __gperf_slow=NO 862 __gperf_slow=NO
923 if [ $SRS_GPERF_MC = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi 863 if [ $SRS_GPERF_MC = YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
@@ -964,11 +904,8 @@ function check_option_conflicts() { @@ -964,11 +904,8 @@ function check_option_conflicts() {
964 if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi 904 if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
965 if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi 905 if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
966 if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi 906 if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi
967 - if [ $SRS_HTTP_CALLBACK = RESERVED ]; then echo "you must specifies the http-callback, see: ./configure --help"; __check_ok=NO; fi  
968 - if [ $SRS_HTTP_SERVER = RESERVED ]; then echo "you must specifies the http-server, see: ./configure --help"; __check_ok=NO; fi  
969 if [ $SRS_STREAM_CASTER = RESERVED ]; then echo "you must specifies the stream-caster, see: ./configure --help"; __check_ok=NO; fi 907 if [ $SRS_STREAM_CASTER = RESERVED ]; then echo "you must specifies the stream-caster, see: ./configure --help"; __check_ok=NO; fi
970 if [ $SRS_KAFKA = RESERVED ]; then echo "you must specifies the kafka, see: ./configure --help"; __check_ok=NO; fi 908 if [ $SRS_KAFKA = RESERVED ]; then echo "you must specifies the kafka, see: ./configure --help"; __check_ok=NO; fi
971 - if [ $SRS_HTTP_API = RESERVED ]; then echo "you must specifies the http-api, see: ./configure --help"; __check_ok=NO; fi  
972 if [ $SRS_LIBRTMP = RESERVED ]; then echo "you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi 909 if [ $SRS_LIBRTMP = RESERVED ]; then echo "you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi
973 if [ $SRS_RESEARCH = RESERVED ]; then echo "you must specifies the research, see: ./configure --help"; __check_ok=NO; fi 910 if [ $SRS_RESEARCH = RESERVED ]; then echo "you must specifies the research, see: ./configure --help"; __check_ok=NO; fi
974 if [ $SRS_UTEST = RESERVED ]; then echo "you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi 911 if [ $SRS_UTEST = RESERVED ]; then echo "you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi
@@ -3783,17 +3783,6 @@ int SrsConfig::check_config() @@ -3783,17 +3783,6 @@ int SrsConfig::check_config()
3783 //////////////////////////////////////////////////////////////////////// 3783 ////////////////////////////////////////////////////////////////////////
3784 // check features 3784 // check features
3785 //////////////////////////////////////////////////////////////////////// 3785 ////////////////////////////////////////////////////////////////////////
3786 -#ifndef SRS_AUTO_HTTP_SERVER  
3787 - if (get_http_stream_enabled()) {  
3788 - srs_warn("http_stream is disabled by configure");  
3789 - }  
3790 -#endif  
3791 -#ifndef SRS_AUTO_HTTP_API  
3792 - if (get_http_api_enabled()) {  
3793 - srs_warn("http_api is disabled by configure");  
3794 - }  
3795 -#endif  
3796 -  
3797 vector<SrsConfDirective*> stream_casters = get_stream_casters(); 3786 vector<SrsConfDirective*> stream_casters = get_stream_casters();
3798 for (int n = 0; n < (int)stream_casters.size(); n++) { 3787 for (int n = 0; n < (int)stream_casters.size(); n++) {
3799 SrsConfDirective* stream_caster = stream_casters[n]; 3788 SrsConfDirective* stream_caster = stream_casters[n];
@@ -4066,11 +4055,6 @@ int SrsConfig::check_config() @@ -4066,11 +4055,6 @@ int SrsConfig::check_config()
4066 srs_warn("hls of vhost %s is disabled by configure", vhost->arg0().c_str()); 4055 srs_warn("hls of vhost %s is disabled by configure", vhost->arg0().c_str());
4067 } 4056 }
4068 #endif 4057 #endif
4069 -#ifndef SRS_AUTO_HTTP_CALLBACK  
4070 - if (get_vhost_http_hooks_enabled(vhost->arg0())) {  
4071 - srs_warn("http_hooks of vhost %s is disabled by configure", vhost->arg0().c_str());  
4072 - }  
4073 -#endif  
4074 #ifndef SRS_AUTO_TRANSCODE 4058 #ifndef SRS_AUTO_TRANSCODE
4075 if (get_transcode_enabled(get_transcode(vhost->arg0(), ""))) { 4059 if (get_transcode_enabled(get_transcode(vhost->arg0(), ""))) {
4076 srs_warn("transcode of vhost %s is disabled by configure", vhost->arg0().c_str()); 4060 srs_warn("transcode of vhost %s is disabled by configure", vhost->arg0().c_str());
@@ -302,7 +302,6 @@ int SrsFlvSegment::write_video(SrsSharedPtrMessage* shared_video) @@ -302,7 +302,6 @@ int SrsFlvSegment::write_video(SrsSharedPtrMessage* shared_video)
302 int size = video->size; 302 int size = video->size;
303 303
304 bool is_sequence_header = SrsFlvCodec::video_is_sequence_header(payload, size); 304 bool is_sequence_header = SrsFlvCodec::video_is_sequence_header(payload, size);
305 -#ifdef SRS_AUTO_HTTP_CALLBACK  
306 bool is_key_frame = SrsFlvCodec::video_is_h264(payload, size) 305 bool is_key_frame = SrsFlvCodec::video_is_h264(payload, size)
307 && SrsFlvCodec::video_is_keyframe(payload, size) && !is_sequence_header; 306 && SrsFlvCodec::video_is_keyframe(payload, size) && !is_sequence_header;
308 if (is_key_frame) { 307 if (is_key_frame) {
@@ -312,7 +311,6 @@ int SrsFlvSegment::write_video(SrsSharedPtrMessage* shared_video) @@ -312,7 +311,6 @@ int SrsFlvSegment::write_video(SrsSharedPtrMessage* shared_video)
312 } 311 }
313 } 312 }
314 srs_verbose("dvr video is key: %d", is_key_frame); 313 srs_verbose("dvr video is key: %d", is_key_frame);
315 -#endif  
316 314
317 // accept the sequence header here. 315 // accept the sequence header here.
318 // when got no keyframe, ignore when should wait keyframe. 316 // when got no keyframe, ignore when should wait keyframe.
@@ -512,7 +510,6 @@ int SrsDvrAsyncCallOnDvr::call() @@ -512,7 +510,6 @@ int SrsDvrAsyncCallOnDvr::call()
512 { 510 {
513 int ret = ERROR_SUCCESS; 511 int ret = ERROR_SUCCESS;
514 512
515 -#ifdef SRS_AUTO_HTTP_CALLBACK  
516 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 513 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
517 return ret; 514 return ret;
518 } 515 }
@@ -540,7 +537,6 @@ int SrsDvrAsyncCallOnDvr::call() @@ -540,7 +537,6 @@ int SrsDvrAsyncCallOnDvr::call()
540 return ret; 537 return ret;
541 } 538 }
542 } 539 }
543 -#endif  
544 540
545 return ret; 541 return ret;
546 } 542 }
@@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
24 #include <srs_app_heartbeat.hpp> 24 #include <srs_app_heartbeat.hpp>
25 25
26 -#ifdef SRS_AUTO_HTTP_CORE  
27 -  
28 #include <sstream> 26 #include <sstream>
29 using namespace std; 27 using namespace std;
30 28
@@ -104,5 +102,3 @@ void SrsHttpHeartbeat::heartbeat() @@ -104,5 +102,3 @@ void SrsHttpHeartbeat::heartbeat()
104 return; 102 return;
105 } 103 }
106 104
107 -#endif  
108 -  
@@ -29,8 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -29,8 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 */ 29 */
30 #include <srs_core.hpp> 30 #include <srs_core.hpp>
31 31
32 -#ifdef SRS_AUTO_HTTP_CORE  
33 -  
34 /** 32 /**
35 * the http heartbeat to api-server to notice api 33 * the http heartbeat to api-server to notice api
36 * that the information of SRS. 34 * that the information of SRS.
@@ -46,5 +44,3 @@ public: @@ -46,5 +44,3 @@ public:
46 44
47 #endif 45 #endif
48 46
49 -#endif  
50 -  
@@ -190,7 +190,6 @@ int SrsDvrAsyncCallOnHls::call() @@ -190,7 +190,6 @@ int SrsDvrAsyncCallOnHls::call()
190 { 190 {
191 int ret = ERROR_SUCCESS; 191 int ret = ERROR_SUCCESS;
192 192
193 -#ifdef SRS_AUTO_HTTP_CALLBACK  
194 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 193 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
195 return ret; 194 return ret;
196 } 195 }
@@ -218,7 +217,6 @@ int SrsDvrAsyncCallOnHls::call() @@ -218,7 +217,6 @@ int SrsDvrAsyncCallOnHls::call()
218 return ret; 217 return ret;
219 } 218 }
220 } 219 }
221 -#endif  
222 220
223 return ret; 221 return ret;
224 } 222 }
@@ -244,7 +242,6 @@ int SrsDvrAsyncCallOnHlsNotify::call() @@ -244,7 +242,6 @@ int SrsDvrAsyncCallOnHlsNotify::call()
244 { 242 {
245 int ret = ERROR_SUCCESS; 243 int ret = ERROR_SUCCESS;
246 244
247 -#ifdef SRS_AUTO_HTTP_CALLBACK  
248 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 245 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
249 return ret; 246 return ret;
250 } 247 }
@@ -273,7 +270,6 @@ int SrsDvrAsyncCallOnHlsNotify::call() @@ -273,7 +270,6 @@ int SrsDvrAsyncCallOnHlsNotify::call()
273 return ret; 270 return ret;
274 } 271 }
275 } 272 }
276 -#endif  
277 273
278 return ret; 274 return ret;
279 } 275 }
@@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
24 #include <srs_app_http_api.hpp> 24 #include <srs_app_http_api.hpp>
25 25
26 -#ifdef SRS_AUTO_HTTP_API  
27 -  
28 #include <sstream> 26 #include <sstream>
29 #include <stdlib.h> 27 #include <stdlib.h>
30 #include <signal.h> 28 #include <signal.h>
@@ -556,21 +554,9 @@ int SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) @@ -556,21 +554,9 @@ int SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
556 #else 554 #else
557 features->set("hds", SrsJsonAny::boolean(false)); 555 features->set("hds", SrsJsonAny::boolean(false));
558 #endif 556 #endif
559 -#ifdef SRS_AUTO_HTTP_CALLBACK  
560 features->set("callback", SrsJsonAny::boolean(true)); 557 features->set("callback", SrsJsonAny::boolean(true));
561 -#else  
562 - features->set("callback", SrsJsonAny::boolean(false));  
563 -#endif  
564 -#ifdef SRS_AUTO_HTTP_API  
565 features->set("api", SrsJsonAny::boolean(true)); 558 features->set("api", SrsJsonAny::boolean(true));
566 -#else  
567 - features->set("api", SrsJsonAny::boolean(false));  
568 -#endif  
569 -#ifdef SRS_AUTO_HTTP_SERVER  
570 features->set("httpd", SrsJsonAny::boolean(true)); 559 features->set("httpd", SrsJsonAny::boolean(true));
571 -#else  
572 - features->set("httpd", SrsJsonAny::boolean(false));  
573 -#endif  
574 #ifdef SRS_AUTO_DVR 560 #ifdef SRS_AUTO_DVR
575 features->set("dvr", SrsJsonAny::boolean(true)); 561 features->set("dvr", SrsJsonAny::boolean(true));
576 #else 562 #else
@@ -1447,5 +1433,3 @@ int SrsHttpApi::on_reload_http_api_crossdomain() @@ -1447,5 +1433,3 @@ int SrsHttpApi::on_reload_http_api_crossdomain()
1447 return ERROR_SUCCESS; 1433 return ERROR_SUCCESS;
1448 } 1434 }
1449 1435
1450 -#endif  
1451 -  
@@ -30,8 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -30,8 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 30
31 #include <srs_core.hpp> 31 #include <srs_core.hpp>
32 32
33 -#ifdef SRS_AUTO_HTTP_API  
34 -  
35 class SrsStSocket; 33 class SrsStSocket;
36 class ISrsHttpMessage; 34 class ISrsHttpMessage;
37 class SrsHttpParser; 35 class SrsHttpParser;
@@ -233,5 +231,3 @@ public: @@ -233,5 +231,3 @@ public:
233 231
234 #endif 232 #endif
235 233
236 -#endif  
237 -  
@@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
24 #include <srs_app_http_client.hpp> 24 #include <srs_app_http_client.hpp>
25 25
26 -#ifdef SRS_AUTO_HTTP_CORE  
27 -  
28 #include <arpa/inet.h> 26 #include <arpa/inet.h>
29 27
30 using namespace std; 28 using namespace std;
@@ -247,5 +245,3 @@ int SrsHttpClient::connect() @@ -247,5 +245,3 @@ int SrsHttpClient::connect()
247 return ret; 245 return ret;
248 } 246 }
249 247
250 -#endif  
251 -  
@@ -32,8 +32,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -32,8 +32,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 #include <string> 32 #include <string>
33 #include <map> 33 #include <map>
34 34
35 -#ifdef SRS_AUTO_HTTP_CORE  
36 -  
37 #include <srs_app_st.hpp> 35 #include <srs_app_st.hpp>
38 36
39 class SrsHttpUri; 37 class SrsHttpUri;
@@ -112,5 +110,3 @@ private: @@ -112,5 +110,3 @@ private:
112 110
113 #endif 111 #endif
114 112
115 -#endif  
116 -  
@@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
24 #include <srs_app_http_conn.hpp> 24 #include <srs_app_http_conn.hpp>
25 25
26 -#if defined(SRS_AUTO_HTTP_CORE)  
27 -  
28 #include <sys/types.h> 26 #include <sys/types.h>
29 #include <sys/stat.h> 27 #include <sys/stat.h>
30 #include <fcntl.h> 28 #include <fcntl.h>
@@ -60,10 +58,6 @@ using namespace std; @@ -60,10 +58,6 @@ using namespace std;
60 #include <srs_protocol_amf0.hpp> 58 #include <srs_protocol_amf0.hpp>
61 #include <srs_app_utility.hpp> 59 #include <srs_app_utility.hpp>
62 60
63 -#endif  
64 -  
65 -#ifdef SRS_AUTO_HTTP_CORE  
66 -  
67 SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io) 61 SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)
68 { 62 {
69 skt = io; 63 skt = io;
@@ -1280,12 +1274,10 @@ int SrsHttpServer::initialize() @@ -1280,12 +1274,10 @@ int SrsHttpServer::initialize()
1280 { 1274 {
1281 int ret = ERROR_SUCCESS; 1275 int ret = ERROR_SUCCESS;
1282 1276
1283 -#if defined(SRS_AUTO_HTTP_SERVER) && defined(SRS_AUTO_HTTP_API)  
1284 // for SRS go-sharp to detect the status of HTTP server of SRS HTTP FLV Cluster. 1277 // for SRS go-sharp to detect the status of HTTP server of SRS HTTP FLV Cluster.
1285 if ((ret = http_static->mux.handle("/api/v1/versions", new SrsGoApiVersion())) != ERROR_SUCCESS) { 1278 if ((ret = http_static->mux.handle("/api/v1/versions", new SrsGoApiVersion())) != ERROR_SUCCESS) {
1286 return ret; 1279 return ret;
1287 } 1280 }
1288 -#endif  
1289 1281
1290 if ((ret = http_stream->initialize()) != ERROR_SUCCESS) { 1282 if ((ret = http_stream->initialize()) != ERROR_SUCCESS) {
1291 return ret; 1283 return ret;
@@ -1318,5 +1310,3 @@ void SrsHttpServer::http_unmount(SrsSource* s, SrsRequest* r) @@ -1318,5 +1310,3 @@ void SrsHttpServer::http_unmount(SrsSource* s, SrsRequest* r)
1318 http_stream->http_unmount(s, r); 1310 http_stream->http_unmount(s, r);
1319 } 1311 }
1320 1312
1321 -#endif  
1322 -  
@@ -30,8 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -30,8 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 30
31 #include <srs_core.hpp> 31 #include <srs_core.hpp>
32 32
33 -#ifdef SRS_AUTO_HTTP_CORE  
34 -  
35 #include <map> 33 #include <map>
36 #include <string> 34 #include <string>
37 #include <vector> 35 #include <vector>
@@ -428,5 +426,3 @@ public: @@ -428,5 +426,3 @@ public:
428 426
429 #endif 427 #endif
430 428
431 -#endif  
432 -  
@@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
24 #include <srs_app_http_hooks.hpp> 24 #include <srs_app_http_hooks.hpp>
25 25
26 -#ifdef SRS_AUTO_HTTP_CALLBACK  
27 -  
28 #include <sstream> 26 #include <sstream>
29 using namespace std; 27 using namespace std;
30 28
@@ -503,5 +501,3 @@ int SrsHttpHooks::do_post(SrsHttpClient* hc, std::string url, std::string req, i @@ -503,5 +501,3 @@ int SrsHttpHooks::do_post(SrsHttpClient* hc, std::string url, std::string req, i
503 501
504 return ret; 502 return ret;
505 } 503 }
506 -  
507 -#endif  
@@ -31,8 +31,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,8 +31,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 31
32 #include <string> 32 #include <string>
33 33
34 -#ifdef SRS_AUTO_HTTP_CALLBACK  
35 -  
36 class SrsHttpUri; 34 class SrsHttpUri;
37 class SrsStSocket; 35 class SrsStSocket;
38 class SrsRequest; 36 class SrsRequest;
@@ -124,5 +122,3 @@ private: @@ -124,5 +122,3 @@ private:
124 122
125 #endif 123 #endif
126 124
127 -#endif  
128 -  
@@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
24 #include <srs_app_http_static.hpp> 24 #include <srs_app_http_static.hpp>
25 25
26 -#if defined(SRS_AUTO_HTTP_CORE)  
27 -  
28 #include <sys/types.h> 26 #include <sys/types.h>
29 #include <sys/stat.h> 27 #include <sys/stat.h>
30 #include <fcntl.h> 28 #include <fcntl.h>
@@ -53,10 +51,6 @@ using namespace std; @@ -53,10 +51,6 @@ using namespace std;
53 #include <srs_app_source.hpp> 51 #include <srs_app_source.hpp>
54 #include <srs_app_server.hpp> 52 #include <srs_app_server.hpp>
55 53
56 -#endif  
57 -  
58 -#ifdef SRS_AUTO_HTTP_SERVER  
59 -  
60 SrsVodStream::SrsVodStream(string root_dir) 54 SrsVodStream::SrsVodStream(string root_dir)
61 : SrsHttpFileServer(root_dir) 55 : SrsHttpFileServer(root_dir)
62 { 56 {
@@ -315,5 +309,3 @@ int SrsHttpStaticServer::on_reload_vhost_http_updated() @@ -315,5 +309,3 @@ int SrsHttpStaticServer::on_reload_vhost_http_updated()
315 return ret; 309 return ret;
316 } 310 }
317 311
318 -#endif  
319 -  
@@ -32,8 +32,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -32,8 +32,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 32
33 #include <srs_app_http_conn.hpp> 33 #include <srs_app_http_conn.hpp>
34 34
35 -#ifdef SRS_AUTO_HTTP_SERVER  
36 -  
37 /** 35 /**
38 * the flv vod stream supports flv?start=offset-bytes. 36 * the flv vod stream supports flv?start=offset-bytes.
39 * for example, http://server/file.flv?start=10240 37 * for example, http://server/file.flv?start=10240
@@ -75,5 +73,3 @@ public: @@ -75,5 +73,3 @@ public:
75 73
76 #endif 74 #endif
77 75
78 -#endif  
79 -  
@@ -25,8 +25,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -25,8 +25,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 25
26 #define SRS_STREAM_CACHE_CYCLE_SECONDS 30 26 #define SRS_STREAM_CACHE_CYCLE_SECONDS 30
27 27
28 -#if defined(SRS_AUTO_HTTP_CORE)  
29 -  
30 #include <sys/types.h> 28 #include <sys/types.h>
31 #include <sys/stat.h> 29 #include <sys/stat.h>
32 #include <fcntl.h> 30 #include <fcntl.h>
@@ -56,10 +54,6 @@ using namespace std; @@ -56,10 +54,6 @@ using namespace std;
56 #include <srs_app_server.hpp> 54 #include <srs_app_server.hpp>
57 #include <srs_app_statistic.hpp> 55 #include <srs_app_statistic.hpp>
58 56
59 -#endif  
60 -  
61 -#ifdef SRS_AUTO_HTTP_SERVER  
62 -  
63 SrsBufferCache::SrsBufferCache(SrsSource* s, SrsRequest* r) 57 SrsBufferCache::SrsBufferCache(SrsSource* s, SrsRequest* r)
64 { 58 {
65 req = r->copy(); 59 req = r->copy();
@@ -1077,5 +1071,3 @@ int SrsHttpStreamServer::initialize_flv_entry(std::string vhost) @@ -1077,5 +1071,3 @@ int SrsHttpStreamServer::initialize_flv_entry(std::string vhost)
1077 return ret; 1071 return ret;
1078 } 1072 }
1079 1073
1080 -#endif  
1081 -  
@@ -32,8 +32,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -32,8 +32,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 32
33 #include <srs_app_http_conn.hpp> 33 #include <srs_app_http_conn.hpp>
34 34
35 -#ifdef SRS_AUTO_HTTP_SERVER  
36 -  
37 /** 35 /**
38 * for the srs http stream cache, 36 * for the srs http stream cache,
39 * for example, the audio stream cache to make android(weixin) happy. 37 * for example, the audio stream cache to make android(weixin) happy.
@@ -354,5 +352,3 @@ private: @@ -354,5 +352,3 @@ private:
354 352
355 #endif 353 #endif
356 354
357 -#endif  
358 -  
@@ -1567,7 +1567,6 @@ int SrsRtmpConn::http_hooks_on_connect() @@ -1567,7 +1567,6 @@ int SrsRtmpConn::http_hooks_on_connect()
1567 1567
1568 SrsRequest* req = info->req; 1568 SrsRequest* req = info->req;
1569 1569
1570 -#ifdef SRS_AUTO_HTTP_CALLBACK  
1571 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1570 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
1572 return ret; 1571 return ret;
1573 } 1572 }
@@ -1595,14 +1594,12 @@ int SrsRtmpConn::http_hooks_on_connect() @@ -1595,14 +1594,12 @@ int SrsRtmpConn::http_hooks_on_connect()
1595 return ret; 1594 return ret;
1596 } 1595 }
1597 } 1596 }
1598 -#endif  
1599 1597
1600 return ret; 1598 return ret;
1601 } 1599 }
1602 1600
1603 void SrsRtmpConn::http_hooks_on_close() 1601 void SrsRtmpConn::http_hooks_on_close()
1604 { 1602 {
1605 -#ifdef SRS_AUTO_HTTP_CALLBACK  
1606 SrsRequest* req = info->req; 1603 SrsRequest* req = info->req;
1607 1604
1608 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1605 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
@@ -1629,14 +1626,12 @@ void SrsRtmpConn::http_hooks_on_close() @@ -1629,14 +1626,12 @@ void SrsRtmpConn::http_hooks_on_close()
1629 std::string url = hooks.at(i); 1626 std::string url = hooks.at(i);
1630 SrsHttpHooks::on_close(url, req, kbps->get_send_bytes(), kbps->get_recv_bytes()); 1627 SrsHttpHooks::on_close(url, req, kbps->get_send_bytes(), kbps->get_recv_bytes());
1631 } 1628 }
1632 -#endif  
1633 } 1629 }
1634 1630
1635 int SrsRtmpConn::http_hooks_on_publish() 1631 int SrsRtmpConn::http_hooks_on_publish()
1636 { 1632 {
1637 int ret = ERROR_SUCCESS; 1633 int ret = ERROR_SUCCESS;
1638 1634
1639 -#ifdef SRS_AUTO_HTTP_CALLBACK  
1640 SrsRequest* req = info->req; 1635 SrsRequest* req = info->req;
1641 1636
1642 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1637 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
@@ -1666,14 +1661,12 @@ int SrsRtmpConn::http_hooks_on_publish() @@ -1666,14 +1661,12 @@ int SrsRtmpConn::http_hooks_on_publish()
1666 return ret; 1661 return ret;
1667 } 1662 }
1668 } 1663 }
1669 -#endif  
1670 1664
1671 return ret; 1665 return ret;
1672 } 1666 }
1673 1667
1674 void SrsRtmpConn::http_hooks_on_unpublish() 1668 void SrsRtmpConn::http_hooks_on_unpublish()
1675 { 1669 {
1676 -#ifdef SRS_AUTO_HTTP_CALLBACK  
1677 SrsRequest* req = info->req; 1670 SrsRequest* req = info->req;
1678 1671
1679 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1672 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
@@ -1700,14 +1693,12 @@ void SrsRtmpConn::http_hooks_on_unpublish() @@ -1700,14 +1693,12 @@ void SrsRtmpConn::http_hooks_on_unpublish()
1700 std::string url = hooks.at(i); 1693 std::string url = hooks.at(i);
1701 SrsHttpHooks::on_unpublish(url, req); 1694 SrsHttpHooks::on_unpublish(url, req);
1702 } 1695 }
1703 -#endif  
1704 } 1696 }
1705 1697
1706 int SrsRtmpConn::http_hooks_on_play() 1698 int SrsRtmpConn::http_hooks_on_play()
1707 { 1699 {
1708 int ret = ERROR_SUCCESS; 1700 int ret = ERROR_SUCCESS;
1709 1701
1710 -#ifdef SRS_AUTO_HTTP_CALLBACK  
1711 SrsRequest* req = info->req; 1702 SrsRequest* req = info->req;
1712 1703
1713 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1704 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
@@ -1737,14 +1728,12 @@ int SrsRtmpConn::http_hooks_on_play() @@ -1737,14 +1728,12 @@ int SrsRtmpConn::http_hooks_on_play()
1737 return ret; 1728 return ret;
1738 } 1729 }
1739 } 1730 }
1740 -#endif  
1741 1731
1742 return ret; 1732 return ret;
1743 } 1733 }
1744 1734
1745 void SrsRtmpConn::http_hooks_on_stop() 1735 void SrsRtmpConn::http_hooks_on_stop()
1746 { 1736 {
1747 -#ifdef SRS_AUTO_HTTP_CALLBACK  
1748 SrsRequest* req = info->req; 1737 SrsRequest* req = info->req;
1749 1738
1750 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { 1739 if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) {
@@ -1771,7 +1760,6 @@ void SrsRtmpConn::http_hooks_on_stop() @@ -1771,7 +1760,6 @@ void SrsRtmpConn::http_hooks_on_stop()
1771 std::string url = hooks.at(i); 1760 std::string url = hooks.at(i);
1772 SrsHttpHooks::on_stop(url, req); 1761 SrsHttpHooks::on_stop(url, req);
1773 } 1762 }
1774 -#endif  
1775 1763
1776 return; 1764 return;
1777 } 1765 }
@@ -46,9 +46,7 @@ class SrsRefer; @@ -46,9 +46,7 @@ class SrsRefer;
46 class SrsConsumer; 46 class SrsConsumer;
47 class SrsCommonMessage; 47 class SrsCommonMessage;
48 class SrsStSocket; 48 class SrsStSocket;
49 -#ifdef SRS_AUTO_HTTP_CALLBACK  
50 class SrsHttpHooks; 49 class SrsHttpHooks;
51 -#endif  
52 class SrsBandwidth; 50 class SrsBandwidth;
53 class SrsKbps; 51 class SrsKbps;
54 class SrsRtmpClient; 52 class SrsRtmpClient;
@@ -493,15 +493,10 @@ SrsServer::SrsServer() @@ -493,15 +493,10 @@ SrsServer::SrsServer()
493 // donot new object in constructor, 493 // donot new object in constructor,
494 // for some global instance is not ready now, 494 // for some global instance is not ready now,
495 // new these objects in initialize instead. 495 // new these objects in initialize instead.
496 -#ifdef SRS_AUTO_HTTP_API  
497 http_api_mux = new SrsHttpServeMux(); 496 http_api_mux = new SrsHttpServeMux();
498 -#endif  
499 -#ifdef SRS_AUTO_HTTP_SERVER  
500 http_server = new SrsHttpServer(this); 497 http_server = new SrsHttpServer(this);
501 -#endif  
502 -#ifdef SRS_AUTO_HTTP_CORE  
503 http_heartbeat = NULL; 498 http_heartbeat = NULL;
504 -#endif 499 +
505 #ifdef SRS_AUTO_INGEST 500 #ifdef SRS_AUTO_INGEST
506 ingester = NULL; 501 ingester = NULL;
507 #endif 502 #endif
@@ -518,17 +513,9 @@ void SrsServer::destroy() @@ -518,17 +513,9 @@ void SrsServer::destroy()
518 513
519 dispose(); 514 dispose();
520 515
521 -#ifdef SRS_AUTO_HTTP_API  
522 srs_freep(http_api_mux); 516 srs_freep(http_api_mux);
523 -#endif  
524 -  
525 -#ifdef SRS_AUTO_HTTP_SERVER  
526 srs_freep(http_server); 517 srs_freep(http_server);
527 -#endif  
528 -  
529 -#ifdef SRS_AUTO_HTTP_CORE  
530 srs_freep(http_heartbeat); 518 srs_freep(http_heartbeat);
531 -#endif  
532 519
533 #ifdef SRS_AUTO_INGEST 520 #ifdef SRS_AUTO_INGEST
534 srs_freep(ingester); 521 srs_freep(ingester);
@@ -591,23 +578,15 @@ int SrsServer::initialize(ISrsServerCycle* cycle_handler) @@ -591,23 +578,15 @@ int SrsServer::initialize(ISrsServerCycle* cycle_handler)
591 return ret; 578 return ret;
592 } 579 }
593 580
594 -#ifdef SRS_AUTO_HTTP_API  
595 if ((ret = http_api_mux->initialize()) != ERROR_SUCCESS) { 581 if ((ret = http_api_mux->initialize()) != ERROR_SUCCESS) {
596 return ret; 582 return ret;
597 } 583 }
598 -#endif  
599 584
600 -#ifdef SRS_AUTO_HTTP_SERVER  
601 - srs_assert(http_server);  
602 if ((ret = http_server->initialize()) != ERROR_SUCCESS) { 585 if ((ret = http_server->initialize()) != ERROR_SUCCESS) {
603 return ret; 586 return ret;
604 } 587 }
605 -#endif  
606 588
607 -#ifdef SRS_AUTO_HTTP_CORE  
608 - srs_assert(!http_heartbeat);  
609 http_heartbeat = new SrsHttpHeartbeat(); 589 http_heartbeat = new SrsHttpHeartbeat();
610 -#endif  
611 590
612 #ifdef SRS_AUTO_INGEST 591 #ifdef SRS_AUTO_INGEST
613 srs_assert(!ingester); 592 srs_assert(!ingester);
@@ -779,7 +758,6 @@ int SrsServer::http_handle() @@ -779,7 +758,6 @@ int SrsServer::http_handle()
779 { 758 {
780 int ret = ERROR_SUCCESS; 759 int ret = ERROR_SUCCESS;
781 760
782 -#ifdef SRS_AUTO_HTTP_API  
783 srs_assert(http_api_mux); 761 srs_assert(http_api_mux);
784 if ((ret = http_api_mux->handle("/", new SrsHttpNotFoundHandler())) != ERROR_SUCCESS) { 762 if ((ret = http_api_mux->handle("/", new SrsHttpNotFoundHandler())) != ERROR_SUCCESS) {
785 return ret; 763 return ret;
@@ -852,7 +830,6 @@ int SrsServer::http_handle() @@ -852,7 +830,6 @@ int SrsServer::http_handle()
852 return ret; 830 return ret;
853 } 831 }
854 srs_trace("http: api mount /console to %s", dir.c_str()); 832 srs_trace("http: api mount /console to %s", dir.c_str());
855 -#endif  
856 833
857 return ret; 834 return ret;
858 } 835 }
@@ -1075,14 +1052,12 @@ int SrsServer::do_cycle() @@ -1075,14 +1052,12 @@ int SrsServer::do_cycle()
1075 srs_info("update network server kbps info."); 1052 srs_info("update network server kbps info.");
1076 resample_kbps(); 1053 resample_kbps();
1077 } 1054 }
1078 - #ifdef SRS_AUTO_HTTP_CORE  
1079 if (_srs_config->get_heartbeat_enabled()) { 1055 if (_srs_config->get_heartbeat_enabled()) {
1080 if ((i % heartbeat_max_resolution) == 0) { 1056 if ((i % heartbeat_max_resolution) == 0) {
1081 srs_info("do http heartbeat, for internal server to report."); 1057 srs_info("do http heartbeat, for internal server to report.");
1082 http_heartbeat->heartbeat(); 1058 http_heartbeat->heartbeat();
1083 } 1059 }
1084 } 1060 }
1085 - #endif  
1086 #endif 1061 #endif
1087 1062
1088 srs_info("server main thread loop"); 1063 srs_info("server main thread loop");
@@ -1123,7 +1098,6 @@ int SrsServer::listen_http_api() @@ -1123,7 +1098,6 @@ int SrsServer::listen_http_api()
1123 { 1098 {
1124 int ret = ERROR_SUCCESS; 1099 int ret = ERROR_SUCCESS;
1125 1100
1126 -#ifdef SRS_AUTO_HTTP_API  
1127 close_listeners(SrsListenerHttpApi); 1101 close_listeners(SrsListenerHttpApi);
1128 if (_srs_config->get_http_api_enabled()) { 1102 if (_srs_config->get_http_api_enabled()) {
1129 SrsListener* listener = new SrsBufferListener(this, SrsListenerHttpApi); 1103 SrsListener* listener = new SrsBufferListener(this, SrsListenerHttpApi);
@@ -1140,7 +1114,6 @@ int SrsServer::listen_http_api() @@ -1140,7 +1114,6 @@ int SrsServer::listen_http_api()
1140 return ret; 1114 return ret;
1141 } 1115 }
1142 } 1116 }
1143 -#endif  
1144 1117
1145 return ret; 1118 return ret;
1146 } 1119 }
@@ -1149,7 +1122,6 @@ int SrsServer::listen_http_stream() @@ -1149,7 +1122,6 @@ int SrsServer::listen_http_stream()
1149 { 1122 {
1150 int ret = ERROR_SUCCESS; 1123 int ret = ERROR_SUCCESS;
1151 1124
1152 -#ifdef SRS_AUTO_HTTP_SERVER  
1153 close_listeners(SrsListenerHttpStream); 1125 close_listeners(SrsListenerHttpStream);
1154 if (_srs_config->get_http_stream_enabled()) { 1126 if (_srs_config->get_http_stream_enabled()) {
1155 SrsListener* listener = new SrsBufferListener(this, SrsListenerHttpStream); 1127 SrsListener* listener = new SrsBufferListener(this, SrsListenerHttpStream);
@@ -1166,7 +1138,6 @@ int SrsServer::listen_http_stream() @@ -1166,7 +1138,6 @@ int SrsServer::listen_http_stream()
1166 return ret; 1138 return ret;
1167 } 1139 }
1168 } 1140 }
1169 -#endif  
1170 1141
1171 return ret; 1142 return ret;
1172 } 1143 }
@@ -1329,30 +1300,15 @@ SrsConnection* SrsServer::fd2conn(SrsListenerType type, st_netfd_t stfd) @@ -1329,30 +1300,15 @@ SrsConnection* SrsServer::fd2conn(SrsListenerType type, st_netfd_t stfd)
1329 } 1300 }
1330 1301
1331 SrsConnection* conn = NULL; 1302 SrsConnection* conn = NULL;
1332 - bool close_for_not_served = false;  
1333 1303
1334 if (type == SrsListenerRtmpStream) { 1304 if (type == SrsListenerRtmpStream) {
1335 conn = new SrsRtmpConn(this, stfd, ip); 1305 conn = new SrsRtmpConn(this, stfd, ip);
1336 } else if (type == SrsListenerHttpApi) { 1306 } else if (type == SrsListenerHttpApi) {
1337 -#ifdef SRS_AUTO_HTTP_API  
1338 conn = new SrsHttpApi(this, stfd, http_api_mux, ip); 1307 conn = new SrsHttpApi(this, stfd, http_api_mux, ip);
1339 -#else  
1340 - srs_warn("close http client for server not support http-api");  
1341 - close_for_not_served = true;  
1342 -#endif  
1343 } else if (type == SrsListenerHttpStream) { 1308 } else if (type == SrsListenerHttpStream) {
1344 -#ifdef SRS_AUTO_HTTP_SERVER  
1345 conn = new SrsResponseOnlyHttpConn(this, stfd, http_server, ip); 1309 conn = new SrsResponseOnlyHttpConn(this, stfd, http_server, ip);
1346 -#else  
1347 - srs_warn("close http client for server not support http-server");  
1348 - close_for_not_served = true;  
1349 -#endif  
1350 } else { 1310 } else {
1351 - // TODO: FIXME: handler others  
1352 - srs_assert(false);  
1353 - }  
1354 -  
1355 - if (close_for_not_served) { 1311 + srs_warn("close for no service handler. fd=%d, ip=%s", fd, ip.c_str());
1356 srs_close_stfd(stfd); 1312 srs_close_stfd(stfd);
1357 return NULL; 1313 return NULL;
1358 } 1314 }
@@ -1402,7 +1358,6 @@ int SrsServer::on_reload_vhost_added(std::string vhost) @@ -1402,7 +1358,6 @@ int SrsServer::on_reload_vhost_added(std::string vhost)
1402 { 1358 {
1403 int ret = ERROR_SUCCESS; 1359 int ret = ERROR_SUCCESS;
1404 1360
1405 -#ifdef SRS_AUTO_HTTP_SERVER  
1406 if (!_srs_config->get_vhost_http_enabled(vhost)) { 1361 if (!_srs_config->get_vhost_http_enabled(vhost)) {
1407 return ret; 1362 return ret;
1408 } 1363 }
@@ -1411,7 +1366,6 @@ int SrsServer::on_reload_vhost_added(std::string vhost) @@ -1411,7 +1366,6 @@ int SrsServer::on_reload_vhost_added(std::string vhost)
1411 if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { 1366 if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
1412 return ret; 1367 return ret;
1413 } 1368 }
1414 -#endif  
1415 1369
1416 return ret; 1370 return ret;
1417 } 1371 }
@@ -1420,58 +1374,34 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/) @@ -1420,58 +1374,34 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/)
1420 { 1374 {
1421 int ret = ERROR_SUCCESS; 1375 int ret = ERROR_SUCCESS;
1422 1376
1423 -#ifdef SRS_AUTO_HTTP_SERVER  
1424 // TODO: FIXME: should handle the event in SrsHttpStaticServer 1377 // TODO: FIXME: should handle the event in SrsHttpStaticServer
1425 if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { 1378 if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
1426 return ret; 1379 return ret;
1427 } 1380 }
1428 -#endif  
1429 1381
1430 return ret; 1382 return ret;
1431 } 1383 }
1432 1384
1433 int SrsServer::on_reload_http_api_enabled() 1385 int SrsServer::on_reload_http_api_enabled()
1434 { 1386 {
1435 - int ret = ERROR_SUCCESS;  
1436 -  
1437 -#ifdef SRS_AUTO_HTTP_API  
1438 - ret = listen_http_api();  
1439 -#endif  
1440 -  
1441 - return ret; 1387 + return listen_http_api();
1442 } 1388 }
1443 1389
1444 int SrsServer::on_reload_http_api_disabled() 1390 int SrsServer::on_reload_http_api_disabled()
1445 { 1391 {
1446 - int ret = ERROR_SUCCESS;  
1447 -  
1448 -#ifdef SRS_AUTO_HTTP_API  
1449 close_listeners(SrsListenerHttpApi); 1392 close_listeners(SrsListenerHttpApi);
1450 -#endif  
1451 -  
1452 - return ret; 1393 + return ERROR_SUCCESS;
1453 } 1394 }
1454 1395
1455 int SrsServer::on_reload_http_stream_enabled() 1396 int SrsServer::on_reload_http_stream_enabled()
1456 { 1397 {
1457 - int ret = ERROR_SUCCESS;  
1458 -  
1459 -#ifdef SRS_AUTO_HTTP_SERVER  
1460 - ret = listen_http_stream();  
1461 -#endif  
1462 -  
1463 - return ret; 1398 + return listen_http_stream();
1464 } 1399 }
1465 1400
1466 int SrsServer::on_reload_http_stream_disabled() 1401 int SrsServer::on_reload_http_stream_disabled()
1467 { 1402 {
1468 - int ret = ERROR_SUCCESS;  
1469 -  
1470 -#ifdef SRS_AUTO_HTTP_SERVER  
1471 close_listeners(SrsListenerHttpStream); 1403 close_listeners(SrsListenerHttpStream);
1472 -#endif  
1473 -  
1474 - return ret; 1404 + return ERROR_SUCCESS;
1475 } 1405 }
1476 1406
1477 // TODO: FIXME: rename to http_remux 1407 // TODO: FIXME: rename to http_remux
@@ -1479,7 +1409,6 @@ int SrsServer::on_reload_http_stream_updated() @@ -1479,7 +1409,6 @@ int SrsServer::on_reload_http_stream_updated()
1479 { 1409 {
1480 int ret = ERROR_SUCCESS; 1410 int ret = ERROR_SUCCESS;
1481 1411
1482 -#ifdef SRS_AUTO_HTTP_SERVER  
1483 if ((ret = on_reload_http_stream_enabled()) != ERROR_SUCCESS) { 1412 if ((ret = on_reload_http_stream_enabled()) != ERROR_SUCCESS) {
1484 return ret; 1413 return ret;
1485 } 1414 }
@@ -1488,7 +1417,6 @@ int SrsServer::on_reload_http_stream_updated() @@ -1488,7 +1417,6 @@ int SrsServer::on_reload_http_stream_updated()
1488 if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { 1417 if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
1489 return ret; 1418 return ret;
1490 } 1419 }
1491 -#endif  
1492 1420
1493 return ret; 1421 return ret;
1494 } 1422 }
@@ -1497,19 +1425,15 @@ int SrsServer::on_publish(SrsSource* s, SrsRequest* r) @@ -1497,19 +1425,15 @@ int SrsServer::on_publish(SrsSource* s, SrsRequest* r)
1497 { 1425 {
1498 int ret = ERROR_SUCCESS; 1426 int ret = ERROR_SUCCESS;
1499 1427
1500 -#ifdef SRS_AUTO_HTTP_SERVER  
1501 if ((ret = http_server->http_mount(s, r)) != ERROR_SUCCESS) { 1428 if ((ret = http_server->http_mount(s, r)) != ERROR_SUCCESS) {
1502 return ret; 1429 return ret;
1503 } 1430 }
1504 -#endif  
1505 1431
1506 return ret; 1432 return ret;
1507 } 1433 }
1508 1434
1509 void SrsServer::on_unpublish(SrsSource* s, SrsRequest* r) 1435 void SrsServer::on_unpublish(SrsSource* s, SrsRequest* r)
1510 { 1436 {
1511 -#ifdef SRS_AUTO_HTTP_SERVER  
1512 http_server->http_unmount(s, r); 1437 http_server->http_unmount(s, r);
1513 -#endif  
1514 } 1438 }
1515 1439
@@ -241,16 +241,10 @@ class SrsServer : virtual public ISrsReloadHandler @@ -241,16 +241,10 @@ class SrsServer : virtual public ISrsReloadHandler
241 , virtual public IConnectionManager 241 , virtual public IConnectionManager
242 { 242 {
243 private: 243 private:
244 -#ifdef SRS_AUTO_HTTP_API  
245 // TODO: FIXME: rename to http_api 244 // TODO: FIXME: rename to http_api
246 SrsHttpServeMux* http_api_mux; 245 SrsHttpServeMux* http_api_mux;
247 -#endif  
248 -#ifdef SRS_AUTO_HTTP_SERVER  
249 SrsHttpServer* http_server; 246 SrsHttpServer* http_server;
250 -#endif  
251 -#ifdef SRS_AUTO_HTTP_CORE  
252 SrsHttpHeartbeat* http_heartbeat; 247 SrsHttpHeartbeat* http_heartbeat;
253 -#endif  
254 #ifdef SRS_AUTO_INGEST 248 #ifdef SRS_AUTO_INGEST
255 SrsIngester* ingester; 249 SrsIngester* ingester;
256 #endif 250 #endif
@@ -59,8 +59,6 @@ ISrsThreadContext* _srs_context = new ISrsThreadContext(); @@ -59,8 +59,6 @@ ISrsThreadContext* _srs_context = new ISrsThreadContext();
59 // @global config object for app module. 59 // @global config object for app module.
60 SrsConfig* _srs_config = NULL; 60 SrsConfig* _srs_config = NULL;
61 61
62 -#if defined(SRS_AUTO_HTTP_CORE)  
63 -  
64 /** 62 /**
65 * main entrance. 63 * main entrance.
66 */ 64 */
@@ -70,11 +68,6 @@ int main(int argc, char** argv) @@ -70,11 +68,6 @@ int main(int argc, char** argv)
70 srs_assert(srs_is_little_endian()); 68 srs_assert(srs_is_little_endian());
71 69
72 // directly failed when compile limited. 70 // directly failed when compile limited.
73 -#if !defined(SRS_AUTO_HTTP_CORE)  
74 - srs_error("depends on http-parser.");  
75 - exit(-1);  
76 -#endif  
77 -  
78 #if defined(SRS_AUTO_GPERF_MP) || defined(SRS_AUTO_GPERF_MP) \ 71 #if defined(SRS_AUTO_GPERF_MP) || defined(SRS_AUTO_GPERF_MP) \
79 || defined(SRS_AUTO_GPERF_MC) || defined(SRS_AUTO_GPERF_MP) 72 || defined(SRS_AUTO_GPERF_MC) || defined(SRS_AUTO_GPERF_MP)
80 srs_error("donot support gmc/gmp/gcp/gprof"); 73 srs_error("donot support gmc/gmp/gcp/gprof");
@@ -1326,15 +1319,3 @@ int proxy_hls2rtmp(string hls, string rtmp) @@ -1326,15 +1319,3 @@ int proxy_hls2rtmp(string hls, string rtmp)
1326 return ret; 1319 return ret;
1327 } 1320 }
1328 1321
1329 -#else  
1330 -  
1331 -int main(int argc, char** argv)  
1332 -{  
1333 -#ifndef SRS_AUTO_HTTP_CORE  
1334 - srs_error("ingest requires http-api or http-server");  
1335 -#endif  
1336 - return -1;  
1337 -}  
1338 -  
1339 -#endif  
1340 -