From: mquinson Date: Wed, 10 Oct 2007 22:42:59 +0000 (+0000) Subject: Display hexa representation of the borken header if any, since it's often binary... X-Git-Tag: v3.3~991 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/703e84799670334e2fefde2af17dd93ea8c4fc13?ds=sidebyside Display hexa representation of the borken header if any, since it's often binary garbage git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4800 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Msg/rl_msg.c b/src/gras/Msg/rl_msg.c index a4c4e160d5..273c3a9620 100644 --- a/src/gras/Msg/rl_msg.c +++ b/src/gras/Msg/rl_msg.c @@ -71,6 +71,9 @@ void gras_msg_send_ext(gras_socket_t sock, gras_trp_flush(sock); } +const char *hexa_str(unsigned char *data, int size, int downside); + + /* * receive the next message on the given socket. */ @@ -110,8 +113,8 @@ gras_msg_recv(gras_socket_t sock, for (cpt=0; cpt<4; cpt++) if (header[cpt] != _GRAS_header[cpt]) THROW2(mismatch_error,0, - "Incoming bytes do not look like a GRAS message (header='%.4s' not '%.4s')", - header,_GRAS_header); + "Incoming bytes do not look like a GRAS message (header='%s' not '%.4s')", + hexa_str((unsigned char*)header,4,0),_GRAS_header); if (header[4] != _GRAS_header[4]) THROW2(mismatch_error,0,"GRAS protocol mismatch (got %d, use %d)", (int)header[4], (int)_GRAS_header[4]);