MCPcopy Create free account
hub / github.com/apache/httpd / analyze_ct

Function analyze_ct

modules/http/mod_mime.c:540–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540static content_type *analyze_ct(request_rec *r, const char *s)
541{
542 const char *cp, *mp;
543 char *attribute, *value;
544 int quoted = 0;
545 server_rec * ss = r->server;
546 apr_pool_t * p = r->pool;
547
548 content_type *ctp;
549 param *pp, *npp;
550
551 /* initialize ctp */
552 ctp = (content_type *)apr_palloc(p, sizeof(content_type));
553 ctp->type = NULL;
554 ctp->subtype = NULL;
555 ctp->param = NULL;
556
557 mp = s;
558
559 /* getting a type */
560 cp = mp;
561 while (apr_isspace(*cp)) {
562 cp++;
563 }
564 if (!*cp) {
565 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ss, APLOGNO(01598)
566 "mod_mime: analyze_ct: cannot get media type from '%s'",
567 (const char *) mp);
568 return (NULL);
569 }
570 ctp->type = cp;
571 do {
572 cp++;
573 } while (*cp && (*cp != '/') && !apr_isspace(*cp) && (*cp != ';'));
574 if (!*cp || (*cp == ';')) {
575 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ss, APLOGNO(01599)
576 "Cannot get media type from '%s'",
577 (const char *) mp);
578 return (NULL);
579 }
580 while (apr_isspace(*cp)) {
581 cp++;
582 }
583 if (*cp != '/') {
584 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ss, APLOGNO(01600)
585 "mod_mime: analyze_ct: cannot get media type from '%s'",
586 (const char *) mp);
587 return (NULL);
588 }
589 ctp->type_len = cp - ctp->type;
590
591 cp++; /* skip the '/' */
592
593 /* getting a subtype */
594 while (apr_isspace(*cp)) {
595 cp++;
596 }
597 if (!*cp) {

Callers 1

find_ctFunction · 0.85

Calls 6

zap_spFunction · 0.85
is_tokenFunction · 0.85
zap_sp_and_dupFunction · 0.85
is_qtextFunction · 0.85
is_quoted_pairFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected