You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@attglobal.net> on 2004/01/12 17:42:22 UTC

[1.3 PATCH] log error if returning 500

2.x already does this


Re: [1.3 PATCH] log error if returning 500

Posted by Jim Jagielski <ji...@jagunet.com>.
+1

On Jan 12, 2004, at 11:42 AM, Jeff Trawick wrote:

> 2.x already does this
>
> Index: src/modules/standard/mod_mime_magic.c
> ===================================================================
> RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_mime_magic.c,v
> retrieving revision 1.51
> diff -u -r1.51 mod_mime_magic.c
> --- src/modules/standard/mod_mime_magic.c	1 Jan 2004 13:32:56 
> -0000	1.51
> +++ src/modules/standard/mod_mime_magic.c	12 Jan 2004 16:38:45 -0000
> @@ -832,9 +832,13 @@
>  	r->content_encoding = tmp;
>      }
>
> -    /* detect memory allocation errors */
> +    /* detect memory allocation or other errors */
>      if (!r->content_type ||
>  	(state == rsl_encoding && !r->content_encoding)) {
> +        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
> +                      MODNAME ": unexpected state %d; could be caused 
> by bad "
> +                      "data in magic file",
> +                      state);
>  	return HTTP_INTERNAL_SERVER_ERROR;
>      }
>


Re: [1.3 PATCH] log error if returning 500

Posted by Jim Jagielski <ji...@jagunet.com>.
+1

On Jan 12, 2004, at 11:42 AM, Jeff Trawick wrote:

> 2.x already does this
>
> Index: src/modules/standard/mod_mime_magic.c
> ===================================================================
> RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_mime_magic.c,v
> retrieving revision 1.51
> diff -u -r1.51 mod_mime_magic.c
> --- src/modules/standard/mod_mime_magic.c	1 Jan 2004 13:32:56 
> -0000	1.51
> +++ src/modules/standard/mod_mime_magic.c	12 Jan 2004 16:38:45 -0000
> @@ -832,9 +832,13 @@
>  	r->content_encoding = tmp;
>      }
>
> -    /* detect memory allocation errors */
> +    /* detect memory allocation or other errors */
>      if (!r->content_type ||
>  	(state == rsl_encoding && !r->content_encoding)) {
> +        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
> +                      MODNAME ": unexpected state %d; could be caused 
> by bad "
> +                      "data in magic file",
> +                      state);
>  	return HTTP_INTERNAL_SERVER_ERROR;
>      }
>