On MSN, increase the history size for the NS so that people with lots of

Fri, 26 Jun 2009 01:28:09 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Fri, 26 Jun 2009 01:28:09 +0000
changeset 27405
fdbf18cfddc6
parent 27404
cd789cbbac97
child 27406
b11629198ea2

On MSN, increase the history size for the NS so that people with lots of
buddies on an unknown network (thus requiring many FQY/ADL requests) will
not lose the original request (causing a crash).

Fixes #8579.

libpurple/protocols/msn/cmdproc.c file | annotate | diff | comparison | revisions
libpurple/protocols/msn/history.c file | annotate | diff | comparison | revisions
libpurple/protocols/msn/history.h file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/cmdproc.c	Thu Jun 25 21:19:10 2009 +0000
+++ b/libpurple/protocols/msn/cmdproc.c	Fri Jun 26 01:28:09 2009 +0000
@@ -210,6 +210,7 @@
 
 	trans = g_new0(MsnTransaction, 1);
 
+	trans->cmdproc = cmdproc;
 	trans->command = g_strdup(command);
 
 	if (format != NULL)
--- a/libpurple/protocols/msn/history.c	Thu Jun 25 21:19:10 2009 +0000
+++ b/libpurple/protocols/msn/history.c	Fri Jun 26 01:28:09 2009 +0000
@@ -68,6 +68,7 @@
 msn_history_add(MsnHistory *history, MsnTransaction *trans)
 {
 	GQueue *queue;
+	int max_elems;
 
 	g_return_if_fail(history != NULL);
 	g_return_if_fail(trans   != NULL);
@@ -78,7 +79,12 @@
 
 	g_queue_push_tail(queue, trans);
 
-	if (queue->length > MSN_HIST_ELEMS)
+	if (trans->cmdproc->servconn->type == MSN_SERVCONN_NS)
+		max_elems = MSN_NS_HIST_ELEMS;
+	else
+		max_elems = MSN_SB_HIST_ELEMS;
+
+	if (queue->length > max_elems)
 	{
 		trans = g_queue_pop_head(queue);
 		msn_transaction_destroy(trans);
--- a/libpurple/protocols/msn/history.h	Thu Jun 25 21:19:10 2009 +0000
+++ b/libpurple/protocols/msn/history.h	Fri Jun 26 01:28:09 2009 +0000
@@ -24,7 +24,8 @@
 #ifndef _MSN_HISTORY_H
 #define _MSN_HISTORY_H
 
-#define MSN_HIST_ELEMS 0x30
+#define MSN_NS_HIST_ELEMS 0x300
+#define MSN_SB_HIST_ELEMS 0x30
 
 typedef struct _MsnHistory MsnHistory;
 

mercurial