git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5016 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4b36882d7e
commit
e031ff4a49
|
@ -1 +1 @@
|
|||
Fri Mar 16 17:21:00 EDT 2007
|
||||
Wed Apr 25 16:05:00 EDT 2007
|
||||
|
|
|
@ -634,7 +634,7 @@ abyss_bool ServerCreate(TServer *srv,
|
|||
|
||||
void ServerFree(TServer *srv);
|
||||
|
||||
void ServerInit(TServer *srv);
|
||||
int ServerInit(TServer *srv);
|
||||
void ServerRun(TServer *srv);
|
||||
void ServerRunOnce(TServer *srv);
|
||||
void ServerRunOnce2(TServer * const srv,
|
||||
|
|
|
@ -711,20 +711,30 @@ ServerFunc(TConn * c) {
|
|||
SocketClose(&(c->socket));
|
||||
}
|
||||
|
||||
void ServerInit(TServer *srv)
|
||||
int ServerInit(TServer *srv)
|
||||
{
|
||||
/********* Must check errors from these functions *************/
|
||||
if (!SocketInit())
|
||||
TraceExit("Can't initialize TCP sockets\n");;
|
||||
if (!SocketInit()) {
|
||||
TraceMsg("Can't initialize TCP sockets\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SocketCreate(&srv->listensock))
|
||||
TraceExit("Can't create a socket\n");;
|
||||
if (!SocketCreate(&srv->listensock)) {
|
||||
TraceMsg("Can't create a socket\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SocketBind(&srv->listensock,NULL,srv->port))
|
||||
TraceExit("Can't bind\n");
|
||||
if (!SocketBind(&srv->listensock,NULL,srv->port)) {
|
||||
TraceMsg("Can't bind\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SocketListen(&srv->listensock,MAX_CONN))
|
||||
TraceExit("Can't listen\n");
|
||||
if (!SocketListen(&srv->listensock,MAX_CONN)) {
|
||||
TraceMsg("Can't listen\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* With pthread configuration, our connections run as threads of a
|
||||
|
|
|
@ -63,5 +63,5 @@ void TraceExit(char *fmt,...)
|
|||
va_start(argptr,fmt);
|
||||
TraceVMsg(fmt,argptr);
|
||||
va_end(argptr);
|
||||
exit(1);
|
||||
abort();
|
||||
}
|
||||
|
|
|
@ -304,7 +304,11 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
|
|||
|
||||
xmlrpc_server_abyss_set_handler(&env, &abyssServer, "/RPC2", registryP);
|
||||
|
||||
ServerInit(&abyssServer);
|
||||
if (ServerInit(&abyssServer) != TRUE) {
|
||||
globals.running = 0;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
ServerAddHandler(&abyssServer, HandleHook);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Starting HTTP Port %d, DocRoot [%s]\n", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir);
|
||||
|
|
Loading…
Reference in New Issue