Lines Matching refs:mimetype
307 char *mimetype, *charset, *content_type; in get_default_content_type() local
311 mimetype = SG(default_mimetype); in get_default_content_type()
314 mimetype = SAPI_DEFAULT_MIMETYPE; in get_default_content_type()
325 if (*charset && strncasecmp(mimetype, "text/", 5) == 0) { in get_default_content_type()
331 memcpy(p, mimetype, mimetype_len); in get_default_content_type()
339 memcpy(content_type + prefix_len, mimetype, mimetype_len + 1); in get_default_content_type()
373 SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len) in sapi_apply_default_charset() argument
379 if (*mimetype != NULL) { in sapi_apply_default_charset()
380 if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) { in sapi_apply_default_charset()
383 PHP_STRLCPY(newtype, *mimetype, newlen + 1, len); in sapi_apply_default_charset()
386 efree(*mimetype); in sapi_apply_default_charset()
387 *mimetype = newtype; in sapi_apply_default_charset()
405 SG(sapi_headers).mimetype = NULL; in sapi_activate_headers_only()
447 SG(sapi_headers).mimetype = NULL; in sapi_activate()
537 if (SG(sapi_headers).mimetype) { in sapi_deactivate()
538 efree(SG(sapi_headers).mimetype); in sapi_deactivate()
539 SG(sapi_headers).mimetype = NULL; in sapi_deactivate()
772 char *ptr = colon_offset+1, *mimetype = NULL, *newheader; in sapi_header_op() local
786 mimetype = estrdup(ptr); in sapi_header_op()
787 newlen = sapi_apply_default_charset(&mimetype, len); in sapi_header_op()
788 if (!SG(sapi_headers).mimetype){ in sapi_header_op()
789 SG(sapi_headers).mimetype = estrdup(mimetype); in sapi_header_op()
796 strlcat(newheader, mimetype, newlen); in sapi_header_op()
801 efree(mimetype); in sapi_header_op()
864 SG(sapi_headers).mimetype = default_mimetype; in sapi_send_headers()
870 memcpy(default_header.header + sizeof("Content-type: ") - 1, SG(sapi_headers).mimetype, len + 1); in sapi_send_headers()