monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[monit-dev] SIP.c - little modification


From: pierrick grasland
Subject: [monit-dev] SIP.c - little modification
Date: Fri, 22 Feb 2008 10:19:06 +0100

Hello,

I have made some additionnal test for sip.c, and I encounter a problem:
if we do 2 tests, one with udp and the other with tcp, the first test will pass, but the second test will be ignored, and be treated like a retransmission

(case of 2 tests within one second)

So, I join a little workaround for sip.c, in order to differenciate the 2 tests :

Index: sip.c
===================================================================
--- sip.c (revision 1)
+++ sip.c (revision 2)
@@ -90,6 +90,7 @@
   const char *myip;
   char *rport= "";
   char *proto;
+  int seed;
   
   ASSERT(s);
 
@@ -104,9 +105,11 @@
   case SOCK_DGRAM:
     transport="UDP";
     rport=";rport";
+ seed=1;
     break;
   case SOCK_STREAM:
     transport="TCP";
+ seed=2;
     break;
   default:
     LogError("Unsupported socket type, only TCP and UDP are supported\n");
@@ -116,7 +119,7 @@
   myip= socket_get_local_host(s);
 
   /* initialization of random param */
-  srand(time(NULL)+getpid());
+  srand(time(NULL)+getpid()+seed);
 
   if(socket_print(s,
   "OPTIONS %s:%s SIP/2.0\r\n"

--
Grasland Pierrick
ENSSAT LSI3
Tutorat NEXCOM Systems

Attachment: sip.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]