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

Function tryit

modules/metadata/mod_mime_magic.c:878–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876
877
878static int tryit(request_rec *r, unsigned char *buf, apr_size_t nb,
879 int checkzmagic)
880{
881 /*
882 * Try compression stuff
883 */
884 if (checkzmagic == 1) {
885 if (zmagic(r, buf, nb) == 1)
886 return OK;
887 }
888
889 /*
890 * try tests in /etc/magic (or surrogate magic file)
891 */
892 if (softmagic(r, buf, nb) == 1)
893 return OK;
894
895 /*
896 * try known keywords, check for ascii-ness too.
897 */
898 if (ascmagic(r, buf, nb) == 1)
899 return OK;
900
901 /*
902 * abandon hope, all ye who remain here
903 */
904 return DECLINED;
905}
906
907#define EATAB {while (apr_isspace(*l)) ++l;}
908

Callers 2

magic_processFunction · 0.85
zmagicFunction · 0.85

Calls 3

zmagicFunction · 0.85
softmagicFunction · 0.85
ascmagicFunction · 0.85

Tested by

no test coverage detected