[srvx-commits] CVS: services/src main.c,1.138,1.139 opserv.c,1.276,1.277
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-09-21 21:52:57
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv5903/src
Modified Files:
main.c opserv.c
Log Message:
Make some minor changes to OpServ's ?jump command.
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -r1.138 -r1.139
*** main.c 8 Sep 2002 04:28:38 -0000 1.138
--- main.c 21 Sep 2002 21:52:54 -0000 1.139
***************
*** 160,164 ****
}
! void uplink_compile(void)
{
const char *cycles;
--- 160,165 ----
}
! void
! uplink_compile(void)
{
const char *cycles;
***************
*** 210,214 ****
}
! int uplink_valid(char *name)
{
struct uplinkNode *uplink;
--- 211,216 ----
}
! struct uplinkNode *
! uplink_find(char *name)
{
struct uplinkNode *uplink;
***************
*** 216,234 ****
if(!cManager.enabled || !cManager.uplinks)
{
! return 0;
}
for(uplink = cManager.uplinks; uplink; uplink = uplink->next)
{
! if(!strcmp(uplink->name, name))
{
! return 1;
}
}
! return 0;
}
! void uplink_select(char *name)
{
struct uplinkNode *start, *uplink, *next;
--- 218,237 ----
if(!cManager.enabled || !cManager.uplinks)
{
! return NULL;
}
for(uplink = cManager.uplinks; uplink; uplink = uplink->next)
{
! if(!strcasecmp(uplink->name, name))
{
! return uplink;
}
}
! return NULL;
}
! void
! uplink_select(char *name)
{
struct uplinkNode *start, *uplink, *next;
***************
*** 320,324 ****
}
! int uplink_connect(void)
{
struct uplinkNode *uplink = cManager.uplink;
--- 323,328 ----
}
! int
! uplink_connect(void)
{
struct uplinkNode *uplink = cManager.uplink;
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.276
retrieving revision 1.277
diff -C2 -r1.276 -r1.277
*** opserv.c 16 Sep 2002 14:57:35 -0000 1.276
--- opserv.c 21 Sep 2002 21:52:54 -0000 1.277
***************
*** 228,233 ****
--- 228,235 ----
#define OSMSG_WARN_LISTEND "End of activity warning list."
#define OSMSG_INDEX_FORMAT "%-12s (%d)%c "
+ #define OSMSG_UPLINK_CONNECTING "Establishing connection with %s (%s:%d)."
#define OSMSG_CURRENT_UPLINK "$b%s$b is already the current uplink."
#define OSMSG_INVALID_UPLINK "$b%s$b is not a valid uplink name."
+ #define OSMSG_UPLINK_DISABLED "$b%s$b is a disabled or unavailable uplink."
#define OSMSG_STUPID_GLINE "Gline %s? Now $bthat$b would be smooth."
***************
*** 704,708 ****
extern struct cManagerNode cManager;
void uplink_select(char *name);
! int uplink_valid(char *name);
char *target;
--- 706,711 ----
extern struct cManagerNode cManager;
void uplink_select(char *name);
! struct uplinkNode *uplink_find(char *name);
! struct uplinkNode *uplink;
char *target;
***************
*** 712,724 ****
if(!strcmp(cManager.uplink->name, target))
{
! opserv_notice(user, OSMSG_CURRENT_UPLINK, cManager.uplink->name);
return 0;
}
! if(!uplink_valid(target))
{
! opserv_notice(user, OSMSG_INVALID_UPLINK, target);
return 0;
}
uplink_select(target);
--- 715,735 ----
if(!strcmp(cManager.uplink->name, target))
{
! reply(OSMSG_CURRENT_UPLINK, cManager.uplink->name);
return 0;
}
! uplink = uplink_find(target);
! if(!uplink)
{
! reply(OSMSG_INVALID_UPLINK, target);
return 0;
}
+ if(uplink->flags & UPLINK_UNAVAILABLE)
+ {
+ reply(OSMSG_UPLINK_DISABLED, uplink->name);
+ return 0;
+ }
+
+ reply(OSMSG_UPLINK_CONNECTING, uplink->name, uplink->host, uplink->port);
uplink_select(target);
|