Переглянути джерело

Merge branch 'master' of ssh://git.sip-router.org/sip-router into 32plus

* 'master' of ssh://git.sip-router.org/sip-router:
  acc(k): Remove double #define.
  modules:sipcapture: fixed len of SIP message for hep callback function
  kamutil: Improve README.
Juha Heinanen 14 роки тому
батько
коміт
fad6afb8c2
3 змінених файлів з 9 додано та 10 видалено
  1. 6 6
      modules/sipcapture/sipcapture.c
  2. 0 2
      modules_k/acc/acc.h
  3. 3 2
      utils/kamctl/README

+ 6 - 6
modules/sipcapture/sipcapture.c

@@ -611,7 +611,7 @@ int hep_msg_received(void *data)
 
 	void **srevp;
 	char *buf;
-	unsigned len;
+	unsigned *len;
 	struct receive_info *ri;
 	
 	int offset = 0, hl;
@@ -632,14 +632,14 @@ int hep_msg_received(void *data)
 	srevp = (void**)data;
 	        
 	buf = (char *)srevp[0];
-	len = *((unsigned *)srevp[1]);
+	len = (unsigned *)srevp[1];
 	ri = (struct receive_info *)srevp[2];
 
 
 	hl = offset = sizeof(struct hep_hdr);
-        end = buf + len;
-        if (unlikely(len<offset)) {
-        	LOG(L_ERR, "ERROR: sipcapture:hep_msg_received len less than offset [%i] vs [%i]\n", len, offset);
+        end = buf + *len;
+        if (unlikely(*len<offset)) {
+        	LOG(L_ERR, "ERROR: sipcapture:hep_msg_received len less than offset [%i] vs [%i]\n", *len, offset);
                 return -1;
         }
 
@@ -737,7 +737,7 @@ int hep_msg_received(void *data)
         ri->dst_port = ntohs(heph->hp_dport);
 
 	/* cut off the offset */
-        len -= offset;
+        *len -= offset;
         p = buf + offset;
         memmove(buf, p, BUF_SIZE+1);
 	

+ 0 - 2
modules_k/acc/acc.h

@@ -41,8 +41,6 @@
 #ifndef _ACC_ACC_H_
 #define _ACC_ACC_H_
 
-#define ACC_CORE_LEN 6
-
 /* leading text for a request accounted from a script */
 #define ACC "ACC: "
 #define ACC_REQUEST ACC"request accounted: "

+ 3 - 2
utils/kamctl/README

@@ -2,5 +2,6 @@ SQL creation *must* follow the naming pattern
 
   <tablename>-create.sql
 
-Note that dashes ("-") in <tablename> must be replaced by underscores
-("_").
+where <tablename> corresponds to the name of the database table. Please use
+underscores ("_") instead of dashes ("-") in database table names to ensure
+compatibility with all types of databases.