pidgin: 24f4cc19: Remove old code that was commented out, ...

qulogic at pidgin.im qulogic at pidgin.im
Fri May 21 18:02:40 EDT 2010


-----------------------------------------------------------------
Revision: 24f4cc196fecb13546e938fa413711a031289aa6
Ancestor: fcc261c83e17bf1de125391ba4c14fb6245ecde4
Author: qulogic at pidgin.im
Date: 2010-04-19T08:05:55
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/24f4cc196fecb13546e938fa413711a031289aa6

Modified files:
        libpurple/protocols/msn/slp.c
        libpurple/protocols/msn/slplink.c
        libpurple/protocols/msn/switchboard.c

ChangeLog: 

Remove old code that was commented out, but is really just not necessary.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	1c425e0a51c51b08db5e562f64a3369c82d5ed32
+++ libpurple/protocols/msn/slp.c	30d182d313748a37dec731e9c411f7118b76d283
@@ -37,13 +37,6 @@
 /* ms to delay between sending buddy icon requests to the server. */
 #define BUDDY_ICON_DELAY 20
 
-/*
-static void msn_slp_send_ok(MsnSlpCall *slpcall, const char *branch,
-					const char *type, const char *content);
-
-static void msn_slp_send_decline(MsnSlpCall *slpcall, const char *branch,
-						 const char *type, const char *content);
-*/
 static void request_user_display(MsnUser *user);
 
 
@@ -113,7 +106,6 @@ msn_xfer_cancel(PurpleXfer *xfer)
 
 	slpcall = xfer->data;
 
