1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Default to port 8000

This commit is contained in:
Moritz Grimm 2015-05-22 00:19:00 +02:00
parent f7a700efe9
commit b8ea620f7a
3 changed files with 6 additions and 3 deletions

View File

@ -613,7 +613,7 @@ cfg_get_server_hostname(void)
unsigned int unsigned int
cfg_get_server_port(void) cfg_get_server_port(void)
{ {
return (cfg.server.port); return (cfg.server.port ? cfg.server.port : DEFAULT_PORT);
} }
const char * const char *

View File

@ -27,6 +27,7 @@
#define EXTENSIONS_MAX 16 #define EXTENSIONS_MAX 16
#define UCREDS_SIZE 256 #define UCREDS_SIZE 256
#define DEFAULT_PORT 8000
#define DEFAULT_USER "source" #define DEFAULT_USER "source"
struct cfg { struct cfg {

View File

@ -231,6 +231,8 @@ START_TEST(test_server_port)
{ {
const char *errstr2; const char *errstr2;
ck_assert_uint_eq(cfg_get_server_port(), DEFAULT_PORT);
TEST_EMPTYSTR(cfg_set_server_port, cfg_get_server_port); TEST_EMPTYSTR(cfg_set_server_port, cfg_get_server_port);
errstr2 = NULL; errstr2 = NULL;
@ -241,8 +243,8 @@ START_TEST(test_server_port)
ck_assert_int_eq(cfg_set_server_port("65536", &errstr2), -1); ck_assert_int_eq(cfg_set_server_port("65536", &errstr2), -1);
ck_assert_ptr_ne(errstr2, NULL); ck_assert_ptr_ne(errstr2, NULL);
ck_assert_int_eq(cfg_set_server_port("8000", NULL), 0); ck_assert_int_eq(cfg_set_server_port("8008", NULL), 0);
ck_assert_uint_eq(cfg_get_server_port(), 8000); ck_assert_uint_eq(cfg_get_server_port(), 8008);
} }
END_TEST END_TEST