pidgin: a22b2ccf: Get rid of MsnSlpSession entirely. It on...

qulogic at pidgin.im qulogic at pidgin.im
Fri Aug 1 01:20:56 EDT 2008


-----------------------------------------------------------------
Revision: a22b2ccfeee3fec1e5cc6211d5ccf7770a3b2141
Ancestor: 67d93c5938a1e54d3a5e25c3ef54a12d7ff73c94
Author: qulogic at pidgin.im
Date: 2008-08-01T02:04:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a22b2ccfeee3fec1e5cc6211d5ccf7770a3b2141

Deleted entries:
        libpurple/protocols/msn/slpsession.c
        libpurple/protocols/msn/slpsession.h
Modified files:
        libpurple/protocols/msn/Makefile.am
        libpurple/protocols/msn/Makefile.mingw
        libpurple/protocols/msn/slp.c
        libpurple/protocols/msn/slpcall.c
        libpurple/protocols/msn/slpcall.h
        libpurple/protocols/msn/slplink.c
        libpurple/protocols/msn/slplink.h
        libpurple/protocols/msn/slpmsg.h
        libpurple/protocols/msn/soap.c

ChangeLog: 

Get rid of MsnSlpSession entirely. It only seems to link to MsnSlpCall 
and then copy some data from it.

Fixes #1671.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/Makefile.am	4937b068d2cf230ddd477659c7d21294fd989458
+++ libpurple/protocols/msn/Makefile.am	df3563cf5b8cbbea8c125b61bb9a057c6fa29334
@@ -48,8 +48,6 @@ MSNSOURCES = \
 	slplink.h \
 	slpmsg.c \
 	slpmsg.h \
-	slpsession.c \
-	slpsession.h \
 	soap.c \
 	soap.h \
 	state.c \
============================================================
--- libpurple/protocols/msn/Makefile.mingw	ad3ff1fb8660a9e7a40baef8d2216e7f6fbed927
+++ libpurple/protocols/msn/Makefile.mingw	6d868e3ff6b0abc9ab2505916a7783da251bd486
@@ -59,7 +59,6 @@ C_SRC =			cmdproc.c \
 			slpcall.c \
 			slplink.c \
 			slpmsg.c \
-			slpsession.c \
 			soap.c\
 			state.c \
 			switchboard.c \
============================================================
--- libpurple/protocols/msn/slp.c	1e013715d6a0c3caa6e9e891ac730967081eb575
+++ libpurple/protocols/msn/slp.c	7063d56d95066ebfb58e534a5da44636b2177daa
@@ -25,7 +25,6 @@
 #include "slp.h"
 #include "slpcall.h"
 #include "slpmsg.h"
-#include "slpsession.h"
 
 #include "object.h"
 #include "user.h"
@@ -256,7 +255,6 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 		/* Emoticon or UserDisplay */
 		char *content;
 		gsize len;
-		MsnSlpSession *slpsession;
 		MsnSlpLink *slplink;
 		MsnSlpMessage *slpmsg;
 		MsnObject *obj;
@@ -306,14 +304,10 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 			g_return_if_reached();
 		}
 
-		slpsession = msn_slplink_find_slp_session(slplink,
-												  slpcall->session_id);
-
 		/* DATA PREP */
 		slpmsg = msn_slpmsg_new(slplink);
 		slpmsg->slpcall = slpcall;
-		slpmsg->slpsession = slpsession;
-		slpmsg->session_id = slpsession->id;
+		slpmsg->session_id = slpcall->session_id;
 		msn_slpmsg_set_body(slpmsg, NULL, 4);
 #ifdef MSN_DEBUG_SLP
 		slpmsg->info = "SLP DATA PREP";
@@ -323,7 +317,6 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 		/* DATA */
 		slpmsg = msn_slpmsg_new(slplink);
 		slpmsg->slpcall = slpcall;
-		slpmsg->slpsession = slpsession;
 		slpmsg->flags = 0x20;
 #ifdef MSN_DEBUG_SLP
 		slpmsg->info = "SLP DATA";
============================================================
--- libpurple/protocols/msn/slpcall.c	8950866bafc860ef44dab541d02f43a66a781474
+++ libpurple/protocols/msn/slpcall.c	7e75e4d97135dd1491b92eab20779a223b6f7f77
@@ -24,7 +24,6 @@
 #include "msn.h"
 #include "msnutils.h"
 #include "slpcall.h"
-#include "slpsession.h"
 
 #include "slp.h"
 
