mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix bug of configure.
This commit is contained in:
parent
eb488e3bde
commit
fec8422d6b
16 changed files with 70 additions and 67 deletions
|
@ -76,10 +76,10 @@ fi
|
||||||
echo "" >> $SRS_AUTO_HEADERS_H
|
echo "" >> $SRS_AUTO_HEADERS_H
|
||||||
|
|
||||||
# auto headers in depends.
|
# auto headers in depends.
|
||||||
if [ $SRS_HTTP_PARSER = YES ]; then
|
if [ $SRS_HTTP_CORE = YES ]; then
|
||||||
echo "#define SRS_AUTO_HTTP_PARSER" >> $SRS_AUTO_HEADERS_H
|
echo "#define SRS_AUTO_HTTP_CORE" >> $SRS_AUTO_HEADERS_H
|
||||||
else
|
else
|
||||||
echo "#undef SRS_AUTO_HTTP_PARSER" >> $SRS_AUTO_HEADERS_H
|
echo "#undef SRS_AUTO_HTTP_CORE" >> $SRS_AUTO_HEADERS_H
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $SRS_HTTP_SERVER = YES ]; then
|
if [ $SRS_HTTP_SERVER = YES ]; then
|
||||||
|
|
|
@ -426,7 +426,7 @@ fi
|
||||||
# http-parser-2.1
|
# http-parser-2.1
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
# check the arm flag file, if flag changed, need to rebuild the st.
|
# check the arm flag file, if flag changed, need to rebuild the st.
|
||||||
if [ $SRS_HTTP_PARSER = YES ]; then
|
if [ $SRS_HTTP_CORE = YES ]; then
|
||||||
# ok, arm specified, if the flag filed does not exists, need to rebuild.
|
# ok, arm specified, if the flag filed does not exists, need to rebuild.
|
||||||
if [ $SRS_EMBEDED_CPU = YES ]; then
|
if [ $SRS_EMBEDED_CPU = YES ]; then
|
||||||
if [[ -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then
|
if [[ -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then
|
||||||
|
|
|
@ -45,7 +45,7 @@ SRS_GPROF=RESERVED
|
||||||
################################################################
|
################################################################
|
||||||
# libraries
|
# libraries
|
||||||
SRS_FFMPEG_STUB=RESERVED
|
SRS_FFMPEG_STUB=RESERVED
|
||||||
SRS_HTTP_PARSER=RESERVED
|
SRS_HTTP_CORE=RESERVED
|
||||||
# arguments
|
# arguments
|
||||||
SRS_PREFIX=/usr/local/srs
|
SRS_PREFIX=/usr/local/srs
|
||||||
SRS_JOBS=1
|
SRS_JOBS=1
|
||||||
|
@ -376,7 +376,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=NO
|
SRS_TRANSCODE=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_HTTP_PARSER=NO
|
SRS_HTTP_CORE=NO
|
||||||
SRS_HTTP_CALLBACK=NO
|
SRS_HTTP_CALLBACK=NO
|
||||||
SRS_HTTP_SERVER=NO
|
SRS_HTTP_SERVER=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -403,7 +403,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=YES
|
SRS_STREAM_CASTER=YES
|
||||||
|
@ -430,7 +430,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=NO
|
SRS_TRANSCODE=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_HTTP_PARSER=NO
|
SRS_HTTP_CORE=NO
|
||||||
SRS_HTTP_CALLBACK=NO
|
SRS_HTTP_CALLBACK=NO
|
||||||
SRS_HTTP_SERVER=NO
|
SRS_HTTP_SERVER=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -457,7 +457,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=NO
|
SRS_TRANSCODE=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_HTTP_PARSER=NO
|
SRS_HTTP_CORE=NO
|
||||||
SRS_HTTP_CALLBACK=NO
|
SRS_HTTP_CALLBACK=NO
|
||||||
SRS_HTTP_SERVER=NO
|
SRS_HTTP_SERVER=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -484,7 +484,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=NO
|
SRS_TRANSCODE=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_HTTP_PARSER=NO
|
SRS_HTTP_CORE=NO
|
||||||
SRS_HTTP_CALLBACK=NO
|
SRS_HTTP_CALLBACK=NO
|
||||||
SRS_HTTP_SERVER=NO
|
SRS_HTTP_SERVER=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -511,7 +511,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -539,7 +539,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -566,7 +566,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -593,7 +593,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -620,7 +620,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -647,7 +647,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -674,7 +674,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -701,7 +701,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -728,7 +728,7 @@ function apply_user_presets() {
|
||||||
SRS_TRANSCODE=YES
|
SRS_TRANSCODE=YES
|
||||||
SRS_INGEST=YES
|
SRS_INGEST=YES
|
||||||
SRS_STAT=YES
|
SRS_STAT=YES
|
||||||
SRS_HTTP_PARSER=YES
|
SRS_HTTP_CORE=YES
|
||||||
SRS_HTTP_CALLBACK=YES
|
SRS_HTTP_CALLBACK=YES
|
||||||
SRS_HTTP_SERVER=YES
|
SRS_HTTP_SERVER=YES
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -761,11 +761,11 @@ function apply_user_detail_options() {
|
||||||
if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi
|
if [ $SRS_TRANSCODE = YES ]; then SRS_FFMPEG_STUB=YES; fi
|
||||||
if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi
|
if [ $SRS_INGEST = YES ]; then SRS_FFMPEG_STUB=YES; fi
|
||||||
|
|
||||||
# if http-xxxx specified, open the SRS_HTTP_PARSER
|
# if http-xxxx specified, open the SRS_HTTP_CORE
|
||||||
SRS_HTTP_PARSER=NO
|
SRS_HTTP_CORE=NO
|
||||||
if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_PARSER=YES; fi
|
if [ $SRS_HTTP_CALLBACK = YES ]; then SRS_HTTP_CORE=YES; fi
|
||||||
if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_PARSER=YES; fi
|
if [ $SRS_HTTP_SERVER = YES ]; then SRS_HTTP_CORE=YES; fi
|
||||||
if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_PARSER=YES; fi
|
if [ $SRS_HTTP_API = YES ]; then SRS_HTTP_CORE=YES; fi
|
||||||
|
|
||||||
# parse the jobs for make
|
# parse the jobs for make
|
||||||
if [[ "" -eq SRS_JOBS ]]; then
|
if [[ "" -eq SRS_JOBS ]]; then
|
||||||
|
@ -790,7 +790,7 @@ function apply_user_detail_options() {
|
||||||
SRS_TRANSCODE=NO
|
SRS_TRANSCODE=NO
|
||||||
SRS_INGEST=NO
|
SRS_INGEST=NO
|
||||||
SRS_STAT=NO
|
SRS_STAT=NO
|
||||||
SRS_HTTP_PARSER=NO
|
SRS_HTTP_CORE=NO
|
||||||
SRS_HTTP_CALLBACK=NO
|
SRS_HTTP_CALLBACK=NO
|
||||||
SRS_HTTP_SERVER=NO
|
SRS_HTTP_SERVER=NO
|
||||||
SRS_STREAM_CASTER=NO
|
SRS_STREAM_CASTER=NO
|
||||||
|
@ -855,13 +855,14 @@ function check_option_conflicts() {
|
||||||
if [ $SRS_GPERF_MP = YES ]; then echo "gperf-mp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
|
if [ $SRS_GPERF_MP = YES ]; then echo "gperf-mp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
|
||||||
if [ $SRS_GPERF_CP = YES ]; then echo "gperf-cp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
|
if [ $SRS_GPERF_CP = YES ]; then echo "gperf-cp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
|
||||||
fi
|
fi
|
||||||
if [ $SRS_GPERF_MC = YES ]; then
|
if [[ $SRS_GPERF_MC = YES && $SRS_GPERF_MP = YES ]]; then
|
||||||
if [ $SRS_GPERF_MP = YES ]; then
|
echo "gperf-mc not compatible with gperf-mp, see: ./configure --help";
|
||||||
echo "gperf-mc not compatible with gperf-mp, see: ./configure --help";
|
echo "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html";
|
||||||
echo "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html";
|
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";
|
||||||
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";
|
__check_ok=NO
|
||||||
__check_ok=NO
|
fi
|
||||||
fi
|
if [[ $SRS_HTTP_CORE = NO && $SRS_STREAM_CASTER = YES ]]; then
|
||||||
|
echo "stream-caster depends on http-api or http-server, see: ./configure --help"; __check_ok=NO;
|
||||||
fi
|
fi
|
||||||
# generate the group option: SRS_GPERF
|
# generate the group option: SRS_GPERF
|
||||||
__gperf_slow=NO
|
__gperf_slow=NO
|
||||||
|
@ -885,10 +886,8 @@ function check_option_conflicts() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if x86/x64 or directly build, never use static
|
# if x86/x64 or directly build, never use static
|
||||||
if [ $SRS_X86_X64 = YES ]; then
|
if [[ $SRS_X86_X64 = YES && $SRS_STATIC = YES ]]; then
|
||||||
if [ $SRS_STATIC = YES ]; then
|
echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO;
|
||||||
echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO;
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: FIXME: check more os.
|
# TODO: FIXME: check more os.
|
||||||
|
|
2
trunk/configure
vendored
2
trunk/configure
vendored
|
@ -115,7 +115,7 @@ END
|
||||||
LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
|
LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
|
||||||
# hp(http-parser) the http request/url parser, for SRS to support HTTP callback.
|
# hp(http-parser) the http request/url parser, for SRS to support HTTP callback.
|
||||||
LibHttpParserRoot=""; LibHttpParserfile=""
|
LibHttpParserRoot=""; LibHttpParserfile=""
|
||||||
if [ $SRS_HTTP_PARSER = YES ]; then LibHttpParserRoot="${SRS_OBJS_DIR}/hp"; LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a"; fi
|
if [ $SRS_HTTP_CORE = YES ]; then LibHttpParserRoot="${SRS_OBJS_DIR}/hp"; LibHttpParserfile="${LibHttpParserRoot}/libhttp_parser.a"; fi
|
||||||
# openssl-1.0.1f, for the RTMP complex handshake.
|
# openssl-1.0.1f, for the RTMP complex handshake.
|
||||||
LibSSLRoot="";LibSSLfile=""
|
LibSSLRoot="";LibSSLfile=""
|
||||||
if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = NO ]; then LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a"; fi fi
|
if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = NO ]; then LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a"; fi fi
|
||||||
|
|
|
@ -33,7 +33,6 @@ using namespace std;
|
||||||
#include <srs_kernel_log.hpp>
|
#include <srs_kernel_log.hpp>
|
||||||
#include <srs_app_config.hpp>
|
#include <srs_app_config.hpp>
|
||||||
#include <srs_app_pithy_print.hpp>
|
#include <srs_app_pithy_print.hpp>
|
||||||
#include <srs_app_http.hpp>
|
|
||||||
#include <srs_app_http_conn.hpp>
|
#include <srs_app_http_conn.hpp>
|
||||||
#include <srs_core_autofree.hpp>
|
#include <srs_core_autofree.hpp>
|
||||||
#include <srs_kernel_flv.hpp>
|
#include <srs_kernel_flv.hpp>
|
||||||
|
@ -89,9 +88,10 @@ void SrsAppCasterFlv::remove(SrsConnection* c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, SrsHttpMessage* r)
|
int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||||
{
|
{
|
||||||
SrsDynamicHttpConn* conn = dynamic_cast<SrsDynamicHttpConn*>(r->connection());
|
SrsHttpMessage* msg = dynamic_cast<SrsHttpMessage*>(r);
|
||||||
|
SrsDynamicHttpConn* conn = dynamic_cast<SrsDynamicHttpConn*>(msg->connection());
|
||||||
srs_assert(conn);
|
srs_assert(conn);
|
||||||
|
|
||||||
std::string app = srs_path_dirname(r->path());
|
std::string app = srs_path_dirname(r->path());
|
||||||
|
@ -134,13 +134,13 @@ SrsDynamicHttpConn::~SrsDynamicHttpConn()
|
||||||
srs_freep(pprint);
|
srs_freep(pprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsDynamicHttpConn::on_got_http_message(SrsHttpMessage* msg)
|
int SrsDynamicHttpConn::on_got_http_message(ISrsHttpMessage* msg)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std::string o)
|
int SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter* w, ISrsHttpMessage* r, std::string o)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ int SrsHttpFileReader::read(void* buf, size_t count, ssize_t* pnread)
|
||||||
}
|
}
|
||||||
|
|
||||||
int total_read = 0;
|
int total_read = 0;
|
||||||
while (total_read < count) {
|
while (total_read < (int)count) {
|
||||||
int nread = 0;
|
int nread = 0;
|
||||||
if ((ret = http->read((char*)buf + total_read, (int)(count - total_read), &nread)) != ERROR_SUCCESS) {
|
if ((ret = http->read((char*)buf + total_read, (int)(count - total_read), &nread)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -37,7 +37,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
class SrsConfDirective;
|
class SrsConfDirective;
|
||||||
class SrsHttpServeMux;
|
class SrsHttpServeMux;
|
||||||
class SrsHttpConn;
|
|
||||||
class SrsRtmpClient;
|
class SrsRtmpClient;
|
||||||
class SrsStSocket;
|
class SrsStSocket;
|
||||||
class SrsRequest;
|
class SrsRequest;
|
||||||
|
@ -48,7 +47,6 @@ class SrsFlvDecoder;
|
||||||
#include <srs_app_st.hpp>
|
#include <srs_app_st.hpp>
|
||||||
#include <srs_app_listener.hpp>
|
#include <srs_app_listener.hpp>
|
||||||
#include <srs_app_conn.hpp>
|
#include <srs_app_conn.hpp>
|
||||||
#include <srs_app_http.hpp>
|
|
||||||
#include <srs_app_http_conn.hpp>
|
#include <srs_app_http_conn.hpp>
|
||||||
#include <srs_kernel_file.hpp>
|
#include <srs_kernel_file.hpp>
|
||||||
|
|
||||||
|
@ -75,7 +73,7 @@ public:
|
||||||
virtual void remove(SrsConnection* c);
|
virtual void remove(SrsConnection* c);
|
||||||
// ISrsHttpHandler
|
// ISrsHttpHandler
|
||||||
public:
|
public:
|
||||||
virtual int serve_http(ISrsHttpResponseWriter* w, SrsHttpMessage* r);
|
virtual int serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,9 +94,9 @@ public:
|
||||||
SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m);
|
SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m);
|
||||||
virtual ~SrsDynamicHttpConn();
|
virtual ~SrsDynamicHttpConn();
|
||||||
public:
|
public:
|
||||||
virtual int on_got_http_message(SrsHttpMessage* msg);
|
virtual int on_got_http_message(ISrsHttpMessage* msg);
|
||||||
public:
|
public:
|
||||||
virtual int proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std::string o);
|
virtual int proxy(ISrsHttpResponseWriter* w, ISrsHttpMessage* r, std::string o);
|
||||||
private:
|
private:
|
||||||
virtual int do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec);
|
virtual int do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec);
|
||||||
virtual int rtmp_write_packet(char type, u_int32_t timestamp, char* data, int size);
|
virtual int rtmp_write_packet(char type, u_int32_t timestamp, char* data, int size);
|
||||||
|
|
|
@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <srs_app_heartbeat.hpp>
|
#include <srs_app_heartbeat.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
|
@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <srs_core.hpp>
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the http heartbeat to api-server to notice api
|
* the http heartbeat to api-server to notice api
|
||||||
|
|
|
@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <srs_app_http_client.hpp>
|
#include <srs_app_http_client.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
#include <srs_app_st.hpp>
|
#include <srs_app_st.hpp>
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <srs_app_http_conn.hpp>
|
#include <srs_app_http_conn.hpp>
|
||||||
|
|
||||||
#if defined(SRS_AUTO_HTTP_PARSER) || defined(SRS_AUTO_HTTP_SERVER)
|
#if defined(SRS_AUTO_HTTP_CORE) || defined(SRS_AUTO_HTTP_SERVER)
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -55,7 +55,7 @@ using namespace std;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)
|
SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)
|
||||||
{
|
{
|
||||||
|
@ -2423,6 +2423,9 @@ int SrsHttpServer::initialize_hls_streaming()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
SrsHttpConn::SrsHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m)
|
SrsHttpConn::SrsHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m)
|
||||||
: SrsConnection(cm, fd)
|
: SrsConnection(cm, fd)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,11 +30,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <srs_core.hpp>
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
#include <http_parser.h>
|
#include <http_parser.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SRS_AUTO_HTTP_PARSER) || defined(SRS_AUTO_HTTP_SERVER)
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -69,7 +69,7 @@ class SrsHttpMessage;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
|
|
||||||
// the http chunked header size,
|
// the http chunked header size,
|
||||||
// for writev, there always one chunk to send it.
|
// for writev, there always one chunk to send it.
|
||||||
|
@ -214,7 +214,7 @@ public:
|
||||||
virtual int update(std::string url, http_parser* header,
|
virtual int update(std::string url, http_parser* header,
|
||||||
SrsFastBuffer* body, std::vector<SrsHttpHeaderField>& headers
|
SrsFastBuffer* body, std::vector<SrsHttpHeaderField>& headers
|
||||||
);
|
);
|
||||||
private:
|
public:
|
||||||
virtual SrsConnection* connection();
|
virtual SrsConnection* connection();
|
||||||
public:
|
public:
|
||||||
virtual u_int8_t method();
|
virtual u_int8_t method();
|
||||||
|
@ -711,6 +711,9 @@ private:
|
||||||
virtual int initialize_hls_streaming();
|
virtual int initialize_hls_streaming();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
class SrsHttpConn : public SrsConnection
|
class SrsHttpConn : public SrsConnection
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -495,7 +495,7 @@ SrsServer::SrsServer()
|
||||||
#ifdef SRS_AUTO_HTTP_SERVER
|
#ifdef SRS_AUTO_HTTP_SERVER
|
||||||
http_stream_mux = new SrsHttpServer(this);
|
http_stream_mux = new SrsHttpServer(this);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
http_heartbeat = NULL;
|
http_heartbeat = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_AUTO_INGEST
|
#ifdef SRS_AUTO_INGEST
|
||||||
|
@ -530,7 +530,7 @@ void SrsServer::destroy()
|
||||||
srs_freep(http_stream_mux);
|
srs_freep(http_stream_mux);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
srs_freep(http_heartbeat);
|
srs_freep(http_heartbeat);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -589,7 +589,7 @@ int SrsServer::initialize(ISrsServerCycle* cycle_handler)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
srs_assert(!http_heartbeat);
|
srs_assert(!http_heartbeat);
|
||||||
http_heartbeat = new SrsHttpHeartbeat();
|
http_heartbeat = new SrsHttpHeartbeat();
|
||||||
#endif
|
#endif
|
||||||
|
@ -971,7 +971,7 @@ int SrsServer::do_cycle()
|
||||||
srs_info("update network server kbps info.");
|
srs_info("update network server kbps info.");
|
||||||
resample_kbps();
|
resample_kbps();
|
||||||
}
|
}
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
if (_srs_config->get_heartbeat_enabled()) {
|
if (_srs_config->get_heartbeat_enabled()) {
|
||||||
if ((i % heartbeat_max_resolution) == 0) {
|
if ((i % heartbeat_max_resolution) == 0) {
|
||||||
srs_info("do http heartbeat, for internal server to report.");
|
srs_info("do http heartbeat, for internal server to report.");
|
||||||
|
|
|
@ -240,7 +240,7 @@ private:
|
||||||
#ifdef SRS_AUTO_HTTP_SERVER
|
#ifdef SRS_AUTO_HTTP_SERVER
|
||||||
SrsHttpServer* http_stream_mux;
|
SrsHttpServer* http_stream_mux;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
SrsHttpHeartbeat* http_heartbeat;
|
SrsHttpHeartbeat* http_heartbeat;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SRS_AUTO_INGEST
|
#ifdef SRS_AUTO_INGEST
|
||||||
|
|
|
@ -61,7 +61,7 @@ ISrsThreadContext* _srs_context = new ISrsThreadContext();
|
||||||
SrsConfig* _srs_config = NULL;
|
SrsConfig* _srs_config = NULL;
|
||||||
SrsServer* _srs_server = NULL;
|
SrsServer* _srs_server = NULL;
|
||||||
|
|
||||||
#if defined(SRS_AUTO_HTTP_PARSER)
|
#if defined(SRS_AUTO_HTTP_CORE)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* main entrance.
|
* main entrance.
|
||||||
|
@ -72,7 +72,7 @@ int main(int argc, char** argv)
|
||||||
srs_assert(srs_is_little_endian());
|
srs_assert(srs_is_little_endian());
|
||||||
|
|
||||||
// directly failed when compile limited.
|
// directly failed when compile limited.
|
||||||
#if !defined(SRS_AUTO_HTTP_PARSER)
|
#if !defined(SRS_AUTO_HTTP_CORE)
|
||||||
srs_error("depends on http-parser.");
|
srs_error("depends on http-parser.");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1408,7 +1408,7 @@ int proxy_hls2rtmp(string hls, string rtmp)
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
#ifndef SRS_AUTO_HTTP_PARSER
|
#ifndef SRS_AUTO_HTTP_CORE
|
||||||
srs_error("ingest requires http-api or http-server");
|
srs_error("ingest requires http-api or http-server");
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -96,7 +96,7 @@ void show_macro_features()
|
||||||
srs_warn("check feature http server: off");
|
srs_warn("check feature http server: off");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HTTP_PARSER
|
#ifdef SRS_AUTO_HTTP_CORE
|
||||||
srs_trace("check feature http parser: on");
|
srs_trace("check feature http parser: on");
|
||||||
#else
|
#else
|
||||||
srs_warn("check feature http parser: off");
|
srs_warn("check feature http parser: off");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue