-fixing #2345
authorChristian Grothoff <christian@grothoff.org>
Mon, 14 May 2012 11:40:17 +0000 (11:40 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 14 May 2012 11:40:17 +0000 (11:40 +0000)
src/fs/fs_download.c

index 43cd5264bce7123cf11016e6e3a86adb5659a1f9..4def42545d7508d97886f2803910942931d95962 100644 (file)
@@ -1535,6 +1535,7 @@ create_download_request (struct DownloadRequest *parent,
     if (dr->num_children * child_block_size <
         file_start_offset + desired_length - dr_offset)
       dr->num_children++;       /* round up */
+    dr->num_children -= head_skip;
     if (dr->num_children > CHK_PER_INODE)
       dr->num_children = CHK_PER_INODE; /* cap at max */
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1544,7 +1545,6 @@ create_download_request (struct DownloadRequest *parent,
                dr->num_children);
 
     /* now we can get the total number of *interesting* children for this block */
-    dr->num_children -= head_skip;
 
     /* why else would we have gotten here to begin with? (that'd be a bad logic error) */
     GNUNET_assert (dr->num_children > 0);