summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-03-19 20:43:16 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-03-19 20:43:16 +0000
commit5691e0e67f7a28e12382ad6f76c3fcf255559543 (patch)
treedda69487d0ee01e6907bfa7202787cc89bdd81c6 /src
parent7ff6a85ec83ee365c501f0d4a5a52097579de6ab (diff)
Fixed 64-bit cache read size.
Diffstat (limited to 'src')
-rw-r--r--src/htscache.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/htscache.c b/src/htscache.c
index a8fd2af..4ca81f2 100644
--- a/src/htscache.c
+++ b/src/htscache.c
@@ -214,6 +214,14 @@ struct cache_back_zip_entry {
line[0] = '\0'; \
} \
} while(0)
+#define ZIP_READFIELD_LLINT(line, value, refline, refvalue) do { \
+ if (line[0] != '\0' && strfield2(line, refline)) { \
+ LLint intval = 0; \
+ sscanf(value, LLintP, &intval); \
+ (refvalue) = intval; \
+ line[0] = '\0'; \
+ } \
+} while(0)
/* Ajout d'un fichier en cache */
@@ -654,7 +662,7 @@ static htsblk cache_readex_new(httrackp* opt,cache_back* cache,const char* adr,c
ZIP_READFIELD_INT(line, value, "X-In-Cache", dataincache);
ZIP_READFIELD_INT(line, value, "X-Statuscode", r.statuscode);
ZIP_READFIELD_STRING(line, value, "X-StatusMessage", r.msg); // msg
- ZIP_READFIELD_INT(line, value, "X-Size", r.size); // size
+ ZIP_READFIELD_LLINT(line, value, "X-Size", r.size); // size
ZIP_READFIELD_STRING(line, value, "Content-Type", r.contenttype); // contenttype
ZIP_READFIELD_STRING(line, value, "X-Charset", r.charset); // contenttype
ZIP_READFIELD_STRING(line, value, "Last-Modified", r.lastmodified); // last-modified