summaryrefslogtreecommitdiff
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-04 16:56:18 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-04 16:56:18 +0000
commit33bb54a9452f4be53377a185195a63194016241a (patch)
tree9308829e2105b6e51e0dc5cc0af2295d8d97a0a3 /wiretap/file_access.c
parentf65cb5f27bab6310e847f88cd763eb08bff1c93b (diff)
downloadwireshark-33bb54a9452f4be53377a185195a63194016241a.tar.gz
file_seek() used to be a wrapper around fseek() or gzseek(), both of
which could use lseek() and were thus expensive due to system call overhead. To avoid making a system call for every packet on a sequential read, we maintained a data_offset field in the wtap structure for sequential reads. It's now a routine that just returns information from the FILE_T data structure, so it's cheap. Use it, rather than maintaining the data_offset field. Readers for some file formats need to maintain file offset themselves; have them do so in their private data structures. svn path=/trunk/; revision=42423
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index 3178bff1ca..c823098f52 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -343,7 +343,6 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
/* initialization */
wth->file_encap = WTAP_ENCAP_UNKNOWN;
- wth->data_offset = 0;
wth->subtype_sequential_close = NULL;
wth->subtype_close = NULL;
wth->tsprecision = WTAP_FILE_TSPREC_USEC;
@@ -374,7 +373,6 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
g_free(wth);
return NULL;
}
- wth->data_offset = 0;
switch ((*open_routines[i])(wth, err, err_info)) {