Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix a vicious bug: TCP socket use a buffer and read operation get as much data as...
[simgrid.git] / src / gras / Transport / transport.c
index a4ca069..aff786e 100644 (file)
@@ -8,7 +8,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/ex.h"
-#include "xbt/host.h"
+#include "xbt/peer.h"
 #include "portable.h"
 #include "gras/Transport/transport_private.h"
 
@@ -160,6 +160,7 @@ void gras_trp_socket_new(int incoming,
   sock->meas = 0;
   sock->recv_ok = 1;
   sock->valid = 1;
+  sock->moredata = 0;
 
   sock->sd     = -1;
   sock->port      = -1;
@@ -173,7 +174,7 @@ void gras_trp_socket_new(int incoming,
   *dst = sock;
 
   xbt_dynar_push(((gras_trp_procdata_t) 
-                    gras_libdata_by_id(gras_trp_libdata_id))->sockets,dst);
+                 gras_libdata_by_id(gras_trp_libdata_id))->sockets,dst);
   XBT_OUT;
 }
  
@@ -330,9 +331,9 @@ gras_socket_client(const char *host,
 /** @brief Opens a client socket to a remote host specified as '\a host:\a port' */
 gras_socket_t
 gras_socket_client_from_string(const char *host) {
-   xbt_host_t h = xbt_host_from_string(host);
-   gras_socket_t res = gras_socket_client_ext(h->name,h->port,0,0);
-   xbt_host_free(h);
+   xbt_peer_t p = xbt_peer_from_string(host);
+   gras_socket_t res = gras_socket_client_ext(p->name,p->port,0,0);
+   xbt_peer_free(p);
    return res;
 }