From 9f09eada24ea62a16a417e07d0ea7fd83cbb3639 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 28 Mar 2011 09:58:29 +0000 Subject: [PATCH] bug hunting --- src/transport/gnunet-service-transport.c | 35 ++++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 8c7906a71..e8ea352c7 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -48,8 +48,8 @@ #define DEBUG_TRANSPORT_HELLO GNUNET_YES -#define DEBUG_ATS GNUNET_NO -#define VERBOSE_ATS GNUNET_NO +#define DEBUG_ATS GNUNET_YES +#define VERBOSE_ATS GNUNET_YES /** * Should we do some additional checks (to validate behavior @@ -5558,8 +5558,8 @@ struct ATS_transports double c_1; }; -#if HAVE_LIBGLPK +#if HAVE_LIBGLPK static glp_prob * ats_create_problem (int peers, int transports, @@ -5580,12 +5580,14 @@ ats_create_problem (int peers, int rows = 1 + (3*peers) + (transports); int cols = peers; int index = 1; - int start = 0; + //int start = 0; int cur_row = 0; + int size = 1+(rows*cols); - int * ia = GNUNET_malloc (1+(rows*cols) * sizeof (int)); - int * ja = GNUNET_malloc (1+(rows*cols) * sizeof (int)); - double * ar = GNUNET_malloc(1+(rows*cols)* sizeof (double)); + + int * ia = GNUNET_malloc (size * sizeof (int)); + int * ja = GNUNET_malloc (size * sizeof (int)); + double * ar = GNUNET_malloc(size* sizeof (double)); double value; @@ -5628,7 +5630,6 @@ ats_create_problem (int peers, * V b_i in B: b_i <= b_max */ cur_row = 2; - start = index+1; for (c1=0; c1= b_min */ - start = index+1; for (c1=0; c1= r*f */ - start = index+1; for (c1=0; c1