* 2 short -- Sequence number
* 4 short -- Number of data bytes that follow.
*/
- faim_mutex_lock(&conn->active);
if (aim_bstream_recv(&flaphdr, conn->fd, 6) < 6) {
aim_conn_close(conn);
- faim_mutex_unlock(&conn->active);
return -1;
}
if (aimbs_get8(&flaphdr) != 0x2a) {
faimdprintf(sess, 0, "FLAP framing disrupted");
aim_conn_close(conn);
- faim_mutex_unlock(&conn->active);
return -1;
}
/* allocate a new struct */
- if (!(newrx = (aim_frame_t *)malloc(sizeof(aim_frame_t)))) {
- faim_mutex_unlock(&conn->active);
+ if (!(newrx = (aim_frame_t *)malloc(sizeof(aim_frame_t))))
return -1;
- }
memset(newrx, 0, sizeof(aim_frame_t));
/* we're doing FLAP if we're here */
if (!(payload = (fu8_t *) malloc(payloadlen))) {
aim_frame_destroy(newrx);
- faim_mutex_unlock(&conn->active);
return -1;
}
free(payload);
aim_frame_destroy(newrx);
aim_conn_close(conn);
- faim_mutex_unlock(&conn->active);
return -1;
}
} else
aim_bstream_init(&newrx->data, NULL, 0);
- faim_mutex_unlock(&conn->active);
aim_bstream_rewind(&newrx->data);