1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add --with-http-api option

This commit is contained in:
winlin 2014-04-01 16:06:32 +08:00
parent 52263457bf
commit 1922d62ff7
6 changed files with 121 additions and 81 deletions

View file

@ -23,6 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_api.hpp>
#ifdef SRS_HTTP_API
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
@ -47,3 +49,5 @@ int SrsHttpApi::do_cycle()
return ret;
}
#endif

View file

@ -30,6 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
#ifdef SRS_HTTP_API
#include <srs_app_st.hpp>
#include <srs_app_conn.hpp>
@ -43,3 +45,5 @@ protected:
};
#endif
#endif

View file

@ -438,7 +438,13 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
if (type == SrsListenerRtmpStream) {
conn = new SrsRtmpConn(this, client_stfd);
} else if (type == SrsListenerHttpApi) {
#ifdef SRS_HTTP_API
conn = new SrsHttpApi(this, client_stfd);
#else
srs_warn("close http client for server not support http-api");
srs_close_stfd(client_stfd);
return ret;
#endif
} else if (type == SrsListenerHttpStream) {
#ifdef SRS_HTTP_SERVER
conn = new SrsHttpConn(this, client_stfd);