From 45a8af744d8206c29bb79c419b8fd055515fbdf4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 17 Jun 2009 21:26:18 +0000 Subject: [PATCH] * ParsePref() was returning if it encountered a blank line in the preferences data, leaving the rest of the server transaction unfinished and causing the protocol to get out of sync. Fixed. This is almost certainly the cause of the 'numeric room name upon login' bug. --- webcit/auth.c | 1 - webcit/preferences.c | 4 ++-- webcit/roomops.c | 6 ------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index d74f1ce62..2f023a5ec 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -148,7 +148,6 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo Buf = NewStrBuf(); serv_puts("CHEK"); StrBuf_ServGetln(Buf); - lprintf(9, "%s:%d CHEK server reply: %s\n", __FILE__, __LINE__, ChrPtr(Buf)); if (GetServerStatus(Buf, NULL) == 2) { const char *pch; diff --git a/webcit/preferences.c b/webcit/preferences.c index af164ca46..ac4fb3c48 100644 --- a/webcit/preferences.c +++ b/webcit/preferences.c @@ -151,8 +151,8 @@ void ParsePref(HashList **List, StrBuf *ReadBuf) Preference *Data = NULL; Preference *LastData = NULL; - while (!Done && StrBuf_ServGetln(ReadBuf)) - { + while (!Done) { + StrBuf_ServGetln(ReadBuf); if ( (StrLength(ReadBuf)==3) && !strcmp(ChrPtr(ReadBuf), "000")) { Done = 1; diff --git a/webcit/roomops.c b/webcit/roomops.c index 546f5a04f..ed90e01fa 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -801,8 +801,6 @@ long gotoroom(const StrBuf *gname) static long ls = (-1L); long err = 0; - lprintf(9, "%s:%d gotoroom(%s)\n", __FILE__, __LINE__, ChrPtr(gname)); - /* store ungoto information */ strcpy(WC->ugname, ChrPtr(WC->wc_roomname)); WC->uglsn = ls; @@ -811,7 +809,6 @@ long gotoroom(const StrBuf *gname) /* move to the new room */ serv_printf("GOTO %s", ChrPtr(gname)); StrBuf_ServGetln(Buf); - lprintf(9, "%s:%d GOTO server reply: %s\n", __FILE__, __LINE__, ChrPtr(Buf)); if (GetServerStatus(Buf, &err) != 2) { serv_puts("GOTO _BASEROOM_"); StrBuf_ServGetln(Buf); @@ -832,7 +829,6 @@ long gotoroom(const StrBuf *gname) FlushStrBuf(WC->wc_roomname); StrBufExtract_token(WC->wc_roomname, Buf, 0, '|'); - lprintf(9, "%s:%d extracted room name: %s\n", __FILE__, __LINE__, ChrPtr(WC->wc_roomname)); StrBufCutLeft(WC->wc_roomname, 4); WC->room_flags = StrBufExtract_int(Buf, 4, '|'); /* highest_msg_read = extract_int(&buf[4],6); @@ -992,7 +988,6 @@ void gotonext(void) * goto next room */ void smart_goto(const StrBuf *next_room) { - lprintf(9, "%s:%d smart_goto(%s)\n", __FILE__, __LINE__, ChrPtr(next_room)); gotoroom(next_room); readloop(readnew); } @@ -3888,7 +3883,6 @@ void _gotonext(void) { } void dotskip(void) { - lprintf(9, "%s:%d dotskip?room=%s\n", __FILE__, __LINE__, ChrPtr(sbstr("room"))); smart_goto(sbstr("room")); } -- 2.30.2