Commit 2614ab75 authored by Yann Ylavic's avatar Yann Ylavic
Browse files

mod_slotmem_shm: follow up to r1831869: fix persisted file size's checksum.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831935 13f79535-47bb-0310-9956-ffa450edef68
parent fdb2f920
Loading
Loading
Loading
Loading
+3 −3
Changes for modules/slotmem/mod_slotmem_shm.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ static apr_status_t restore_slotmem(sharedslotdesc_t *desc,
    apr_file_t *fp;
    apr_status_t rv = APR_ENOTIMPL;
    void *ptr = (char *)desc + AP_SLOTMEM_OFFSET;
    apr_size_t dsize = size - AP_SLOTMEM_OFFSET;
    apr_size_t nbytes = size - AP_SLOTMEM_OFFSET;
    unsigned char digest[APR_MD5_DIGESTSIZE];
    unsigned char digest2[APR_MD5_DIGESTSIZE];
    char desc_buf[AP_SLOTMEM_OFFSET];
@@ -212,7 +212,7 @@ static apr_status_t restore_slotmem(sharedslotdesc_t *desc,
        rv = apr_file_open(&fp, storename, APR_READ | APR_WRITE, APR_OS_DEFAULT,
                           pool);
        if (rv == APR_SUCCESS) {
            rv = apr_file_read_full(fp, ptr, dsize, NULL);
            rv = apr_file_read_full(fp, ptr, nbytes, NULL);
            if (rv == APR_SUCCESS || rv == APR_EOF) {
                rv = APR_SUCCESS;   /* for successful return @ EOF */
                /*
@@ -222,7 +222,7 @@ static apr_status_t restore_slotmem(sharedslotdesc_t *desc,
                if (apr_file_eof(fp) != APR_EOF) {
                    rv = apr_file_read_full(fp, digest, APR_MD5_DIGESTSIZE, NULL);
                    if (rv == APR_SUCCESS || rv == APR_EOF) {
                        apr_md5(digest2, ptr, APR_MD5_DIGESTSIZE);
                        apr_md5(digest2, ptr, nbytes);
                        if (memcmp(digest, digest2, APR_MD5_DIGESTSIZE)) {
                            rv = APR_EMISMATCH;
                        }