1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

mod_lua: Fix signedness/other small bugs as per cjaillet/fuankg's emails - thanks guys :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1421780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Gruno
2012-12-14 10:15:37 +00:00
parent 9875cc5fab
commit df178d1e41
3 changed files with 41 additions and 54 deletions

View File

@@ -227,7 +227,7 @@ static int req_parsebody(lua_State *L)
int i, z;
size_t vlen = 0;
size_t len = 0;
if (lua_read_body(r, &data, &size) != OK) {
if (lua_read_body(r, &data, (apr_off_t*) &size) != OK) {
return 2;
}
len = strlen(multipart);
@@ -574,23 +574,20 @@ static int lua_ap_sendfile(lua_State *L)
lua_pushboolean(L, 0);
}
else {
if (r) {
apr_size_t sent;
apr_status_t rc;
apr_file_t *file;
rc = apr_file_open(&file, filename, APR_READ, APR_OS_DEFAULT,
r->pool);
if (rc == APR_SUCCESS) {
ap_send_fd(file, r, 0, file_info.size, &sent);
apr_file_close(file);
lua_pushinteger(L, sent);
}
else
lua_pushboolean(L, 0);
apr_size_t sent;
apr_status_t rc;
apr_file_t *file;
rc = apr_file_open(&file, filename, APR_READ, APR_OS_DEFAULT,
r->pool);
if (rc == APR_SUCCESS) {
ap_send_fd(file, r, 0, file_info.size, &sent);
apr_file_close(file);
lua_pushinteger(L, sent);
}
else
else {
lua_pushboolean(L, 0);
}
}
return (1);