Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC9AA10A4D for ; Fri, 8 Nov 2013 20:48:40 +0000 (UTC) Received: (qmail 47936 invoked by uid 500); 8 Nov 2013 20:48:40 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 47874 invoked by uid 500); 8 Nov 2013 20:48:40 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 47867 invoked by uid 99); 8 Nov 2013 20:48:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 20:48:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 20:48:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E99BF2388900; Fri, 8 Nov 2013 20:48:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1540178 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Date: Fri, 08 Nov 2013 20:48:16 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131108204816.E99BF2388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Fri Nov 8 20:48:16 2013 New Revision: 1540178 URL: http://svn.apache.org/r1540178 Log: Allow for backwards compatibility for the md5 check... if we've read the slotmem data and we are at EOF, then don't bother checking the md5 and assume all is OK. Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=1540178&r1=1540177&r2=1540178&view=diff ============================================================================== --- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original) +++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Fri Nov 8 20:48:16 2013 @@ -234,15 +234,25 @@ static apr_status_t restore_slotmem(void pool); if (rv == APR_SUCCESS) { rv = apr_file_read(fp, ptr, &nbytes); - if (rv == APR_SUCCESS) { - rv = apr_file_gets(digest, APR_MD5_DIGESTSIZE, fp); - if (rv == APR_SUCCESS) { - apr_md5((unsigned char*)digest2, ptr, nbytes); - if (!strcasecmp(digest, digest2)) { - rv = APR_EGENERAL; + if ((rv == APR_SUCCESS || rv == APR_EOF) && nbytes == size) { + /* + * if at EOF, don't bother checking md5 + * - backwards compatibility + * */ + if (apr_file_eof(fp) != APR_EOF) { + rv = apr_file_gets(digest, APR_MD5_DIGESTSIZE, fp); + if (rv == APR_SUCCESS) { + apr_md5((unsigned char*)digest2, ptr, nbytes); + if (!strcasecmp(digest, digest2)) { + rv = APR_EGENERAL; + } } } } + else if (nbytes != size) { + /* didn't get it all */ + rv = APR_EGENERAL; + } apr_file_close(fp); } }