Hi,
* MP <t...@centrum.cz> [2011-04-17 19:47]:
> tcpxtract calls sync() after extracting each packet of data to one of the 
> output files.
> This has as a result of huge harddisk activity even when both source and 
> destination lies in ramdisk (tmpfs)
> 
> Once sync() calls get removed using attached patch, time to extract files 
> from a 10 mb stream decreases from
> several minutes (during which harddisk emits loud noise) to about a second.

Wow you are right. I also don't see why this call is made there. Instead of 
removing it completely, what do you think about:
--- a/extract.c
+++ b/extract.c
@@ -163,7 +163,6 @@ static void extract_segment(extract_list_t *elist, const 
uint8_t *data)
         error("Quiting.");
     }
     elist->nwritten += nbytes;
-    sync();
 }
 
 /* remove all finished extracts from the list */
@@ -182,6 +181,8 @@ static void sweep_extract_list(extract_list_t **elist)
                 eptr->next->prev = eptr->prev;
             if (*elist == eptr)
                 *elist = eptr->next;
+
+            sync();
             close(eptr->fd);
             free(eptr);
         }

Cheers
Nico
-- 
Nico Golde - http://www.ngolde.de - n...@jabber.ccc.de - GPG: 0xA0A0AAAA
For security reasons, all text in this mail is double-rot13 encrypted.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to