@@ -115,12 +114,8 @@ msn_slp_call_session_init(MsnSlpCall *sl
 void
 msn_slp_call_session_init(MsnSlpCall *slpcall)
 {
-	MsnSlpSession *slpsession;
-
-	slpsession = msn_slp_session_new(slpcall);
-
 	if (slpcall->session_init_cb)
-		slpcall->session_init_cb(slpsession);
+		slpcall->session_init_cb(slpcall);
 
 	slpcall->started = TRUE;
 }
============================================================
--- libpurple/protocols/msn/slpcall.h	d2e0eca1cdb4f053fc4085d66c951c10a17adcac
+++ libpurple/protocols/msn/slpcall.h	aea1be5c206e45484a0368b4169976d29a68cd97
@@ -29,7 +29,6 @@ typedef struct _MsnSlpCall MsnSlpCall;
 typedef struct _MsnSlpCall MsnSlpCall;
 
 #include "slplink.h"
-#include "slpsession.h"
 
 /* The official client seems to timeout slp calls after 5 minutes */
 #define MSN_SLPCALL_TIMEOUT 300000
@@ -66,7 +65,7 @@ struct _MsnSlpCall
 
 	void (*progress_cb)(MsnSlpCall *slpcall,
 						gsize total_length, gsize len, gsize offset);
-	void (*session_init_cb)(MsnSlpSession *slpsession);
+	void (*session_init_cb)(MsnSlpCall *slpcall);
 
 	/* Can be checksum, or smile */
 	char *data_info;
============================================================
--- libpurple/protocols/msn/slplink.c	727a0d795afea8b858adfcf7a2d76c233cb81925
+++ libpurple/protocols/msn/slplink.c	5d58b24c3c2fc25028c74a4eca2338dc3b979daa
@@ -154,23 +154,6 @@ msn_session_get_slplink(MsnSession *sess
 	return slplink;
 }
 
-MsnSlpSession *
-msn_slplink_find_slp_session(MsnSlpLink *slplink, long session_id)
-{
-	GList *l;
-	MsnSlpSession *slpsession;
-
-	for (l = slplink->slp_sessions; l != NULL; l = l->next)
-	{
-		slpsession = l->data;
-
-		if (slpsession->id == session_id)
-			return slpsession;
-	}
-
-	return NULL;
-}
-
 void
 msn_slplink_add_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall)
 {
@@ -394,12 +377,12 @@ msn_slplink_release_slpmsg(MsnSlpLink *s
 	}
 	else if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030)
 	{
-		MsnSlpSession *slpsession;
-		slpsession = slpmsg->slpsession;
+		MsnSlpCall *slpcall;
+		slpcall = slpmsg->slpcall;
 
-		g_return_if_fail(slpsession != NULL);
-		msg->msnslp_header.session_id = slpsession->id;
-		msg->msnslp_footer.value = slpsession->app_id;
+		g_return_if_fail(slpcall != NULL);
+		msg->msnslp_header.session_id = slpcall->session_id;
+		msg->msnslp_footer.value = slpcall->app_id;
 		msg->msnslp_header.ack_id = rand() % 0xFFFFFF00;
 	}
 	else if (slpmsg->flags == 0x100)
@@ -476,18 +459,15 @@ static void
 }
 
 static void
-send_file_cb(MsnSlpSession *slpsession)
+send_file_cb(MsnSlpCall *slpcall)
 {
-	MsnSlpCall *slpcall;
 	MsnSlpMessage *slpmsg;
 	struct stat st;
 	PurpleXfer *xfer;
 
-	slpcall = slpsession->slpcall;
 	slpmsg = msn_slpmsg_new(slpcall->slplink);
 	slpmsg->slpcall = slpcall;
 	slpmsg->flags = 0x1000030;
-	slpmsg->slpsession = slpsession;
 #ifdef MSN_DEBUG_SLP
 	slpmsg->info = "SLP FILE";
 #endif
============================================================
--- libpurple/protocols/msn/slplink.h	2e862a16e96f7248ccae44cf05e8ff0a43da7eb9
+++ libpurple/protocols/msn/slplink.h	fcecde2e58a77de36472a63717c0867b64e65f5f
@@ -53,7 +53,6 @@ struct _MsnSlpLink
 	MsnDirectConn *directconn;
 
 	GList *slp_calls;
-	GList *slp_sessions;
 	GList *slp_msgs;
 
 	GQueue *slp_msg_queue;
@@ -74,8 +73,6 @@ MsnSlpLink *msn_session_get_slplink(MsnS
  */
 MsnSlpLink *msn_session_get_slplink(MsnSession *session, const char *username);
 
-MsnSlpSession *msn_slplink_find_slp_session(MsnSlpLink *slplink,
-											long session_id);
 void msn_slplink_add_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall);
 void msn_slplink_remove_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall);
 MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink,
============================================================
--- libpurple/protocols/msn/slpmsg.h	2348f7f31881bd0d508206bcbd1e5747a45a08ba
+++ libpurple/protocols/msn/slpmsg.h	089bc3c61f92bbccb87608deedafb52ab43898b5
@@ -28,7 +28,6 @@ typedef struct _MsnSlpMessage MsnSlpMess
 
 #include "imgstore.h"
 
-#include "slpsession.h"
 #include "slpcall.h"
 #include "slplink.h"
 #include "session.h"
@@ -42,7 +41,6 @@ struct _MsnSlpMessage
  */
 struct _MsnSlpMessage
 {
-	MsnSlpSession *slpsession;
 	MsnSlpCall *slpcall; /**< The slpcall to which this slp message belongs (if applicable). */
 	MsnSlpLink *slplink; /**< The slplink through which this slp message is being sent. */
 	MsnSession *session;
============================================================
--- libpurple/protocols/msn/soap.c	8ad01aed24409a684d8f9ab04f32ea4dbb97f6b0
+++ libpurple/protocols/msn/soap.c	a5f35b0c8a746d33397a396fd3f7b3e725cfca34
@@ -38,7 +38,7 @@
 #endif
 
 #define SOAP_TIMEOUT (5 * 60)
-
+#define MSN_UNSAFE_DEBUG 1
 typedef struct _MsnSoapRequest {
 	char *path;
 	MsnSoapMessage *message;


More information about the Commits mailing list