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

mod_lua/lua_request.c: Make r:write return the return value of ap_rwrite, so mod_lua can check for success/failure in writing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1420176 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Gruno
2012-12-11 14:06:41 +00:00
parent acd00f0e60
commit c36aeb051d

View File

@@ -30,9 +30,7 @@ void ap_lua_rstack_dump(lua_State *L, request_rec *r, const char *msg)
{
int i;
int top = lua_gettop(L);
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(01484) "Lua Stack Dump: [%s]", msg);
for (i = 1; i <= top; i++) {
int t = lua_type(L, i);
switch (t) {
@@ -212,10 +210,12 @@ static int req_write(lua_State *L)
{
request_rec *r = ap_lua_check_request_rec(L, 1);
size_t n;
int rv;
const char *buf = luaL_checklstring(L, 2, &n);
ap_rwrite((void *) buf, n, r);
return 0;
rv = ap_rwrite((void *) buf, n, r);
lua_pushinteger(L, rv);
return 1;
}
/* r:addoutputfilter(name|function) */