projects
/
fms.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
version 0.2.1
[fms.git]
/
libs
/
shttpd
/
io_file.c
diff --git
a/libs/shttpd/io_file.c
b/libs/shttpd/io_file.c
index
d2b3fb6
..
1dce074
100644
(file)
--- a/
libs/shttpd/io_file.c
+++ b/
libs/shttpd/io_file.c
@@
-98,8
+98,8
@@
get_file(struct conn *c, struct stat *stp)
const char *fmt = "%a, %d %b %Y %H:%M:%S GMT", *msg = "OK";
big_int_t cl; /* Content-Length */
const char *fmt = "%a, %d %b %Y %H:%M:%S GMT", *msg = "OK";
big_int_t cl; /* Content-Length */
- if (c->mime_type
== NULL
)
- c->mime_type = get_mime_type(c->ctx, c->uri, strlen(c->uri));
+ if (c->mime_type
.len == 0
)
+ get_mime_type(c->ctx, c->uri, strlen(c->uri), &c->mime_type);
cl = (big_int_t) stp->st_size;
/* If Range: header specified, act accordingly */
cl = (big_int_t) stp->st_size;
/* If Range: header specified, act accordingly */
@@
-131,11
+131,12
@@
get_file(struct conn *c, struct stat *stp)
"Date: %s\r\n"
"Last-Modified: %s\r\n"
"Etag: \"%s\"\r\n"
"Date: %s\r\n"
"Last-Modified: %s\r\n"
"Etag: \"%s\"\r\n"
- "Content-Type: %s\r\n"
+ "Content-Type: %
.*
s\r\n"
"Content-Length: %lu\r\n"
"Content-Length: %lu\r\n"
- "
Connection: close
\r\n"
+ "
Accept-Ranges: bytes
\r\n"
"%s\r\n",
"%s\r\n",
- status, msg, date, lm, etag, c->mime_type, cl, range);
+ status, msg, date, lm, etag,
+ c->mime_type.len, c->mime_type.ptr, cl, range);
c->status = status;
c->loc.content_len = cl;
c->status = status;
c->loc.content_len = cl;