You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/09/08 22:34:34 UTC
cvs commit: apache-2.0/src/modules/standard mod_mime_magic.c
rbb 00/09/08 13:34:33
Modified: src CHANGES
src/modules/standard mod_mime_magic.c
Log:
Fix a compile break in mod_mime_magic.c. In early 2.0 versions, we would
get a pipe back from create_child, and stuff that into a buff to read from
it. This made sense in 1.3, because we got a buff back from the
create_process call. In 2.0, we are getting a pipe, so this doesn't
make sense. This patch just uses the pipe that is returned to us to read
the information we want.
Submitted by: John K. Sterling <st...@covalent.net>
Reviewed by: Ryan Bloom
Revision Changes Path
1.216 +2 -0 apache-2.0/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-2.0/src/CHANGES,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -r1.215 -r1.216
--- CHANGES 2000/09/07 23:51:33 1.215
+++ CHANGES 2000/09/08 20:34:33 1.216
@@ -1,4 +1,6 @@
Changes with Apache 2.0a7
+ *) Fix compile break on some platforms for mod_mime_magic.c
+ [John K. Sterling <st...@covalent.net>]
*) Fix merging of AddDefaultCharset directive.
PR #5872 (1.3) [Jun Kuriyama <ku...@imgsrc.co.jp>]
1.28 +5 -15 apache-2.0/src/modules/standard/mod_mime_magic.c
Index: mod_mime_magic.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_mime_magic.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- mod_mime_magic.c 2000/08/23 00:01:58 1.27
+++ mod_mime_magic.c 2000/09/08 20:34:33 1.28
@@ -2140,7 +2140,7 @@
};
static int uncompress_child(struct uncompress_parms *parm, apr_pool_t *cntxt,
- BUFF **script_in)
+ apr_file_t **pipe_in)
{
int rc = 1;
char *new_argv[4];
@@ -2184,17 +2184,7 @@
}
else {
apr_note_subprocess(child_context, procnew, kill_after_timeout);
- /* Fill in BUFF structure for parents pipe to child's stdout */
- /* XXX This is a hack. The correct solution is to create a
- * pipe bucket, and just pass it down. Since that bucket type
- * hasn't been written, we can hack it for the moment.
- */
- apr_socket_from_file(&sock, procnew->out);
-
- if (script_in) {
- *script_in = ap_bcreate(child_context, B_RD);
- }
- ap_bpush_socket(*script_in, sock);
+ *pipe_in = procnew->out;
}
}
@@ -2205,7 +2195,7 @@
unsigned char **newch, int n)
{
struct uncompress_parms parm;
- BUFF *bout = NULL;
+ apr_file_t *pipe_out = NULL;
apr_pool_t *sub_context;
apr_status_t rv;
@@ -2219,14 +2209,14 @@
if (apr_create_pool(&sub_context, r->pool) != APR_SUCCESS)
return -1;
- if ((rv = uncompress_child(&parm, sub_context, &bout)) != APR_SUCCESS) {
+ if ((rv = uncompress_child(&parm, sub_context, &pipe_out)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
MODNAME ": couldn't spawn uncompress process: %s", r->uri);
return -1;
}
*newch = (unsigned char *) apr_palloc(r->pool, n);
- rv = ap_bread(bout, *newch, n, &n);
+ rv = apr_read(pipe_out, *newch, &n);
if (n == 0) {
apr_destroy_pool(sub_context);
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,