From 2acdfd8ff0c6c06083bdd3541e2b462d68f43797 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 16 May 2013 13:18:48 +0000 Subject: [PATCH] Cast uint16 return value to int. This fixes a crash on Windows when compiled with MSVC9. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1483348 13f79535-47bb-0310-9956-ffa450edef68 --- modules/lua/lua_request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c index b672c2fb9a..986c09d046 100644 --- a/modules/lua/lua_request.c +++ b/modules/lua/lua_request.c @@ -614,6 +614,11 @@ static int req_ssl_is_https_field(request_rec *r) return ap_lua_ssl_is_https(r->connection); } +static int req_ap_get_server_port(request_rec *r) +{ + return (int) ap_get_server_port(r); +} + static int lua_ap_rflush (lua_State *L) { int returnValue; @@ -1997,7 +2002,7 @@ AP_LUA_DECLARE(void) ap_lua_load_request_lmodule(lua_State *L, apr_pool_t *p) apr_hash_set(dispatch, "flush", APR_HASH_KEY_STRING, makefun(&lua_ap_rflush, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "port", APR_HASH_KEY_STRING, - makefun(&ap_get_server_port, APL_REQ_FUNTYPE_INT, p)); + makefun(&req_ap_get_server_port, APL_REQ_FUNTYPE_INT, p)); apr_hash_set(dispatch, "banner", APR_HASH_KEY_STRING, makefun(&ap_get_server_banner, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "options", APR_HASH_KEY_STRING, -- 2.40.0