Issue Details (XML | Word | Printable)

Key: MODPYTHON-148
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Additional constants for mod_python.apache module.

Created: 19/Mar/06 10:29 AM   Updated: 11/Apr/07 11:36 AM
Component/s: core
Affects Version/s: None
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Resolution Date: 19/Mar/06 11:25 AM
Labels:


 Description  « Hide
Apache defines the following:

/** Magic for mod_cgi[d] */
#define CGI_MAGIC_TYPE "application/x-httpd-cgi"
/** Magic for mod_include */
#define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
/** Magic for mod_include */
#define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
/** Magic for mod_dir */
#define DIR_MAGIC_TYPE "httpd/unix-directory"

There should be equivalents available as constants in "mod_python.apache" module.

Apache defines the following:

#define PROXYREQ_NONE 0 /**< No proxy */
#define PROXYREQ_PROXY 1 /**< Standard proxy */
#define PROXYREQ_REVERSE 2 /**< Reverse proxy */
#define PROXYREQ_RESPONSE 3 /**< Origin response */

The PROXYREQ_RESPONSE value is missing from "mod_python.apache".

Apache defines the following:

#define HTTP_UPGRADE_REQUIRED 426

This isn't present in mod_python.apache.

Apache defines the following:

/** Send 413 error if message has any body */
#define REQUEST_NO_BODY 0
/** Send 411 error if body without Content-Length */
#define REQUEST_CHUNKED_ERROR 1
/** If chunked, remove the chunks for me. */
#define REQUEST_CHUNKED_DECHUNK 2
/** @} // values_request_rec_body */

These are necessary to understand what req.read_body means. In practice, don't think they are relevant to mod_python handlers, but for completeness should be added.

Apache defines the following:

/**
 * @brief Enumeration of connection keepalive options
 */
typedef enum {
    AP_CONN_UNKNOWN,
    AP_CONN_CLOSE,
    AP_CONN_KEEPALIVE
} ap_conn_keepalive_e;

These are needed to understand req.connection.keepalive. Because they a enum values, need to be populated in mod_python._apache module when module is initialised and reference made in mod_python.apache module.

The only other thing from httpd.h which seems of interest is the DOCTYPE macro strings. Don't do anything about them for the time being.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #386920 Sun Mar 19 03:24:14 UTC 2006 grahamd Added missing Apache contants apache.PROXYREQ_RESPONSE and
apache.HTTP_UPGRADE_REQUIRED. Also added new constants for Apache magic
mime types and values for interpreting the req.connection.keepalive and
req.read_body members. (MODPYTHON-148)
Files Changed
MODIFY /httpd/mod_python/trunk/src/_apachemodule.c
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/apache.py
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h

Graham Dumpleton made changes - 19/Mar/06 10:38 AM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Graham Dumpleton made changes - 19/Mar/06 11:25 AM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Fix Version/s 3.3 [ 12310101 ]
Graham Dumpleton made changes - 11/Apr/07 11:36 AM
Status Resolved [ 5 ] Closed [ 6 ]