From: Wilfried Göesgens Date: Sat, 18 Apr 2009 12:41:37 +0000 (+0000) Subject: * evaluate server status code, this will lock us up if we're trying to read the messa... X-Git-Tag: v7.86~1246 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=547d609b9783918be5b05749eaf476d3846dc241 * evaluate server status code, this will lock us up if we're trying to read the message though. --- diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 5fc0996bd..63d771717 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -607,22 +607,26 @@ void tmplput_mesg(StrBuf *Target, WCTemplputParams *TP) Buf = NewStrBuf(); Line = NewStrBuf(); serv_printf("MESG %s", TP->Tokens->Params[0]->Start); + StrBuf_ServGetln(Line); - while (!Done && (StrBuf_ServGetln(Line)>=0)) { - if ( (StrLength(Line)==3) && - !strcmp(ChrPtr(Line), "000")) - Done = 1; - else - { - if (n > 0) - StrBufAppendBufPlain(Buf, "\n", 1, 0); - StrBufAppendBuf(Buf, Line, 0); + if (GetServerStatus(Line, NULL) == 1) { + while (!Done && (StrBuf_ServGetln(Line)>=0)) { + if ( (StrLength(Line)==3) && + !strcmp(ChrPtr(Line), "000")) + Done = 1; + else + { + if (n > 0) + StrBufAppendBufPlain(Buf, "\n", 1, 0); + StrBufAppendBuf(Buf, Line, 0); + } + n++; } - n++; + + FlushStrBuf(Line); + FmOut(Line, "center", Buf); + StrBufAppendTemplate(Target, TP, Line, 1); } - FlushStrBuf(Line); - FmOut(Line, "center", Buf); - StrBufAppendTemplate(Target, TP, Line, 1); FreeStrBuf(&Buf); FreeStrBuf(&Line); }