From: mid Date: Tue, 8 Aug 2000 04:32:38 +0000 (+0000) Subject: - Preserve subtype and priv after aim_conn_close X-Git-Tag: rel_0_99_2~133 X-Git-Url: http://andersk.mit.edu/gitweb/libfaim.git/commitdiff_plain/3369f8d468f7e296d93bb50698dc3f6b55af8848 - Preserve subtype and priv after aim_conn_close --- diff --git a/CHANGES b/CHANGES index f6d3f78..2ae595f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ No release numbers ------------------ + - Tue Aug 8 04:25:35 UTC 2000 + - Preserve subtype and priv after aim_conn_close + - Tue Aug 8 04:15:47 UTC 2000 - Fixed double-calling of faim_mutex_init - conn->type preserved after aim_conn_close diff --git a/aim_conn.c b/aim_conn.c index 5eb568d..a815e33 100644 --- a/aim_conn.c +++ b/aim_conn.c @@ -61,6 +61,7 @@ static void aim_conn_init(struct aim_conn_t *deadconn) return; deadconn->fd = -1; + deadconn->subtype = -1; deadconn->type = -1; deadconn->seqnum = 0; deadconn->lastactivity = 0; @@ -110,21 +111,30 @@ void aim_conn_kill(struct aim_session_t *sess, struct aim_conn_t **deadconn) void aim_conn_close(struct aim_conn_t *deadconn) { - int typesav = -1; + int typesav = -1, subtypesav = -1; + void *privsav = NULL; faim_mutex_destroy(&deadconn->active); faim_mutex_destroy(&deadconn->seqnum_lock); if (deadconn->fd >= 3) close(deadconn->fd); - typesav = deadconn->type; if (deadconn->handlerlist) aim_clearhandlers(deadconn); - if (deadconn->priv) + + typesav = deadconn->type; + subtypesav = deadconn->subtype; + + if (deadconn->priv && (deadconn->type != AIM_CONN_TYPE_RENDEZVOUS)) { free(deadconn->priv); - + deadconn->priv = NULL; + } + privsav = deadconn->priv; + aim_conn_init(deadconn); deadconn->type = typesav; + deadconn->subtype = subtypesav; + deadconn->priv = privsav; return; }