From: David Barksdale Date: Tue, 29 Dec 2009 04:12:20 +0000 (+0000) Subject: Use ntohs where appropriate. X-Git-Tag: initial-import-from-subversion-38251~22995 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=11218d651a80bde8f05f720336698329895ba39c;p=oweals%2Fgnunet.git Use ntohs where appropriate. --- diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 5dc7b4dc0..af35d5a74 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -568,7 +568,7 @@ do_transmit (void *cls, size_t size, void *buf) { if (pm->is_welcome) { - if (size < (msize = htons (pm->msg->size))) + if (size < (msize = ntohs (pm->msg->size))) break; memcpy (cbuf, pm->msg, msize); cbuf += msize; @@ -578,7 +578,7 @@ do_transmit (void *cls, size_t size, void *buf) else { if (size < - sizeof (struct DataMessage) + (msize = htons (pm->msg->size))) + sizeof (struct DataMessage) + (msize = ntohs (pm->msg->size))) break; dm = (struct DataMessage *) cbuf; dm->header.size = htons (sizeof (struct DataMessage) + msize); @@ -627,7 +627,7 @@ process_pending_messages (struct Session *session) return; session->transmit_handle = GNUNET_SERVER_notify_transmit_ready (session->client, - htons (session-> + ntohs (session-> pending_messages->msg-> size) + (session->