[sr-dev] git:master:3e92a47f: rtpengine: cookie is now $server_id_$mypid_$myseqn

Lucian Balaceanu lucian.balaceanu at 1and1.ro
Thu Jun 2 17:35:59 CEST 2016


Module: kamailio
Branch: master
Commit: 3e92a47fb3c3f4fc97f7e3cdeb33f8b111c6b1f8
URL: https://github.com/kamailio/kamailio/commit/3e92a47fb3c3f4fc97f7e3cdeb33f8b111c6b1f8

Author: Lucian Balaceanu <lucian.balaceanu at 1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu at 1and1.ro>
Date: 2016-06-02T17:34:39+02:00

rtpengine: cookie is now $server_id_$mypid_$myseqn

---

Modified: modules/rtpengine/rtpengine.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3e92a47fb3c3f4fc97f7e3cdeb33f8b111c6b1f8.diff
Patch: https://github.com/kamailio/kamailio/commit/3e92a47fb3c3f4fc97f7e3cdeb33f8b111c6b1f8.patch

---

diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index a37ab6f..5fe83b0 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -2020,13 +2020,9 @@ static void mod_destroy(void)
 
 static char * gencookie(void)
 {
-	static char cook[COOKIE_SIZE];
-	char hostname[HOSTNAME_SIZE];
-
-	if (gethostname(hostname, HOSTNAME_SIZE - 1) < 0)
-		strcpy(hostname, "host");
-	snprintf(cook, COOKIE_SIZE, "%s_%d_%u ", hostname, (int)mypid, myseqn);
+	static char cook[34];
 
+	snprintf(cook, 34, "%d_%d_%u ", server_id, (int)mypid, myseqn);
 	myseqn++;
 	return cook;
 }




More information about the sr-dev mailing list