[FFmpeg-devel] [PATCH] Ignore expired cookies

Micah Galizia micahgalizia at gmail.com
Sun Mar 26 01:27:45 EET 2017


On Sat, Mar 25, 2017 at 10:51 AM, wm4 <nfxjfg at googlemail.com> wrote:

<SNIP>

> This can overflow sizeof(exp_buf).

Sorry, new patch cleans that up.

>> +
>> +                // move the string beyond the day of week
>> +                i = 0;
>> +                while ((exp_buf[i] < '0' || exp_buf[i] > '9') && (i < j))
>> +                    i++;
>> +
>> +                if (av_small_strptime(&exp_buf[i], "%d%b%Y%H%M%SGMT", &tm_buf)) {
>> +                    time_t now = av_gettime() / 1000000;
>
> I don't know if av_gettime() has the same time base...

I had to double-check but I think it's correct as it is. The av_gettime() is based on the time since the epoch, which is already in GMT/UTC. The cookies timestamp is also expressed in GMT/UTC per the HTTP spec (and per av_timegm), so I believe these are comparable.

If you were not talking about the timezones when you said "same base", I'm not entirely sure what you're getting at. I tested on my system and av_gettime()/1000000 returns the same value as time(NULL).

Thanks again.


More information about the ffmpeg-devel mailing list