Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: Made mention of the include directive.
[ashd.git]
/
src
/
sendfile.c
diff --git
a/src/sendfile.c
b/src/sendfile.c
index
f148196
..
81fb67a
100644
(file)
--- a/
src/sendfile.c
+++ b/
src/sendfile.c
@@
-92,7
+92,7
@@
static char *attrmimetype(char *file)
return(NULL);
found:
for(i = 0; i < sz; i++) {
return(NULL);
found:
for(i = 0; i < sz; i++) {
- if((buf[
sz] < 32) || (buf[sz
] >= 128))
+ if((buf[
i] < 32) || (buf[i
] >= 128))
return(NULL);
}
buf[sz] = 0;
return(NULL);
}
buf[sz] = 0;
@@
-271,13
+271,20
@@
int main(int argc, char **argv)
simpleerror(1, 500, "Internal Error", "The server could not access its own data.");
exit(1);
}
simpleerror(1, 500, "Internal Error", "The server could not access its own data.");
exit(1);
}
+ if(!strcasecmp(argv[optind], "get")) {
+ ishead = 0;
+ } else if(!strcasecmp(argv[optind], "head")) {
+ ishead = 1;
+ } else {
+ simpleerror(1, 405, "Method not allowed", "The requested method is not defined for this resource.");
+ return(0);
+ }
if(contype == NULL)
contype = getmimetype(file, &sb);
contype = ckctype(contype);
checkcache(file, &sb);
if(contype == NULL)
contype = getmimetype(file, &sb);
contype = ckctype(contype);
checkcache(file, &sb);
- ishead = !strcasecmp(argv[optind], "head");
if((hdr = getenv("REQ_RANGE")) != NULL)
sendrange(fd, &sb, contype, hdr, ishead);
else
if((hdr = getenv("REQ_RANGE")) != NULL)
sendrange(fd, &sb, contype, hdr, ishead);
else