changeset 2931:10a2d4d5bcf2

[gaim-migrate @ 2944] heh. committer: Tailor Script <tailor@pidgin.im>
author Adam Fritzler <mid@auk.cx>
date Tue, 15 Jan 2002 04:07:08 +0000
parents adf08f4c9e9d
children 3827e4cd665c
files src/protocols/oscar/chatnav.c src/protocols/oscar/ft.c src/protocols/oscar/misc.c src/protocols/oscar/oscar.c src/protocols/oscar/rxqueue.c src/protocols/oscar/util.c
diffstat 6 files changed, 28 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/chatnav.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/chatnav.c	Tue Jan 15 04:07:08 2002 +0000
@@ -36,7 +36,17 @@
 	/* exchange */
 	aimbs_put16(&fr->data, exchange);
 
-	/* action cookie */
+	/*
+	 * This looks to be a big hack.  You'll note that this entire
+	 * SNAC is just a room info structure, but the hard room name,
+	 * here, is set to "create".  
+	 *
+	 * Either this goes on the "list of questions concerning
+	 * why-the-hell-did-you-do-that", or this value is completly
+	 * ignored.  Without experimental evidence, but a good knowledge of
+	 * AOL style, I'm going to guess that it is the latter, and that
+	 * the value of the room name in create requests is ignored.
+	 */
 	aimbs_put8(&fr->data, strlen(ck));
 	aimbs_putraw(&fr->data, ck, strlen(ck));
 
--- a/src/protocols/oscar/ft.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/ft.c	Tue Jan 15 04:07:08 2002 +0000
@@ -4,6 +4,7 @@
  */
 
 #define FAIM_INTERNAL
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
--- a/src/protocols/oscar/misc.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/misc.c	Tue Jan 15 04:07:08 2002 +0000
@@ -30,19 +30,16 @@
 {
 	aim_frame_t *fr;
 	aim_snacid_t snacid;
-	int i, len = 0;
+	int len = 0;
 	char *localcpy = NULL;
 	char *tmpptr = NULL;
 
 	if (!buddy_list || !(localcpy = strdup(buddy_list))) 
 		return -EINVAL;
 
-	i = 0;
-	tmpptr = strtok(localcpy, "&");
-	while ((tmpptr != NULL) && (i < 150)) {
-		faimdprintf(sess, 2, "---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr));
-		len += 1+strlen(tmpptr);
-		i++;
+	for (tmpptr = strtok(localcpy, "&"); tmpptr; ) {
+		faimdprintf(sess, 2, "---adding: %s (%d)\n", tmpptr, strlen(tmpptr));
+		len += 1 + strlen(tmpptr);
 		tmpptr = strtok(NULL, "&");
 	}
 
@@ -50,18 +47,16 @@
 		return -ENOMEM;
 
 	snacid = aim_cachesnac(sess, 0x0003, 0x0004, 0x0000, NULL, 0);
-	
 	aim_putsnac(&fr->data, 0x0003, 0x0004, 0x0000, snacid);
 
-	strncpy(localcpy, buddy_list, strlen(buddy_list)+1);
-	i = 0;
-	tmpptr = strtok(localcpy, "&");
-	while ((tmpptr != NULL) & (i < 150)) {
-		faimdprintf(sess, 2, "---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr));
-		
+	strncpy(localcpy, buddy_list, strlen(buddy_list) + 1);
+
+	for (tmpptr = strtok(localcpy, "&"); tmpptr; ) {
+
+		faimdprintf(sess, 2, "---adding: %s (%d)\n", tmpptr, strlen(tmpptr));
+
 		aimbs_put8(&fr->data, strlen(tmpptr));
 		aimbs_putraw(&fr->data, tmpptr, strlen(tmpptr));
-		i++;
 		tmpptr = strtok(NULL, "&");
 	}
 
--- a/src/protocols/oscar/oscar.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/oscar.c	Tue Jan 15 04:07:08 2002 +0000
@@ -1776,7 +1776,7 @@
 			debug_printf("chat info: \tMax Concurrent Rooms: %d\n", maxrooms);
 			debug_printf("chat info: \tExchange List: (%d total)\n", exchangecount);
 			for (i = 0; i < exchangecount; i++)
-				debug_printf("chat info: \t\t%d\n", exchanges[i].number);
+				debug_printf("chat info: \t\t%d    %s\n", exchanges[i].number, exchanges[i].name ? exchanges[i].name : "");
 			while (odata->create_rooms) {
 				struct create_room *cr = odata->create_rooms->data;
 				debug_printf("creating room %s\n", cr->name);
--- a/src/protocols/oscar/rxqueue.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/rxqueue.c	Tue Jan 15 04:07:08 2002 +0000
@@ -431,8 +431,7 @@
 
 		/* read the payload */
 		if (aim_bstream_recv(&newrx->data, conn->fd, payloadlen) < payloadlen) {
-			free(payload);
-			aim_frame_destroy(newrx);
+			aim_frame_destroy(newrx); /* free's payload */
 			aim_conn_close(conn);
 			return -1;
 		}
--- a/src/protocols/oscar/util.c	Tue Jan 15 03:50:14 2002 +0000
+++ b/src/protocols/oscar/util.c	Tue Jan 15 04:07:08 2002 +0000
@@ -162,6 +162,10 @@
 		}
 	}
 
+	/* Should both be NULL */
+	if (*curPtr1 != *curPtr2)
+		return 1;
+
 	return 0;
 }