Ver código fonte

- tcp accounting: connections_no decreased on error
- parse_uri: missing break for r2
- tm: enabled tm stats

Andrei Pelinescu-Onciul 19 anos atrás
pai
commit
8f0e1af302
5 arquivos alterados com 7 adições e 5 exclusões
  1. 1 1
      modules/tm/t_stats.c
  2. 2 0
      parser/parse_uri.c
  3. 1 1
      route.h
  4. 2 2
      tcp_main.c
  5. 1 1
      ut.h

+ 1 - 1
modules/tm/t_stats.c

@@ -156,5 +156,5 @@ void tm_rpc_stats(rpc_t* rpc, void* c)
 			"4xx", tm_stats->completed_4xx,
 			"4xx", tm_stats->completed_4xx,
 			"3xx", tm_stats->completed_3xx,
 			"3xx", tm_stats->completed_3xx,
 			"2xx", tm_stats->completed_2xx);
 			"2xx", tm_stats->completed_2xx);
-	rpc->fault(c, 100, "Trying");
+	/* rpc->fault(c, 100, "Trying"); */
 }
 }

+ 2 - 0
parser/parse_uri.c

@@ -578,6 +578,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 					case 'R':
 					case 'R':
 						b=p;
 						b=p;
 						state=PR2_R;
 						state=PR2_R;
+						break;
 					default:
 					default:
 						state=URI_PARAM_P;
 						state=URI_PARAM_P;
 				}
 				}
@@ -1025,6 +1026,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 			uri->maddr.len, ZSW(uri->maddr.s), 
 			uri->maddr.len, ZSW(uri->maddr.s), 
 			uri->maddr_val.len, ZSW(uri->maddr_val.s));
 			uri->maddr_val.len, ZSW(uri->maddr_val.s));
 	DBG("   lr=<%.*s>\n", uri->lr.len, ZSW(uri->lr.s)); 
 	DBG("   lr=<%.*s>\n", uri->lr.len, ZSW(uri->lr.s)); 
+	DBG("   r2=<%.*s>\n", uri->r2.len, ZSW(uri->r2.s));
 #endif
 #endif
 	return 0;
 	return 0;
 	
 	

+ 1 - 1
route.h

@@ -45,7 +45,7 @@
 struct route_list{
 struct route_list{
 	struct action** rlist;
 	struct action** rlist;
 	int idx; /* first empty entry */ 
 	int idx; /* first empty entry */ 
-	int entries; /* total number if entries */
+	int entries; /* total number of entries */
 	struct str_hash_table names; /* name to route index mappings */
 	struct str_hash_table names; /* name to route index mappings */
 };
 };
 
 

+ 2 - 2
tcp_main.c

@@ -1473,12 +1473,12 @@ static inline int handle_new_connect(struct socket_info* si)
 		close(new_sock);
 		close(new_sock);
 		return 1; /* success, because the accept was succesfull */
 		return 1; /* success, because the accept was succesfull */
 	}
 	}
-	(*tcp_connections_no)++;
 	if (init_sock_opt(new_sock)<0){
 	if (init_sock_opt(new_sock)<0){
 		LOG(L_ERR, "ERROR: handle_new_connect: init_sock_opt failed\n");
 		LOG(L_ERR, "ERROR: handle_new_connect: init_sock_opt failed\n");
 		close(new_sock);
 		close(new_sock);
 		return 1; /* success, because the accept was succesfull */
 		return 1; /* success, because the accept was succesfull */
 	}
 	}
+	(*tcp_connections_no)++;
 	
 	
 	/* add socket to list */
 	/* add socket to list */
 	tcpconn=tcpconn_new(new_sock, &su, si, si->proto, S_CONN_ACCEPT);
 	tcpconn=tcpconn_new(new_sock, &su, si, si->proto, S_CONN_ACCEPT);
@@ -1504,7 +1504,7 @@ static inline int handle_new_connect(struct socket_info* si)
 		LOG(L_ERR, "ERROR: handle_new_connect: tcpconn_new failed, "
 		LOG(L_ERR, "ERROR: handle_new_connect: tcpconn_new failed, "
 				"closing socket\n");
 				"closing socket\n");
 		close(new_sock);
 		close(new_sock);
-		
+		(*tcp_connections_no)--;
 	}
 	}
 	return 1; /* accept() was succesfull */
 	return 1; /* accept() was succesfull */
 }
 }

+ 1 - 1
ut.h

@@ -143,7 +143,7 @@ static inline unsigned short str2s(const char* s, unsigned int len,
 				i++;
 				i++;
 				if (i>5) goto error_digits;
 				if (i>5) goto error_digits;
 		}else{
 		}else{
-				//error unknown char
+				/* error unknown char */
 				goto error_char;
 				goto error_char;
 		}
 		}
 	}
 	}