Explorar o código

modules_k/rr: handle outbound failing and outbound just not being used as separate cases

Peter Dunkley %!s(int64=12) %!d(string=hai) anos
pai
achega
9d9394d63c
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      modules_k/rr/loose.c

+ 10 - 3
modules_k/rr/loose.c

@@ -502,13 +502,22 @@ static char uri_buf[MAX_ROUTE_URI_LEN];
 static inline int process_outbound(struct sip_msg *_m, str flow_token,
 		str *dst_uri)
 {
+	int ret;
 	struct receive_info rcv;
 	struct socket_info *si;
 
 	if (!rr_obb.decode_flow_token)
 		return 0;
 
-	if (rr_obb.decode_flow_token(&rcv, flow_token) == 0) {
+	ret = rr_obb.decode_flow_token(&rcv, flow_token);
+
+	if (ret == -2) {
+		LM_INFO("no flow token found - outbound not in use\n");
+		return 0;
+	} else if (ret == -1) {
+		LM_ERR("failed to decode flow token\n");
+		return -1;
+	} else {
 
 		/* First, force the local socket */
 		si = find_si(&rcv.dst_ip, rcv.dst_port, rcv.proto);
@@ -539,8 +548,6 @@ static inline int process_outbound(struct sip_msg *_m, str flow_token,
 
 		return 1;
 	}
-
-	return 0;
 }
 
 /*!