aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/cosine.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/cosine.c
parentf65cb5f27bab6310e847f88cd763eb08bff1c93b (diff)
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/cosine.c')
-rw-r--r--wiretap/cosine.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index 022667a357..9121861b3c 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -294,7 +294,6 @@ int cosine_open(wtap *wth, int *err, gchar **err_info)
if (file_seek(wth->fh, 0L, SEEK_SET, err) == -1) /* rewind */
return -1;
- wth->data_offset = 0;
wth->file_encap = WTAP_ENCAP_COSINE;
wth->file_type = WTAP_FILE_COSINE;
wth->snapshot_length = 0; /* not known */
@@ -334,7 +333,6 @@ static gboolean cosine_read(wtap *wth, int *err, gchar **err_info,
err_info)) == -1)
return FALSE;
- wth->data_offset = offset;
wth->phdr.presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN;
wth->phdr.caplen = caplen;
*data_offset = offset;