summaryrefslogtreecommitdiff
path: root/modules/lua/lua_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/lua/lua_request.c')
-rw-r--r--modules/lua/lua_request.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c
index 4f8d39af..fbc88875 100644
--- a/modules/lua/lua_request.c
+++ b/modules/lua/lua_request.c
@@ -56,52 +56,53 @@ void ap_lua_rstack_dump(lua_State *L, request_rec *r, const char *msg)
int t = lua_type(L, i);
switch (t) {
case LUA_TSTRING:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03001)
"%d: '%s'", i, lua_tostring(L, i));
break;
}
case LUA_TUSERDATA:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "%d: userdata",
- i);
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03002)
+ "%d: userdata", i);
break;
}
case LUA_TLIGHTUSERDATA:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03003)
"%d: lightuserdata", i);
break;
}
case LUA_TNIL:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "%d: NIL", i);
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03004)
+ "%d: NIL", i);
break;
}
case LUA_TNONE:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "%d: None", i);
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03005)
+ "%d: None", i);
break;
}
case LUA_TBOOLEAN:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
- "%d: %s", i, lua_toboolean(L,
- i) ? "true" :
- "false");
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03006)
+ "%d: %s", i,
+ lua_toboolean(L, i) ? "true" : "false");
break;
}
case LUA_TNUMBER:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03007)
"%d: %g", i, lua_tonumber(L, i));
break;
}
case LUA_TTABLE:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03008)
"%d: <table>", i);
break;
}
case LUA_TFUNCTION:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03009)
"%d: <function>", i);
break;
}
default:{
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03010)
"%d: unknown: -[%s]-", i, lua_typename(L, i));
break;
}
@@ -1648,7 +1649,7 @@ static int lua_ap_escape_logitem(lua_State *L)
/**
* ap_strcmp_match (const char *str, const char *expected)
- * Determine if a string matches a patterm containing the wildcards '?' or '*'
+ * Determine if a string matches a pattern containing the wildcards '?' or '*'
* @param str The string to check
* @param expected The pattern to match against
* @param ignoreCase Whether to ignore case when matching
@@ -2147,8 +2148,8 @@ static int lua_websocket_greet(lua_State *L)
request_rec *r = ap_lua_check_request_rec(L, 1);
key = apr_table_get(r->headers_in, "Sec-WebSocket-Key");
if (key != NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
- "Websocket: Got websocket key: %s", key);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03011)
+ "Websocket: Got websocket key: %s", key);
key = apr_pstrcat(r->pool, key, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
NULL);
apr_sha1_init(&sha1);
@@ -2170,7 +2171,7 @@ static int lua_websocket_greet(lua_State *L)
r->bytes_sent = 0;
r->read_chunked = 0;
ap_rflush(r);
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03012)
"Websocket: Upgraded from HTTP to Websocket");
lua_pushboolean(L, 1);
return 1;
@@ -2316,7 +2317,7 @@ static int lua_websocket_read(lua_State *L)
return 0;
}
}
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03210)
"Websocket: Reading %" APR_SIZE_T_FMT " (%s) bytes, masking is %s. %s",
plen,
(payload >= 126) ? "extra payload" : "no extra payload",
@@ -2406,8 +2407,8 @@ static int lua_websocket_write(lua_State *L)
string = lua_tolstring(L, 2, &len);
if (raw != 1) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
- "Websocket: Writing framed message to client");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03013)
+ "Websocket: Writing framed message to client");
prelude = 0x81; /* text frame, FIN */
ap_rputc(prelude, r);
@@ -2428,8 +2429,8 @@ static int lua_websocket_write(lua_State *L)
}
}
else {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
- "Websocket: Writing raw message to client");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03014)
+ "Websocket: Writing raw message to client");
}
ap_rwrite(string, len, r);
rv = ap_rflush(r);
@@ -2488,8 +2489,8 @@ static int lua_websocket_ping(lua_State *L)
unsigned char mask = len >> 7;
if (mask) len -= 128;
plen = len;
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
- "Websocket: Got PONG opcode: %x", opcode);
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03015)
+ "Websocket: Got PONG opcode: %x", opcode);
if (opcode == 0x8A) {
lua_pushboolean(L, 1);
}
@@ -2498,7 +2499,7 @@ static int lua_websocket_ping(lua_State *L)
}
if (plen > 0) {
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
- "Websocket: Reading %" APR_SIZE_T_FMT " bytes of PONG", plen);
+ "Websocket: Reading %" APR_SIZE_T_FMT " bytes of PONG", plen);
return 1;
}
if (mask) {