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

merge from srs2.

This commit is contained in:
winlin 2015-12-11 11:35:56 +08:00
commit ffef3905af
5 changed files with 26 additions and 3 deletions

View file

@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <arpa/inet.h>
#include <signal.h>
#include <sys/wait.h>
#include <math.h>
#ifdef SRS_OSX
#include <sys/sysctl.h>
@ -47,6 +48,7 @@ using namespace std;
#include <srs_protocol_json.hpp>
#include <srs_kernel_buffer.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_kernel_utility.hpp>
// the longest time to wait for a process to quit.
#define SRS_PROCESS_QUIT_TIMEOUT_MS 1000
@ -1340,6 +1342,11 @@ string srs_get_peer_ip(int fd)
return ip;
}
bool srs_string_is_http(string url)
{
return srs_string_starts_with(url, "http://", "https://");
}
bool srs_is_digit_number(const string& str)
{
if (str.empty()) {