[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-pre2-42-gf999603

Service Account git at mcs.anl.gov
Sun Feb 22 23:00:50 CST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".

The branch, dev-modular has been updated
       via  f999603f0a66c729d7a3163c3060a48012f4de55 (commit)
      from  56b12ca2d8bcb72045dd70bdee2d5bf63d6857c9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f999603f0a66c729d7a3163c3060a48012f4de55
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Sun Feb 22 23:00:29 2015 -0600

    darshan log decompression bug fix

-----------------------------------------------------------------------

Summary of changes:
 darshan-util/darshan-logutils.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)


Diff of changes:
diff --git a/darshan-util/darshan-logutils.c b/darshan-util/darshan-logutils.c
index a801157..0853730 100644
--- a/darshan-util/darshan-logutils.c
+++ b/darshan-util/darshan-logutils.c
@@ -620,12 +620,17 @@ static int darshan_decompress_buffer(char *comp_buf, int comp_buf_sz,
     char *decomp_buf, int *inout_decomp_buf_sz)
 {
     int ret;
+    int total_out = 0;
     z_stream tmp_stream;
 
     memset(&tmp_stream, 0, sizeof(tmp_stream));
     tmp_stream.zalloc = Z_NULL;
     tmp_stream.zfree = Z_NULL;
     tmp_stream.opaque = Z_NULL;
+    tmp_stream.next_in = comp_buf;
+    tmp_stream.avail_in = comp_buf_sz;
+    tmp_stream.next_out = decomp_buf;
+    tmp_stream.avail_out = *inout_decomp_buf_sz;
 
     /* initialize the zlib decompression parameters */
     /* TODO: check these parameters? */
@@ -636,13 +641,8 @@ static int darshan_decompress_buffer(char *comp_buf, int comp_buf_sz,
         return(-1);
     }
 
-    tmp_stream.next_in = comp_buf;
-    tmp_stream.avail_in = comp_buf_sz;
-    tmp_stream.next_out = decomp_buf;
-    tmp_stream.avail_out = *inout_decomp_buf_sz;
-
     /* while we have not finished consuming all of the compressed input data */
-    while(tmp_stream.total_in < comp_buf_sz)
+    while(tmp_stream.avail_in)
     {
         if(tmp_stream.avail_out == 0)
         {
@@ -655,16 +655,20 @@ static int darshan_decompress_buffer(char *comp_buf, int comp_buf_sz,
         }
 
         /* decompress data */
-        ret = inflate(&tmp_stream, Z_NO_FLUSH);
+        ret = inflate(&tmp_stream, Z_FINISH);
         if(ret != Z_STREAM_END)
         {
             inflateEnd(&tmp_stream);
             return(-1);
         }
+
+        total_out += tmp_stream.total_out;
+        if(tmp_stream.avail_in)
+            inflateReset(&tmp_stream);
     }
     inflateEnd(&tmp_stream);
 
-    *inout_decomp_buf_sz = tmp_stream.total_out;
+    *inout_decomp_buf_sz = total_out;
     return(0);
 }
 


hooks/post-receive
--



More information about the Darshan-commits mailing list