正在显示
5 个修改的文件
包含
19 行增加
和
0 行删除
| @@ -34,6 +34,7 @@ SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12 | @@ -34,6 +34,7 @@ SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12 | ||
| 34 | SRS_PREFIX=/usr/local/srs | 34 | SRS_PREFIX=/usr/local/srs |
| 35 | SRS_JOBS=1 | 35 | SRS_JOBS=1 |
| 36 | SRS_STATIC=RESERVED | 36 | SRS_STATIC=RESERVED |
| 37 | +SRS_HTTP_PARSER=NO | ||
| 37 | # private internal | 38 | # private internal |
| 38 | # dev, open all features for dev, no gperf/prof/arm. | 39 | # dev, open all features for dev, no gperf/prof/arm. |
| 39 | SRS_DEV=NO | 40 | SRS_DEV=NO |
| @@ -31,6 +31,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,6 +31,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | 31 | ||
| 32 | #include <srs_app_st.hpp> | 32 | #include <srs_app_st.hpp> |
| 33 | 33 | ||
| 34 | +#ifdef SRS_HTTP_PARSER | ||
| 35 | + | ||
| 34 | // http specification | 36 | // http specification |
| 35 | namespace srs | 37 | namespace srs |
| 36 | { | 38 | { |
| @@ -50,6 +52,8 @@ namespace srs | @@ -50,6 +52,8 @@ namespace srs | ||
| 50 | #define __CRLFCRLF "\r\n\r\n" // 0x0D0A0D0A | 52 | #define __CRLFCRLF "\r\n\r\n" // 0x0D0A0D0A |
| 51 | }; | 53 | }; |
| 52 | 54 | ||
| 55 | +#endif | ||
| 56 | + | ||
| 53 | #ifdef SRS_HTTP_CALLBACK | 57 | #ifdef SRS_HTTP_CALLBACK |
| 54 | 58 | ||
| 55 | class SrsRequest; | 59 | class SrsRequest; |
| @@ -23,6 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -23,6 +23,8 @@ 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 | +#ifdef SRS_HTTP_SERVER | ||
| 27 | + | ||
| 26 | #include <sstream> | 28 | #include <sstream> |
| 27 | using namespace std; | 29 | using namespace std; |
| 28 | 30 | ||
| @@ -254,3 +256,5 @@ int SrsHttpConn::on_body(http_parser* parser, const char* at, size_t length) | @@ -254,3 +256,5 @@ int SrsHttpConn::on_body(http_parser* parser, const char* at, size_t length) | ||
| 254 | 256 | ||
| 255 | return 0; | 257 | return 0; |
| 256 | } | 258 | } |
| 259 | + | ||
| 260 | +#endif |
| @@ -30,6 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -30,6 +30,8 @@ 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_HTTP_SERVER | ||
| 34 | + | ||
| 33 | #include <srs_app_st.hpp> | 35 | #include <srs_app_st.hpp> |
| 34 | #include <srs_app_conn.hpp> | 36 | #include <srs_app_conn.hpp> |
| 35 | 37 | ||
| @@ -82,3 +84,5 @@ private: | @@ -82,3 +84,5 @@ private: | ||
| 82 | }; | 84 | }; |
| 83 | 85 | ||
| 84 | #endif | 86 | #endif |
| 87 | + | ||
| 88 | +#endif |
| @@ -440,7 +440,13 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd) | @@ -440,7 +440,13 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd) | ||
| 440 | } else if (type == SrsListenerHttpApi) { | 440 | } else if (type == SrsListenerHttpApi) { |
| 441 | conn = new SrsHttpApi(this, client_stfd); | 441 | conn = new SrsHttpApi(this, client_stfd); |
| 442 | } else if (type == SrsListenerHttpStream) { | 442 | } else if (type == SrsListenerHttpStream) { |
| 443 | +#ifdef SRS_HTTP_SERVER | ||
| 443 | conn = new SrsHttpConn(this, client_stfd); | 444 | conn = new SrsHttpConn(this, client_stfd); |
| 445 | +#else | ||
| 446 | + srs_warn("close http client for server not support http-server"); | ||
| 447 | + srs_close_stfd(client_stfd); | ||
| 448 | + return ret; | ||
| 449 | +#endif | ||
| 444 | } else { | 450 | } else { |
| 445 | // TODO: FIXME: handler others | 451 | // TODO: FIXME: handler others |
| 446 | } | 452 | } |
-
请 注册 或 登录 后发表评论