ServInfo *info;
StrBuf *Buf;
int a;
+ int rc;
Buf = NewStrBuf();
);
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2) {
- lprintf(0, "get_serv_info(IDEN): unexpected answer [%s]\n",
+ syslog(0, "get_serv_info(IDEN): unexpected answer [%s]\n",
ChrPtr(Buf));
FreeStrBuf(&Buf);
return NULL;
serv_puts("ICAL sgi|1");
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2) {
- lprintf(0, "get_serv_info(ICAL sgi|1): unexpected answer [%s]\n",
+ syslog(0, "get_serv_info(ICAL sgi|1): unexpected answer [%s]\n",
ChrPtr(Buf));
FreeStrBuf(&Buf);
return NULL;
serv_puts("INFO");
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 1) {
- lprintf(0, "get_serv_info(INFO sgi|1): unexpected answer [%s]\n",
+ syslog(0, "get_serv_info(INFO sgi|1): unexpected answer [%s]\n",
ChrPtr(Buf));
FreeStrBuf(&Buf);
return NULL;
info = (ServInfo*)malloc(sizeof(ServInfo));
memset(info, 0, sizeof(ServInfo));
a = 0;
- while (StrBuf_ServGetln(Buf), (strcmp(ChrPtr(Buf), "000")!= 0)) {
+ while (rc = StrBuf_ServGetln(Buf),
+ (rc >= 0) &&
+ ((rc != 3) ||
+ strcmp(ChrPtr(Buf), "000")))
+ {
switch (a) {
case 0:
info->serv_pid = StrToi(Buf);
WCC->serv_sock = tcp_connectsock(ctdlhost, ctdlport);
if (WCC->serv_sock < 0) {
- do_logout();
FreeStrBuf(&WCC->ReadBuf);
return 1;
}
return 1;
}
- /* 2010jun03: every now and then the connection to Citadel dies before this point. why? */
-
/*
* From what host is our user connecting? Go with
* the host at the other end of the HTTP socket,
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
if ((intext == 1) && (isspace(buf[0]))) {
- wc_printf("<br />");
+ wc_printf("<br>");
}
intext = 1;
if (bq == 1) {
wc_printf("</I>");
}
- wc_printf("</div><br />\n");
+ wc_printf("</div><br>\n");
}
void FmOut(StrBuf *Target, char *align, StrBuf *Source)
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
if ((intext == 1) && (isspace(buf[0]))) {
- wc_printf("<br />");
+ wc_printf("<br>");
}
intext = 1;
StrBufAppendPrintf(Target, "%d", WC->ctdl_pid);
}
+void tmplput_serv_admin(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+ if (WCC->serv_info == NULL)
+ return;
+ StrBufAppendTemplate(Target, TP, WCC->serv_info->serv_sysadm, 0);
+}
+
void tmplput_serv_nodename(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
RegisterNamespace("SERV:REV_LEVEL", 0, 0, tmplput_serv_rev_level, NULL, CTX_NONE);
RegisterNamespace("SERV:BBS_CITY", 0, 1, tmplput_serv_bbs_city, NULL, CTX_NONE);
RegisterNamespace("SERV:MESG", 1, 2, tmplput_mesg, NULL, CTX_NONE);
+ RegisterNamespace("SERV:ADMIN", 1, 2, tmplput_serv_admin, NULL, CTX_NONE);
}