diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-07-13 17:10:56 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-07-13 17:10:56 +0000 |
commit | 00f1b1d62abc566e394d8b4dbf1d7580ffe3321f (patch) | |
tree | 718e7ab3e5f025f07db5100413597133928a7c38 /package/uhttpd/src/uhttpd-file.c | |
parent | abc3d9493b23166714af2a3e592ff0edbb297495 (diff) | |
download | master-31e0f0ae-00f1b1d62abc566e394d8b4dbf1d7580ffe3321f.tar.gz master-31e0f0ae-00f1b1d62abc566e394d8b4dbf1d7580ffe3321f.tar.bz2 master-31e0f0ae-00f1b1d62abc566e394d8b4dbf1d7580ffe3321f.zip |
uhttpd: various changes
- remove unused variables
- simply ignore command line args which belong to not enabled features
- resolve peer address at accept() time, should solve (#11850)
- remove floating point operations where possible
SVN-Revision: 32704
Diffstat (limited to 'package/uhttpd/src/uhttpd-file.c')
-rw-r--r-- | package/uhttpd/src/uhttpd-file.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/package/uhttpd/src/uhttpd-file.c b/package/uhttpd/src/uhttpd-file.c index 2e5914a3c0..0bafc2b38c 100644 --- a/package/uhttpd/src/uhttpd-file.c +++ b/package/uhttpd/src/uhttpd-file.c @@ -113,16 +113,16 @@ static int uh_file_response_ok_hdrs(struct client *cl, struct stat *s) static int uh_file_response_200(struct client *cl, struct stat *s) { - ensure_ret(uh_http_sendf(cl, NULL, "HTTP/%.1f 200 OK\r\n", - cl->request.version)); + ensure_ret(uh_http_sendf(cl, NULL, "%s 200 OK\r\n", + http_versions[cl->request.version])); return uh_file_response_ok_hdrs(cl, s); } static int uh_file_response_304(struct client *cl, struct stat *s) { - ensure_ret(uh_http_sendf(cl, NULL, "HTTP/%.1f 304 Not Modified\r\n", - cl->request.version)); + ensure_ret(uh_http_sendf(cl, NULL, "%s 304 Not Modified\r\n", + http_versions[cl->request.version])); return uh_file_response_ok_hdrs(cl, s); } @@ -130,8 +130,9 @@ static int uh_file_response_304(struct client *cl, struct stat *s) static int uh_file_response_412(struct client *cl) { return uh_http_sendf(cl, NULL, - "HTTP/%.1f 412 Precondition Failed\r\n" - "Connection: close\r\n", cl->request.version); + "%s 412 Precondition Failed\r\n" + "Connection: close\r\n", + http_versions[cl->request.version]); } static int uh_file_if_match(struct client *cl, struct stat *s, int *ok) |