httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gruno <rum...@cord.dk>
Subject Re: Additional core functions for mod_lua
Date Mon, 06 Aug 2012 14:31:29 GMT
If no one objects, I'll start moving in some functions to the mod_lua
core, starting with the ones that pertain to obtaining a "static" value
from the request/server, as well as the flush and sendfile function, and
making them part of the request_rec package. This includes the following
(as they will appear when imported):

r:flush() - 		Flushes the output buffer
r:sendfile(filename) -	Sends a file using sendfile if available
r.port - 		the port in use by the request
r.banner - 		the server banner
r.options - 		the Options directive for the request
r.allowoverrides - 	the AllowOverride directive for the request
r.started -		the time the server was (re)started
r.basic_auth_pw	-	the basic auth password, if any was sent
r.limit_req_body -	The current request body limit (or 0 for none)
r.server_built -	The time the server was built
r.is_initial_req -	Whether this is the initial request or a subreq
r.remaining -		The remaining bytes in the request body
r.some_auth_required -  Whether some authorization is/was required
r.server_name -		The server name for the request
r.auth_name -		The realm used (if any) for authorization

This leaves the following functions still in the apache2 package -
If you'd rather see any of them moved to the request_rec package, do say
so - :

apache2.base64_encode -		Encode a string in base64
apache2.base64_decode -		Decode a base64 string
apache2.md5 -			Generate an MD5 hash
apache2.sha1 -			Generate a SHA-1 hash
apache2.escape -		URL-escape a string
apache2.unescape -		unescape an URL-encoded string
apache2.mpm_query -		Query the MPM for information
apache2.expr -			Evaluate an ap_expr string
apache2.scoreboard_process -	Query the process scoreboard
apache2.scoreboard_worker -	Query a worker scoreboard
apache2.clock -			Returns the current time in microseconds
apache2.requestbody -		Fetches (or saves) the request body
apache2.dbopen -		Opens up a database connection
				(supports both apr_dbd and mod_dbd)
apache2.add_input_filter -	Adds an input filter to the request
apache2.module_info - 		Queries the server for info about a mod
apache2.loaded_modules -	Lists all the loaded modules
apache2.runtime_dir_relative -	Returns a path relative to runtime dir
apache2.server_info -		Returns information about the executable
apache2.set_document_root -	Sets the document root for a request
apache2.add_version_component - Adds a version component
apache2.os_escape_path -	Escapes a path as a URL
apache2.strcmp_match -		Does a strcmp_match (the foo* kind)
apache2.set_keepalive -		Set the keepalive status for a request
apache2.make_etag - 		Creates an entity tag
apache2.send_interim_response - Sends an interim response (or does it?)
apache2.custom_response - 	Sets a custom response for an error msg
apache2.exists_config_define -	Query whether a define was made
apache2.state_query -		Queries the server for state info
apache2.stat -			Stats a file and returns info as a table
apache2.regex -			Evaluates regular expressions
apache2.sleep -			Sleeps for N seconds (accepts floats)
apache2.get_server_name_for_url Servername for URL purposes

Full descriptions and examples are still available at
http://people.apache.org/~humbedooh/lua_ap/ if you need more info.

If anyone has any other requests for internal functions they'd like to
use in mod_lua, just speak up, I'm always happy to include more
functionality.

With regards,
Daniel.

Mime
View raw message