httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r611976 - /httpd/mod_wombat/trunk/request.c
Date Tue, 15 Jan 2008 00:13:56 GMT
Author: brianm
Date: Mon Jan 14 16:13:54 2008
New Revision: 611976

URL: http://svn.apache.org/viewvc?rev=611976&view=rev
Log:
Patch from Matthew Burke to provide an r:write(String) method which
writes raw bytes to the output

Modified:
    httpd/mod_wombat/trunk/request.c

Modified: httpd/mod_wombat/trunk/request.c
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/request.c?rev=611976&r1=611975&r2=611976&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/request.c (original)
+++ httpd/mod_wombat/trunk/request.c Mon Jan 14 16:13:54 2008
@@ -153,6 +153,16 @@
     return 0;
 }
 
+// wrap ap_rwrite as r:write(String)
+static int req_write(lua_State* L) {
+    request_rec* r = check_request_rec(L, 1);
+    int n;
+    const char* buf = luaL_checklstring(L, 2, &n);
+  
+    ap_rwrite((void *)buf, n, r);
+    return 0;
+}
+
 // r:parsebody()
 static int req_parsebody(lua_State* L) {
     request_rec* r = check_request_rec(L, 1);
@@ -250,6 +260,7 @@
 
 static const struct luaL_Reg request_methods[] = {
     {"puts", req_puts},
+    {"write", req_write},
     {"parseargs", req_parseargs},
     {"parsebody", req_parsebody},
     



Mime
View raw message