From 5b6e73afc7dafc549bb179b6610689b1be64322e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 1 Jun 2010 20:57:18 +0000 Subject: [PATCH] * get_serv_info(): evaluate server replies --- webcit/serv_func.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 07932ef2a..493b380f1 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -64,6 +64,12 @@ ServInfo *get_serv_info(StrBuf *browser_host, StrBuf *user_agent) ChrPtr(browser_host) ); StrBuf_ServGetln(Buf); + if (GetServerStatus(Buf, NULL) != 2) { + lprintf(0, "get_serv_info(IDEN): unexpected answer [%s]\n", + ChrPtr(Buf)); + FreeStrBuf(&Buf); + return NULL; + } /* * Tell the server that when we save a calendar event, we @@ -72,11 +78,19 @@ ServInfo *get_serv_info(StrBuf *browser_host, StrBuf *user_agent) */ 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", + ChrPtr(Buf)); + FreeStrBuf(&Buf); + return NULL; + } /** Now ask the server to tell us a little bit about itself... */ serv_puts("INFO"); StrBuf_ServGetln(Buf); if (GetServerStatus(Buf, NULL) != 1) { + lprintf(0, "get_serv_info(INFO sgi|1): unexpected answer [%s]\n", + ChrPtr(Buf)); FreeStrBuf(&Buf); return NULL; } -- 2.30.2