| 876 | |
| 877 | |
| 878 | static 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 |
no test coverage detected