X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/59ecd6cee1ac23b99873de3c4627a5f96c8f3817..27e45c4d7ab7139603ac3f62de10f44d1bb071a0:/src/gras/Transport/transport_plugin_tcp.c diff --git a/src/gras/Transport/transport_plugin_tcp.c b/src/gras/Transport/transport_plugin_tcp.c index 46638a3a6a..6fa9cb5ae1 100644 --- a/src/gras/Transport/transport_plugin_tcp.c +++ b/src/gras/Transport/transport_plugin_tcp.c @@ -24,7 +24,7 @@ #include "gras_private.h" #include "transport_private.h" -GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_tcp,transport); +GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_tcp,transport,"TCP transport"); /*** *** Prototypes @@ -42,7 +42,7 @@ gras_error_t gras_trp_tcp_socket_accept(gras_socket_t *sock, void gras_trp_tcp_socket_close(gras_socket_t *sd); gras_error_t gras_trp_tcp_chunk_send(gras_socket_t *sd, - char *data, + const char *data, long int size); gras_error_t gras_trp_tcp_chunk_recv(gras_socket_t *sd, @@ -77,7 +77,7 @@ typedef struct { gras_error_t gras_trp_tcp_setup(gras_trp_plugin_t *plug) { - gras_trp_tcp_plug_data_t *data = malloc(sizeof(gras_trp_tcp_plug_data_t)); + gras_trp_tcp_plug_data_t *data = gras_new(gras_trp_tcp_plug_data_t,1); if (!data) RAISE_MALLOC; @@ -92,6 +92,8 @@ gras_trp_tcp_setup(gras_trp_plugin_t *plug) { plug->chunk_send = gras_trp_tcp_chunk_send; plug->chunk_recv = gras_trp_tcp_chunk_recv; + plug->flush = NULL; /* nothing's cached */ + plug->data = (void*)data; plug->exit = gras_trp_tcp_exit; @@ -308,7 +310,7 @@ void gras_trp_tcp_socket_close(gras_socket_t *sock){ */ gras_error_t gras_trp_tcp_chunk_send(gras_socket_t *sock, - char *data, + const char *data, long int size) { /* TCP sockets are in duplex mode, don't check direction */