Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the gras_socket_server_range function: only return the tested socket when it...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 27 Jun 2006 21:22:22 +0000 (21:22 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 27 Jun 2006 21:22:22 +0000 (21:22 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2456 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Transport/transport.c

index 46bcf37..623884d 100644 (file)
@@ -244,21 +244,22 @@ gras_socket_t
 gras_socket_server_range(unsigned short minport, unsigned short maxport,
                         unsigned long int buf_size, int measurement) {
    
-   int port;
-   gras_socket_t res=NULL;
-   xbt_ex_t e;
-   
-   for (port=minport; port<maxport;port ++) {
-      TRY {
-        res=gras_socket_server_ext(port,buf_size,measurement);
-      } CATCH(e) {
-        if (port==maxport)
-          RETHROW;
-        xbt_ex_free(e);
-      }
+  int port;
+  gras_socket_t res=NULL;
+  xbt_ex_t e;
+  
+  for (port=minport; port<maxport;port ++) {
+    TRY {
+      res=gras_socket_server_ext(port,buf_size,measurement);
+    } CATCH(e) {
+      if (port==maxport)
+       RETHROW;
+      xbt_ex_free(e);
+    }
+    if (res)
       return res;
-   }
-   THROW_IMPOSSIBLE;
+  }
+  THROW_IMPOSSIBLE;
 }
    
 /**