Przeglądaj źródła

- log error when a invalid dice_max value is found
- log error when a invalid hash value is found


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5226 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 17 lat temu
rodzic
commit
4181f828cc
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      modules/carrierroute/cr_func.c

+ 5 - 2
modules/carrierroute/cr_func.c

@@ -391,7 +391,8 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
 			}
 			break;
 		case alg_crc32:
-			if(rf->dice_max == 0){
+			if(rf->dice_max == 0) {
+				LM_ERR("invalid dice_max value\n");
 				return -1;
 			}
 			if ((prob = hash_func(msg, hash_source, rf->dice_max)) < 0) {
@@ -420,7 +421,9 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
 				}
 			}
 			break;
-		default: return -1;
+		default: 
+			LM_ERR("invalid hash algorithm\n");
+			return -1;
 	}
 	return actually_rewrite(rr, dest, msg, user, dstavp);
 }