pidgin/pidgin

acd1360af5cb
Parents 17237faf35cb
Children f20e9970a54f
Patch from dohmniq to properly increment the CSeq numbers in SIMPLE.

Testing Done:
Compiled

Bugs closed: PIDGIN-9675

Reviewed at https://reviews.imfreedom.org/r/1379/
--- a/COPYRIGHT Fri Mar 04 00:08:27 2022 -0600
+++ b/COPYRIGHT Thu Apr 07 22:33:38 2022 -0500
@@ -154,6 +154,7 @@
Andrew Dieffenbach
Ingmārs Dīriņš
Finlay Dobbie
+dohmniq
Mark Doliner
Nuno Donato
Jim Duchek
--- a/libpurple/protocols/simple/simple.c Fri Mar 04 00:08:27 2022 -0600
+++ b/libpurple/protocols/simple/simple.c Thu Apr 07 22:33:38 2022 -0500
@@ -620,6 +620,11 @@
if (cseq) {
while(transactions) {
trans = transactions->data;
+
+ purple_debug_info("simple",
+ "received CSeq %s vs known transaction CSeq %s\n",
+ cseq, trans->cseq);
+
if(purple_strequal(trans->cseq, cseq)) {
return trans;
}
@@ -1570,7 +1575,7 @@
/* This is encountered when a generic (MESSAGE, NOTIFY, etc)
* was denied until further authorization is provided.
*/
- gchar *resend, *auth;
+ gchar *resend, *auth, *cseq;
const gchar *ptmp;
if(sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) return;
@@ -1583,10 +1588,22 @@
sipmsg_remove_header(trans->msg, "Authorization");
sipmsg_add_header(trans->msg, "Authorization", auth);
g_free(auth);
+
+ /* bump cseq */
+ sipmsg_remove_header(trans->msg, "CSeq");
+ sip->cseq++;
+ cseq = g_strdup_printf("%d %s", sip->cseq, trans->msg->method);
+ sipmsg_add_header(trans->msg, "CSeq", cseq);
+ g_free(cseq);
+ trans->cseq = sipmsg_find_header(trans->msg, "CSeq");
+
resend = sipmsg_to_string(trans->msg);
/* resend request */
sendout_pkt(sip->gc, resend);
g_free(resend);
+
+ /* exit here - no need to call callback, don't remove trans */
+ return;
} else {
/* Reset any count of retries that may have
* accumulated in the above branch.