httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1467571 - /httpd/httpd/trunk/modules/lua/lua_request.c
Date Sat, 13 Apr 2013 07:40:43 GMT
Author: humbedooh
Date: Sat Apr 13 07:40:42 2013
New Revision: 1467571

URL: http://svn.apache.org/r1467571
Log:
fix some bugs reported by fuankg on Windows release builds.

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=1467571&r1=1467570&r2=1467571&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Sat Apr 13 07:40:42 2013
@@ -1742,6 +1742,19 @@ static const struct luaL_Reg connection_
     {NULL, NULL}
 };
 
+static const char* lua_ap_auth_name(request_rec* r)
+{
+    const char *name;
+    name = ap_auth_name(r);
+    return name ? name : "";
+}
+
+static const char* lua_ap_get_server_name(request_rec* r)
+{
+    const char *name;
+    name = ap_get_server_name(r);
+    return name ? name : "Apache";
+}
 
 static const struct luaL_Reg server_methods[] = {
     {NULL, NULL}
@@ -1896,9 +1909,9 @@ AP_LUA_DECLARE(void) ap_lua_load_request
     apr_hash_set(dispatch, "some_auth_required", APR_HASH_KEY_STRING,
                  makefun(&lua_ap_some_auth_required, APL_REQ_FUNTYPE_BOOLEAN, p));
     apr_hash_set(dispatch, "server_name", APR_HASH_KEY_STRING,
-                 makefun(&ap_get_server_name, APL_REQ_FUNTYPE_STRING, p));
+                 makefun(&lua_ap_get_server_name, APL_REQ_FUNTYPE_STRING, p));
     apr_hash_set(dispatch, "auth_name", APR_HASH_KEY_STRING,
-                 makefun(&ap_auth_name, APL_REQ_FUNTYPE_STRING, p));
+                 makefun(&lua_ap_auth_name, APL_REQ_FUNTYPE_STRING, p));
     apr_hash_set(dispatch, "sendfile", APR_HASH_KEY_STRING,
                  makefun(&lua_ap_sendfile, APL_REQ_FUNTYPE_LUACFUN, p));
     apr_hash_set(dispatch, "dbacquire", APR_HASH_KEY_STRING,



Mime
View raw message