httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1420176 - /httpd/httpd/trunk/modules/lua/lua_request.c
Date Tue, 11 Dec 2012 14:06:43 GMT
Author: humbedooh
Date: Tue Dec 11 14:06:41 2012
New Revision: 1420176

URL: http://svn.apache.org/viewvc?rev=1420176&view=rev
Log:
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.

Modified:
    httpd/httpd/trunk/modules/lua/lua_request.c

Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1420176&r1=1420175&r2=1420176&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Tue Dec 11 14:06:41 2012
@@ -30,9 +30,7 @@ void ap_lua_rstack_dump(lua_State *L, re
 {
     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) */



Mime
View raw message