mirror of
https://github.com/bstansell/conserver.git
synced 2024-12-19 21:07:54 +00:00
ran gindent to clean up formatting
This commit is contained in:
parent
0d64aad812
commit
5be57261e8
@ -67,9 +67,9 @@ AddrCmp(struct in_addr *addr, char *pattern)
|
||||
in_addr_t hostaddr, pattern_addr, netmask;
|
||||
char *p, *slash_posn;
|
||||
static STRING *buf = (STRING *)0;
|
||||
# if HAVE_INET_ATON
|
||||
#if HAVE_INET_ATON
|
||||
struct in_addr inetaddr;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (buf == (STRING *)0)
|
||||
buf = AllocString();
|
||||
@ -82,15 +82,15 @@ AddrCmp(struct in_addr *addr, char *pattern)
|
||||
} else
|
||||
p = pattern;
|
||||
|
||||
# if HAVE_INET_ATON
|
||||
#if HAVE_INET_ATON
|
||||
if (inet_aton(p, &inetaddr) == 0)
|
||||
return 1;
|
||||
pattern_addr = inetaddr.s_addr;
|
||||
# else
|
||||
#else
|
||||
pattern_addr = inet_addr(p);
|
||||
if (pattern_addr == (in_addr_t) (-1))
|
||||
return 1; /* malformed address */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (slash_posn) {
|
||||
/* convert explicit netmask */
|
||||
@ -164,13 +164,15 @@ AccType(INADDR_STYPE *addr, char **peername)
|
||||
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
||||
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||
pACtmp->ctrust));
|
||||
if (addr->ss_family == AF_INET && pACtmp->isCIDR != 0) {
|
||||
if (AddrCmp(&(((struct sockaddr_in *)addr)->sin_addr), pACtmp->pcwho) == 0) {
|
||||
ret = pACtmp->ctrust;
|
||||
goto common_ret;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (addr->ss_family == AF_INET && pACtmp->isCIDR != 0) {
|
||||
if (AddrCmp
|
||||
(&(((struct sockaddr_in *)addr)->sin_addr),
|
||||
pACtmp->pcwho) == 0) {
|
||||
ret = pACtmp->ctrust;
|
||||
goto common_ret;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strstr(ipaddr, pACtmp->pcwho) != NULL) {
|
||||
CONDDEBUG((1, "AccType(): match for ip=%s", ipaddr));
|
||||
|
@ -885,7 +885,7 @@ ConsInit(CONSENT *pCE)
|
||||
#if HAVE_SETSOCKOPT
|
||||
int one = 1;
|
||||
#endif
|
||||
Sleep(100000); /* Not all terminal servers can keep up */
|
||||
Sleep(100000); /* Not all terminal servers can keep up */
|
||||
|
||||
#if USE_IPV6
|
||||
# if HAVE_MEMSET
|
||||
@ -933,7 +933,7 @@ ConsInit(CONSENT *pCE)
|
||||
|
||||
ret = connect(cofile, rp->ai_addr, rp->ai_addrlen);
|
||||
if (ret == 0 || errno == EINPROGRESS)
|
||||
goto success;
|
||||
goto success;
|
||||
|
||||
fail:
|
||||
close(cofile);
|
||||
|
@ -3096,7 +3096,7 @@ void
|
||||
Sleep(useconds_t usec)
|
||||
{
|
||||
#ifdef HAVE_NANOSLEEP
|
||||
struct timespec ts = {0, usec * 1000};
|
||||
struct timespec ts = { 0, usec * 1000 };
|
||||
nanosleep(&ts, NULL);
|
||||
#else
|
||||
usleep(usec);
|
||||
|
@ -5250,7 +5250,7 @@ Spawn(GRPENT *pGE, int msfd)
|
||||
* possibly opens another socket to the port. this really is only
|
||||
* an issue if you use the same port with -p and -b, i think.
|
||||
*/
|
||||
Sleep(750000); /* pause 0.75 sec to throttle startup a bit */
|
||||
Sleep(750000); /* pause 0.75 sec to throttle startup a bit */
|
||||
pGE->pid = pid;
|
||||
return;
|
||||
case 0:
|
||||
|
@ -1473,11 +1473,11 @@ CallUp(CONSFILE *pcf, char *pcMaster, char *pcMach, char *pcHow,
|
||||
FilePrint(pcf, FLAGFALSE, "%c%c=", chAttn, chEsc);
|
||||
r = ReadReply(pcf, FLAGFALSE);
|
||||
if (strncmp(r, "[unknown", 8) != 0 && strncmp(r, "[up]", 4) != 0) {
|
||||
FileWrite(cfstdout, FLAGFALSE, r, -1);
|
||||
if (config->exitdown == FLAGTRUE) {
|
||||
Error("Console is not 'up'. Exiting. (-k)");
|
||||
Bye(EX_UNAVAILABLE);
|
||||
}
|
||||
FileWrite(cfstdout, FLAGFALSE, r, -1);
|
||||
if (config->exitdown == FLAGTRUE) {
|
||||
Error("Console is not 'up'. Exiting. (-k)");
|
||||
Bye(EX_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
/* try to grok the version of the server */
|
||||
@ -2041,7 +2041,7 @@ main(int argc, char **argv)
|
||||
pcCmd = "info";
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
case 'k':
|
||||
optConf->exitdown = FLAGTRUE;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user