apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r555129 - /apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c
Date Wed, 11 Jul 2007 00:48:16 GMT
Author: pquerna
Date: Tue Jul 10 17:48:15 2007
New Revision: 555129

URL: http://svn.apache.org/viewvc?view=rev&rev=555129
Log:
Convert everything to network byte order.

Modified:
    apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c

Modified: apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c?view=diff&rev=555129&r1=555128&r2=555129
==============================================================================
--- apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c (original)
+++ apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c Tue Jul 10 17:48:15
2007
@@ -324,13 +324,15 @@
 
 static void finalize_req_hdr(apr_mc_hdr_t *hdr)
 {
-    /* XXXX: convert to network byte order */
-
+    /* this isn't strictly needed, but will be nicer for protocol analyzers */
+    hdr->opaque_id = htonl(hdr->opaque_id);
+    hdr->lenleft = htonl(hdr->lenleft);
 }
 
 static void repair_hdr_rep(apr_mc_hdr_t *hdr)
 {
-    /* XXXX: convert from network byte order */
+    hdr->opaque_id = ntohl(hdr->opaque_id);
+    hdr->lenleft = ntohl(hdr->lenleft);
 }
 
 static apr_status_t brigade_split_offset(apr_bucket_brigade *bbOut,



Mime
View raw message