From: hyc Date: Tue, 19 Jan 2010 02:26:45 +0000 (+0000) Subject: Allow zero swfAge to force HTTP check every time X-Git-Tag: v2.4~280 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aaafa1ef1081f55002fda75d5418bd0204f6e342;p=rtmpdump Allow zero swfAge to force HTTP check every time git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@240 400ebc74-4327-4243-bc38-086b20814532 --- diff --git a/hashswf.c b/hashswf.c index 3a5b86a..9e85199 100644 --- a/hashswf.c +++ b/hashswf.c @@ -327,7 +327,7 @@ RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int age) FILE *f = NULL; char *path, *home, date[64], cctim[64]; long pos = 0; - time_t ctim = 0, cnow; + time_t ctim = -1, cnow; int i, got = 0, ret = 0; unsigned int hlen; struct info in = {0}; @@ -426,7 +426,7 @@ RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int age) cnow = time(NULL); /* If we got a cache time, see if it's young enough to use directly */ - if (got && ctim) + if (age && ctim > 0) { ctim = cnow - ctim; ctim /= 3600 * 24; /* seconds to days */ diff --git a/rtmpdump.c b/rtmpdump.c index 8cd057f..731ef03 100644 --- a/rtmpdump.c +++ b/rtmpdump.c @@ -1398,9 +1398,9 @@ main(int argc, char **argv) case 'X': { int num = atoi(optarg); - if (num < 1) + if (num < 0) { - Log(LOGERROR, "SWF Age must be at least 1, ignoring\n"); + Log(LOGERROR, "SWF Age must be non-negative, ignoring\n"); } else { diff --git a/streams.c b/streams.c index b3f76f5..cad4fc9 100644 --- a/streams.c +++ b/streams.c @@ -1020,9 +1020,9 @@ ParseOption(char opt, char *arg, RTMP_REQUEST * req) case 'X': { int num = atoi(arg); - if (num <= 0) + if (num < 0) { - Log(LOGERROR, "SWF Age must be at least 1, ignoring\n"); + Log(LOGERROR, "SWF Age must be non-negative, ignoring\n"); } else {