|http_servlet_tmpl_func_query||This function takes exactly one argument, which is the name of a field in an HTML form, and returns the value of that field as submitted by the remote client. This function works for both GET and POST form submissions. If no such field was submitted, the empty string is returned.|
|http_servlet_tmpl_func_query_exists||This function takes exactly one argument, which is the name of a field in an HTML form, and returns "1" or "0" depending on whether a field having that name was submitted by the client.|
|http_servlet_tmpl_func_query_string||Takes zero arguments. Returns the HTTP query string.|
|http_servlet_tmpl_func_get_header||Takes one argument, and returns the contents of the HTTP header having that name.|
|http_servlet_tmpl_func_set_header||Takes two arguments, the name of an HTTP header and its value, and sets the corresponding HTTP response header. This function has no effect if the headers have already been sent.|
|http_servlet_tmpl_func_remove_header||Takes one argument, the name of an HTTP header, and removes the corresponding HTTP response header. This function has no effect if the headers have already been sent.|
|http_servlet_tmpl_func_redirect||Takes one argument, which must be a valid URL. Forces an HTTP redirect response to the URL. This function only works if the servlet has not created any output yet.|
|http_servlet_tmpl_func_unbuffer||Takes zero arguments. Unbuffers the servlet output, so that the output is written directly to the network instead of first into a memory buffer. This is done by calling http_response_send_headers(3) with a non-zero unbuffer argument. This function should be called in servlets that produce a high volume of output. You cant modify the HTTP response headers once this has been called.|
The http_servlet_tmpl servlet by default buffers the entire template output to facilitate HTTP keep-alive. For templates that generate voluminous output, this could consume excessive memory. The solution is to implement a template function using http_servlet_tmpl_func_unbuffer and invoke this function within those templates.
Multiple instances of the same http_servlet_tmpl servlet may be executing at the same time. Therefore, any user-supplied template functions called must be thread-safe.
Since its running as a servlet, the thread executing handler and errfmtr may be canceled at any cancellation point. Therefore, these functions should be written so as to not leak resources if this happens.
On failure, http_servlet_tmpl_create returns NULL and sets errno to an appropriate value.
The built-in tmpl(3) user functions return NULL with errno set to EINVAL if the wrong number of arguments is passed. They may also return NULL with errno set as a result of other system errors.
http_request(3), http_response(3), http_server(3), http_servlet(3), libpdel(3), tmpl(3)
The PDEL library was developed at Packet Design, LLC. http://www.packetdesign.com/
.An Archie Cobbs Aq firstname.lastname@example.org