Lines Matching refs:mimetype
301 char *mimetype, *charset, *content_type; in get_default_content_type() local
305 mimetype = SG(default_mimetype); in get_default_content_type()
308 mimetype = SAPI_DEFAULT_MIMETYPE; in get_default_content_type()
319 if (*charset && strncasecmp(mimetype, "text/", 5) == 0) { in get_default_content_type()
325 p = zend_mempcpy(p, mimetype, mimetype_len); in get_default_content_type()
331 memcpy(content_type + prefix_len, mimetype, mimetype_len + 1); in get_default_content_type()
365 SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len) in sapi_apply_default_charset() argument
371 if (*mimetype != NULL) { in sapi_apply_default_charset()
372 if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) { in sapi_apply_default_charset()
375 PHP_STRLCPY(newtype, *mimetype, newlen + 1, len); in sapi_apply_default_charset()
378 efree(*mimetype); in sapi_apply_default_charset()
379 *mimetype = newtype; in sapi_apply_default_charset()
397 SG(sapi_headers).mimetype = NULL; in sapi_activate_headers_only()
439 SG(sapi_headers).mimetype = NULL; in sapi_activate()
538 if (SG(sapi_headers).mimetype) { in sapi_deactivate_destroy()
539 efree(SG(sapi_headers).mimetype); in sapi_deactivate_destroy()
540 SG(sapi_headers).mimetype = NULL; in sapi_deactivate_destroy()
777 char *ptr = colon_offset+1, *mimetype = NULL, *newheader; in sapi_header_op() local
784 mimetype = estrdup(ptr); in sapi_header_op()
785 newlen = sapi_apply_default_charset(&mimetype, len); in sapi_header_op()
786 if (!SG(sapi_headers).mimetype){ in sapi_header_op()
787 SG(sapi_headers).mimetype = estrdup(mimetype); in sapi_header_op()
794 strlcat(newheader, mimetype, newlen); in sapi_header_op()
799 efree(mimetype); in sapi_header_op()
862 SG(sapi_headers).mimetype = default_mimetype; in sapi_send_headers()
868 memcpy(default_header.header + sizeof("Content-type: ") - 1, SG(sapi_headers).mimetype, len + 1); in sapi_send_headers()