]> granicus.if.org Git - apache/commitdiff
fix some bugs reported by fuankg on Windows release builds.
authorDaniel Gruno <humbedooh@apache.org>
Sat, 13 Apr 2013 07:40:42 +0000 (07:40 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Sat, 13 Apr 2013 07:40:42 +0000 (07:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467571 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index 055e7d54c54dc7f9d82028170525f909d58cbaba..28229b061ac26d7b170cc592cd2b188ea75cf040 100644 (file)
@@ -1742,6 +1742,19 @@ static const struct luaL_Reg connection_methods[] = {
     {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_lmodule(lua_State *L, apr_pool_t *p)
     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,