From commits-return-8451-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Wed Jul 11 00:57:29 2007 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 92380 invoked from network); 11 Jul 2007 00:57:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jul 2007 00:57:28 -0000 Received: (qmail 12720 invoked by uid 500); 11 Jul 2007 00:57:31 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 12617 invoked by uid 500); 11 Jul 2007 00:57:30 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 12605 invoked by uid 99); 11 Jul 2007 00:57:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2007 17:57:30 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2007 17:57:27 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 54AB51A981A; Tue, 10 Jul 2007 17:57:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r555131 - /apr/apr-util/branches/mc-binary-protocol-dev/memcache/apr_memcache.c Date: Wed, 11 Jul 2007 00:57:07 -0000 To: commits@apr.apache.org From: pquerna@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070711005707.54AB51A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pquerna Date: Tue Jul 10 17:57:06 2007 New Revision: 555131 URL: http://svn.apache.org/viewvc?view=rev&rev=555131 Log: Fix iovec order and contents to align with the protocol document: This should move all command specific words to be before the variable length key. 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=555131&r1=555130&r2=555131 ============================================================================== --- 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:57:06 2007 @@ -609,7 +609,7 @@ apr_memcache_conn_t *conn; apr_status_t rv; apr_size_t written; - struct iovec vec[4]; + struct iovec vec[5]; int klen; apr_size_t key_size = strlen(key); @@ -638,21 +638,21 @@ vec[0].iov_base = &hdr; vec[0].iov_len = MC_HDR_LEN; - vec[1].iov_base = (void*)key; - vec[1].iov_len = key_size; - flags = htonl(flags); - vec[2].iov_base = (void*)&flags; - vec[2].iov_len = sizeof(apr_uint32_t); + vec[1].iov_base = (void*)&flags; + vec[1].iov_len = sizeof(apr_uint32_t); timeout = htonl(timeout); vec[2].iov_base = (void*)&timeout; vec[2].iov_len = sizeof(apr_uint32_t); - vec[3].iov_base = data; - vec[3].iov_len = data_size; + vec[3].iov_base = (void*)key; + vec[3].iov_len = key_size; + + vec[4].iov_base = data; + vec[4].iov_len = data_size; - rv = apr_socket_sendv(conn->sock, vec, 4, &written); + rv = apr_socket_sendv(conn->sock, vec, 5, &written); if (rv != APR_SUCCESS) { ms_bad_conn(ms, conn); @@ -930,14 +930,14 @@ vec[0].iov_base = &hdr; vec[0].iov_len = MC_HDR_LEN; - vec[1].iov_base = (void*)key; - vec[1].iov_len = klen; - tinc = htonl(inc); - vec[2].iov_base = (void*)&tinc; - vec[2].iov_len = sizeof(apr_uint32_t); + vec[1].iov_base = (void*)&tinc; + vec[1].iov_len = sizeof(apr_uint32_t); + vec[2].iov_base = (void*)key; + vec[2].iov_len = klen; + rv = apr_socket_sendv(conn->sock, vec, 3, &written); if (rv != APR_SUCCESS) {