From 7bed16929b8f47e2b957a019c1a7d9f83629f4c7 Mon Sep 17 00:00:00 2001 From: mid Date: Mon, 3 Jan 2000 04:10:46 +0000 Subject: [PATCH] UNKNOWN CONNECTION TYPE bugfix. --- CHANGES | 6 ++++++ aim_conn.c | 2 +- aim_rxhandlers.c | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e1bd75d..4687f5e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ No release numbers ------------------ + - Mon Jan 3 04:07:55 UTC 2000 + - Fixed bug in aim_snac.c + - Fixed condition where commands read from connections that have + been closed were still left in the queue. Now cancelled. + - Added some printfs to aim_info to get more informative crahes + - Sun Jan 2 10:31:19 UTC 2000 - Cleanups in aim_info.c - Can compile with -Ddebug=100 again diff --git a/aim_conn.c b/aim_conn.c index ee2418c..b47b42b 100644 --- a/aim_conn.c +++ b/aim_conn.c @@ -248,7 +248,7 @@ void aim_session_init(struct aim_session_t *sess) memset(sess->logininfo.cookie, 0x00, AIM_COOKIELEN); sess->logininfo.email = NULL; sess->logininfo.regstatus = 0x00; - + for (i = 0; i < AIM_CONN_MAX; i++) { sess->conns[i].fd = -1; diff --git a/aim_rxhandlers.c b/aim_rxhandlers.c index 9fa45d9..0331433 100644 --- a/aim_rxhandlers.c +++ b/aim_rxhandlers.c @@ -311,8 +311,21 @@ int aim_rxdispatch(struct aim_session_t *sess) workingPtr = sess->queue_incoming; for (i = 0; workingPtr != NULL; i++) { + /* + * XXX: This is still fairly ugly. + */ switch(workingPtr->conn->type) { + case -1: + /* + * This can happen if we have a queued command + * that was recieved after a connection has + * been terminated. In which case, the handler + * list has been cleared, and there's nothing we + * can do for it. We can only cancel it. + */ + workingPtr->handled = 1; + break; case AIM_CONN_TYPE_AUTH: { u_long head; @@ -561,7 +574,7 @@ int aim_rxdispatch(struct aim_session_t *sess) } break; default: - printf("\nAHHHHH! UNKNOWN CONNECTION TYPE! (0x%02x)\n\n", workingPtr->conn->type); + printf("\nAHHHHH! UNKNOWN CONNECTION TYPE! (type = %d, fd = %d, channel = %02x, commandlen = %02x)\n\n", workingPtr->conn->type, workingPtr->conn->fd, workingPtr->type, workingPtr->commandlen); workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr); break; } -- 2.45.2