]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_httapi: Fix Cache-Control max-age= parameter string (length) check
authorStefan Knoblich <stkn@openisdn.net>
Fri, 6 Jan 2012 22:08:45 +0000 (23:08 +0100)
committerStefan Knoblich <stkn@openisdn.net>
Fri, 6 Jan 2012 22:08:45 +0000 (23:08 +0100)
This is probably what you had in mind...

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
src/mod/applications/mod_httapi/mod_httapi.c

index e88ce1d5c7ec4724a74a9502889c8aaf0f8a0984..ae87ad5c407f8c126ea6f7726c29127bd7c5f7ba 100644 (file)
@@ -1949,7 +1949,7 @@ static switch_status_t write_meta_file(http_file_context_t *context, const char
                if (headers && (cc = switch_event_get_header(headers, "Cache-Control")) && (p = switch_stristr("max-age=", cc))) {
                        p += 8;
                        
-                       if (p) {
+                       if (!zstr(p)) {
                                ttl = atoi(p);
                                if (ttl < 0) ttl = globals.cache_ttl;
                        }