Browse Source

Fixed limits for db test [1,500].

David Moreno 11 years ago
parent
commit
efa78a7183
1 changed files with 4 additions and 0 deletions
  1. 4 0
      onion/hello.c

+ 4 - 0
onion/hello.c

@@ -90,6 +90,10 @@ onion_connection_status return_db(MYSQL *db, onion_request *req, onion_response
 	char *error;
 	const char *nqueries_str=onion_request_get_query(req,"queries");
 	int queries=(nqueries_str) ? atoi(nqueries_str) : 1;
+	if (queries<=0)
+		queries=1;
+	else if (queries>500)
+		queries=500;
 
 	json_object *json=json_object_new_object();
 	json_object *array=json_object_new_array();