diff src/protocols/msn/slplink.c @ 10296:a7b2fd5efcf2

[gaim-migrate @ 11476] Some "random updates" updates from patch 1077274 by Felipe Contreras: "Some changes in the behaviour of slpcalls (for FT), free some unused structures and properly close switchboard connections." Looks good to me, and seems to have fixed a mysterious FT problem that I had been pretending didn't exist. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 02 Dec 2004 16:07:26 +0000
parents f776e117c17b
children 2e01c503aa4f
line wrap: on
line diff
--- a/src/protocols/msn/slplink.c	Thu Dec 02 13:03:23 2004 +0000
+++ b/src/protocols/msn/slplink.c	Thu Dec 02 16:07:26 2004 +0000
@@ -59,6 +59,8 @@
 {
 	MsnSlpLink *slplink;
 
+	g_return_val_if_fail(session != NULL, NULL);
+
 	slplink = g_new0(MsnSlpLink, 1);
 
 	slplink->session = session;
@@ -80,6 +82,8 @@
 {
 	MsnSession *session;
 
+	g_return_if_fail(slplink != NULL);
+
 	session = slplink->session;
 
 	if (slplink->local_user != NULL)
@@ -91,6 +95,9 @@
 	if (slplink->directconn != NULL)
 		msn_directconn_destroy(slplink->directconn);
 
+	while (slplink->slp_calls != NULL)
+		msn_slp_call_destroy(slplink->slp_calls->data);
+
 	session->slplinks =
 		g_list_remove(session->slplinks, slplink);
 
@@ -288,12 +295,7 @@
 
 	if ((slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) && (slpmsg->slpcall != NULL))
 	{
-		if (slpmsg->slpcall->timer)
-		{
-			gaim_timeout_remove(slpmsg->slpcall->timer);
-			slpmsg->slpcall->timer = gaim_timeout_add(MSN_SLPCALL_TIMEOUT,
-													  msn_slp_call_timeout, slpmsg->slpcall);
-		}
+		slpmsg->slpcall->progress = TRUE;
 
 		if (slpmsg->slpcall->progress_cb != NULL)
 		{
@@ -525,12 +527,7 @@
 
 	if ((slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030) && (slpmsg->slpcall != NULL))
 	{
-		if (slpmsg->slpcall->timer)
-		{
-			gaim_timeout_remove(slpmsg->slpcall->timer);
-			slpmsg->slpcall->timer = gaim_timeout_add(MSN_SLPCALL_TIMEOUT,
-													  msn_slp_call_timeout, slpmsg->slpcall);
-		}
+		slpmsg->slpcall->progress = TRUE;
 
 		if (slpmsg->slpcall->progress_cb != NULL)
 		{
@@ -683,6 +680,8 @@
 	slpcall->cb = msn_xfer_completed_cb;
 	slpcall->xfer = xfer;
 
+	slpcall->pending = TRUE;
+
 	gaim_xfer_set_cancel_send_fnc(xfer, msn_xfer_cancel);
 
 	xfer->data = slpcall;