PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_mime_magic: For compressed content the module sets the
- content encoding header and also tries to determine the
- uncompressed content type by using an external gzip.
- Several bugs break this functionality:
- - Starting gzip doesn't work because an invalid working
- directory is used and neither the full path name for gzip
- nor the PATH variable is used.
- - When gzip works, but cannot detect the content type, then
- content encoding is also not set.
- - Too few bytes are uncompressed so often the content type
- can not be determined.
- Patches in trunk (separated to make review easier):
- http://svn.apache.org/viewvc?rev=756671&view=rev (working dir)
- http://svn.apache.org/viewvc?rev=756675&view=rev (use PATH)
- http://svn.apache.org/viewvc?rev=756678&view=rev (content encoding)
- http://svn.apache.org/viewvc?rev=756683&view=rev (read more bytes)
- Those patches apply to 2.2.x as well.
- +1: rjung, rpluem, jim
-
* mod_substitute: Avoid endless loops in substitution.
Trunk version of patch:
http://svn.apache.org/viewvc?rev=755190&view=rev
if (i == ncompr)
return 0;
- if ((newsize = uncompress(r, i, &newbuf, nbytes)) > 0) {
+ if ((newsize = uncompress(r, i, &newbuf, HOWMANY)) > 0) {
+ /* set encoding type in the request record */
+ r->content_encoding = compr[i].encoding;
+
+ newbuf[newsize-1] = '\0'; /* null-terminate uncompressed data */
+ /* Try to detect the content type of the uncompressed data */
if (tryit(r, newbuf, newsize, 0) != OK) {
return 0;
}
-
- /* set encoding type in the request record */
- r->content_encoding = compr[i].encoding;
}
return 1;
}
{
int rc = 1;
const char *new_argv[4];
- const char *const *env;
request_rec *r = parm->r;
apr_pool_t *child_context = cntxt;
apr_procattr_t *procattr;
* Should we create the err pipe, read it, and copy to the log?
*/
- env = (const char *const *)ap_create_environment(child_context, r->subprocess_env);
-
if ((apr_procattr_create(&procattr, child_context) != APR_SUCCESS) ||
(apr_procattr_io_set(procattr, APR_FULL_BLOCK,
APR_FULL_BLOCK, APR_NO_PIPE) != APR_SUCCESS) ||
- (apr_procattr_dir_set(procattr, r->filename) != APR_SUCCESS) ||
- (apr_procattr_cmdtype_set(procattr, APR_PROGRAM) != APR_SUCCESS)) {
+ (apr_procattr_dir_set(procattr,
+ ap_make_dirstr_parent(r->pool, r->filename)) != APR_SUCCESS) ||
+ (apr_procattr_cmdtype_set(procattr, APR_PROGRAM_PATH) != APR_SUCCESS)) {
/* Something bad happened, tell the world. */
ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r,
"couldn't setup child process: %s", r->filename);
procnew = apr_pcalloc(child_context, sizeof(*procnew));
rc = apr_proc_create(procnew, compr[parm->method].argv[0],
- new_argv, env, procattr, child_context);
+ new_argv, NULL, procattr, child_context);
if (rc != APR_SUCCESS) {
/* Bad things happened. Everyone should have cleaned up. */
mime_magic_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
-
-