-
 	if (purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL)
 	{
 		if (slpcall->started)
@@ -190,8 +182,6 @@ msn_xfer_end_cb(MsnSlpCall *slpcall, Msn
 void
 msn_xfer_end_cb(MsnSlpCall *slpcall, MsnSession *session)
 {
-	purple_debug_info("msn", "msn_xfer_end_cb\n");
-
 	if ((purple_xfer_get_status(slpcall->xfer) != PURPLE_XFER_STATUS_DONE) &&
 		(purple_xfer_get_status(slpcall->xfer) != PURPLE_XFER_STATUS_CANCEL_REMOTE) &&
 		(purple_xfer_get_status(slpcall->xfer) != PURPLE_XFER_STATUS_CANCEL_LOCAL))
@@ -670,7 +660,7 @@ got_invite(MsnSlpCall *slpcall,
 	else if (!strcmp(type, "application/x-msnmsgr-transreqbody"))
 	{
 		/* A direct connection negotiation request */
-		char		*bridges;
+		char *bridges;
 
 		purple_debug_info("msn", "got_invite: transreqbody received\n");
 
@@ -685,8 +675,8 @@ got_invite(MsnSlpCall *slpcall,
 			 * Ok, the client supports direct TCP connection
 			 * Try to create a listening port
 			 */
-			char		*content;
-			MsnDirectConn	*dc;
+			char *content;
+			MsnDirectConn *dc;
 
 			dc = msn_dc_new(slpcall);
 
@@ -738,31 +728,6 @@ got_invite(MsnSlpCall *slpcall,
 		g_return_if_fail(slpcall->xfer != NULL);
 
 		msn_slp_process_transresp(slpcall, content);
-#if 0
-		char *ip_addrs;
-		char *temp;
-		char *nonce;
-		int port;
-
-		nonce = get_token(content, "Nonce: {", "}\r\n");
-		if (ip_addrs == NULL)
-			return;
-
-		ip_addrs = get_token(content, "IPv4Internal-Addrs: ", "\r\n");
-
-		temp = get_token(content, "IPv4Internal-Port: ", "\r\n");
-		if (temp != NULL)
-			port = atoi(temp);
-		else
-			port = -1;
-		g_free(temp);
-
-		if (port > 0)
-			got_transresp(slpcall, nonce, ip_addrs, port);
-
-		g_free(nonce);
-		g_free(ip_addrs);
-#endif
 	}
 }
 
@@ -775,16 +740,16 @@ got_ok(MsnSlpCall *slpcall,
 
 	if (!strcmp(type, "application/x-msnmsgr-sessionreqbody"))
 	{
-		char		*content;
-		char		*header;
-		MsnSlpMessage	*msg;
-		MsnDirectConn	*dc;
+		char *content;
+		char *header;
+		MsnSlpMessage *msg;
+		MsnDirectConn *dc;
 
 		g_return_if_fail(slpcall->xfer != NULL);
 
-		if(slpcall->slplink->dc != NULL) {
+		if (slpcall->slplink->dc != NULL) {
 			/*
-			 * If we already have an estabilished direct connection
+			 * If we already have an established direct connection
 			 * then just start the transfer.
 			 */
 			msn_slpcall_session_init(slpcall);
@@ -855,57 +820,13 @@ got_ok(MsnSlpCall *slpcall,
 		g_free(content);
 
 		msn_slplink_queue_slpmsg(slpcall->slplink, msg);
-#if 0
-		if (slpcall->type == MSN_SLPCALL_DC)
-		{
-			/* First let's try a DirectConnection. */
 
-			MsnSlpLink *slplink;
-			MsnSlpMessage *slpmsg;
-			char *header;
-			char *content;
-			char *branch;
-
-			slplink = slpcall->slplink;
-
-			branch = rand_guid();
-
-			content = g_strdup_printf(
-				"Bridges: TRUDPv1 TCPv1\r\n"
-				"NetID: 0\r\n"
-				"Conn-Type: Direct-Connect\r\n"
-				"UPnPNat: false\r\n"
-				"ICF: false\r\n"
-			);
-
-			header = g_strdup_printf("INVITE MSNMSGR:%s MSNSLP/1.0",
-									 slplink->remote_user);
-
-			slpmsg = msn_slp_sipmsg_new(slpcall, 0, header, branch,
-										"application/x-msnmsgr-transreqbody",
-										content);
-
-			slpmsg->info = "SLP INVITE";
-			slpmsg->text_body = TRUE;
-			msn_slplink_send_slpmsg(slplink, slpmsg);
-
-			g_free(header);
-			g_free(content);
-
-			g_free(branch);
-		}
-		else
-		{
-			msn_slpcall_session_init(slpcall);
-		}
-#else
 		/*
 		 * Removed because it messes up direct connection by
 		 * starting p2p transfer
 		 */
 
 		/* msn_slpcall_session_init(slpcall); */
-#endif
 	}
 	else if (!strcmp(type, "application/x-msnmsgr-transreqbody"))
 	{
@@ -915,31 +836,6 @@ got_ok(MsnSlpCall *slpcall,
 	else if (!strcmp(type, "application/x-msnmsgr-transrespbody"))
 	{
 		msn_slp_process_transresp(slpcall, content);
-#if 0
-		char *ip_addrs;
-		char *temp;
-		char *nonce;
-		int port;
-
-		nonce = get_token(content, "Nonce: {", "}\r\n");
-		if (ip_addrs == NULL)
-			return;
-
-		ip_addrs = get_token(content, "IPv4Internal-Addrs: ", "\r\n");
-
-		temp = get_token(content, "IPv4Internal-Port: ", "\r\n");
-		if (temp != NULL)
-			port = atoi(temp);
-		else
-			port = -1;
-		g_free(temp);
-
-		if (port > 0)
-			got_transresp(slpcall, nonce, ip_addrs, port);
-
-		g_free(nonce);
-		g_free(ip_addrs);
-#endif
 	}
 }
 
============================================================
--- libpurple/protocols/msn/slplink.c	80b294680c2edc92d7939fc473cfed0bd5442108
+++ libpurple/protocols/msn/slplink.c	f1ccff7b2c1bfa1375943482e0136b254670d290
@@ -439,10 +439,10 @@ msn_slplink_send_queued_slpmsgs(MsnSlpLi
 	}
 }
 
-static MsnSlpMessage*
+static MsnSlpMessage *
 msn_slplink_create_ack(MsnSlpLink *slplink, MsnSlpHeader *header)
 {
-	MsnSlpMessage	*slpmsg;
+	MsnSlpMessage *slpmsg;
 
 	slpmsg = msn_slpmsg_new(slplink);
 
@@ -462,18 +462,6 @@ msn_slplink_send_ack(MsnSlpLink *slplink
 {
 	MsnSlpMessage *slpmsg = msn_slplink_create_ack(slplink, header);
 
-	/*
-	slpmsg = msn_slpmsg_new(slplink);
-
-	slpmsg->session_id = msg->msnslp_header.session_id;
-	slpmsg->size       = msg->msnslp_header.total_size;
-	slpmsg->flags      = 0x02;
-	slpmsg->ack_id     = msg->msnslp_header.id;
-	slpmsg->ack_sub_id = msg->msnslp_header.ack_id;
-	slpmsg->ack_size   = msg->msnslp_header.total_size;
-	slpmsg->info = "SLP ACK";
-	*/
-
 	msn_slplink_send_slpmsg(slplink, slpmsg);
 	msn_slpmsg_destroy(slpmsg);
 }
@@ -525,21 +513,12 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 	guint64 offset;
 	PurpleXfer *xfer = NULL;
 
-	/*
-	if (purple_debug_is_verbose())
-		msn_slpmsg_show(msg);
-	*/
-
-#ifdef MSN_DEBUG_SLP_FILES
-#endif
 	if (header->total_size < header->length)
 	{
 		purple_debug_error("msn", "This can't be good\n");
 		g_return_if_reached();
 	}
 
-	/* data = msn_message_get_bin_data(msg, &len); */
-
 	offset = header->offset;
 
 	if (offset == 0)
@@ -655,46 +634,43 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 
 		purple_debug_info("msn", "msn_slplink_process_msg: slpmsg complete\n");
 
-		/*if (!slpcall->wasted) {*/
-			if (slpmsg->flags == 0x100)
-			{
+		if (/* !slpcall->wasted && */ slpmsg->flags == 0x100)
+		{
 #if 0
-				MsnDirectConn *directconn;
+			MsnDirectConn *directconn;
 
-				directconn = slplink->directconn;
-				if (!directconn->acked)
-					msn_directconn_send_handshake(directconn);
+			directconn = slplink->directconn;
+			if (!directconn->acked)
+				msn_directconn_send_handshake(directconn);
 #endif
-			}
-			else if (slpmsg->flags == 0x00 || slpmsg->flags == 0x1000000 ||
-				 slpmsg->flags == 0x20 || slpmsg->flags == 0x1000020 ||
-				 slpmsg->flags == 0x1000030)
-			{
-				/* Release all the messages and send the ACK */
+		}
+		else if (slpmsg->flags == 0x00 || slpmsg->flags == 0x1000000 ||
+		         slpmsg->flags == 0x20 || slpmsg->flags == 0x1000020 ||
+		         slpmsg->flags == 0x1000030)
+		{
+			/* Release all the messages and send the ACK */
 
-				if (slpcall != NULL && slpcall->wait_for_socket) {
-					/*
-					 * Save ack for later because we have to send
-					 * a 200 OK message to the previous direct connect
-					 * invitation before ACK but the listening socket isn't
-					 * created yet.
-					 */
+			if (slpcall->wait_for_socket) {
+				/*
+				 * Save ack for later because we have to send
+				 * a 200 OK message to the previous direct connect
+				 * invitation before ACK but the listening socket isn't
+				 * created yet.
+				 */
+				purple_debug_info("msn", "msn_slplink_process_msg: save ACK\n");
 
-					purple_debug_info("msn", "msn_slplink_process_msg: save ACK\n");
+				slpcall->slplink->dc->prev_ack = msn_slplink_create_ack(slplink, header);
+			} else if (!slpcall->wasted) {
+				purple_debug_info("msn", "msn_slplink_process_msg: send ACK\n");
 
-					slpcall->slplink->dc->prev_ack = msn_slplink_create_ack(slplink, header);
-				} else {
-					purple_debug_info("msn", "msn_slplink_process_msg: send ACK\n");
-
-					msn_slplink_send_ack(slplink, header);
-					msn_slplink_send_queued_slpmsgs(slplink);
-				}
+				msn_slplink_send_ack(slplink, header);
+				msn_slplink_send_queued_slpmsgs(slplink);
 			}
-		/*}*/
+		}
 
 		msn_slpmsg_destroy(slpmsg);
 
-		if (slpcall != NULL && !slpcall->wait_for_socket && slpcall->wasted)
+		if (!slpcall->wait_for_socket && slpcall->wasted)
 			msn_slpcall_destroy(slpcall);
 	}
 }
============================================================
--- libpurple/protocols/msn/switchboard.c	618760ce3fb1e2190a27b7c074155afbdb15a796
+++ libpurple/protocols/msn/switchboard.c	f487ce69e243e59fba8ec2b9550bfc4c23499983
@@ -88,9 +88,9 @@ msn_switchboard_destroy(MsnSwitchBoard *
 
 	/* If it linked us is because its looking for trouble */
 	while (swboard->slplinks != NULL) {
-		/* Destroy only those slplinks which use the switchboard */
-		MsnSlpLink	*slplink = swboard->slplinks->data;
+		MsnSlpLink *slplink = swboard->slplinks->data;
 
+		/* Destroy only those slplinks which use the switchboard */
 		if (slplink->dc == NULL)
 			msn_slplink_destroy(slplink);
 		else {


More information about the Commits mailing list