summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2022-04-07 22:33:38 -0500
committerGary Kramlich <grim@reaperworld.com>2022-04-07 22:33:38 -0500
commit7f5f333aa5591aff2ca1d93157a76836592cecc0 (patch)
tree5d56fbd3b5b716a8ecfe203c915ee3536837eb2d
parent1c00df4631d344914a1cc601d9e4b1488e3fa34f (diff)
downloadpidgin-7f5f333aa5591aff2ca1d93157a76836592cecc0.tar.gz
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/
-rw-r--r--COPYRIGHT1
-rw-r--r--libpurple/protocols/simple/simple.c19
2 files changed, 19 insertions, 1 deletions
diff --git a/COPYRIGHT b/COPYRIGHT
index e46d8e3b0d..3ccb441751 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -154,6 +154,7 @@ Chandrakant Dhutadmal
Andrew Dieffenbach
Ingmārs Dīriņš
Finlay Dobbie
+dohmniq
Mark Doliner
Nuno Donato
Jim Duchek
diff --git a/libpurple/protocols/simple/simple.c b/libpurple/protocols/simple/simple.c
index b78a99ce03..149c09f792 100644
--- a/libpurple/protocols/simple/simple.c
+++ b/libpurple/protocols/simple/simple.c
@@ -620,6 +620,11 @@ static struct transaction *transactions_find(struct simple_account_data *sip, st
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 @@ static void process_input_message(struct simple_account_data *sip, struct sipmsg
/* 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 @@ static void process_input_message(struct simple_account_data *sip, struct sipmsg
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.