You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <da...@elego.de> on 2012/01/13 16:57:06 UTC

[PATCH] httpd 2.3.16-beta compatibility

[[[
Follow-up to r1033547: track mod_dav API change.

In r882274, the mod_dav API changed in two ways: the signatures of
dav_new_error() and dav_new_error_tag() changed, and 'struct dav_error'
changed its errno number member into an apr_status_t.  r1033547 tracked
the former change but not the latter.

* subversion/mod_dav_svn/util.c
  (dav_svn__log_err): Track the change to 'struct dav_error'.
]]]

[[[
Index: subversion/mod_dav_svn/util.c
===================================================================
--- subversion/mod_dav_svn/util.c	(revision 1231107)
+++ subversion/mod_dav_svn/util.c	(working copy)
@@ -629,19 +629,20 @@ void dav_svn__log_err(request_rec *r,
     /* Log the errors */
     /* ### should have a directive to log the first or all */
     for (errscan = err; errscan != NULL; errscan = errscan->prev) {
+        apr_status_t status;
+
         if (errscan->desc == NULL)
             continue;
 
-        if (errscan->save_errno != 0) {
-            errno = errscan->save_errno;
-            ap_log_rerror(APLOG_MARK, level, errno, r, "%s  [%d, #%d]",
-                          errscan->desc, errscan->status, errscan->error_id);
-        }
-        else {
-            ap_log_rerror(APLOG_MARK, level, 0, r,
-                          "%s  [%d, #%d]",
-                          errscan->desc, errscan->status, errscan->error_id);
-        }
+#if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
+        status = errscan->aprerr;
+#else
+        status = errscan->save_errno;
+#endif
+
+        ap_log_rerror(APLOG_MARK, level, status, r,
+                      "%s  [%d, #%d]",
+                      errscan->desc, errscan->status, errscan->error_id);
     }
 }
 
]]]

Re: [PATCH] httpd 2.3.16-beta compatibility

Posted by Daniel Shahaf <da...@elego.de>.
Jeff Trawick wrote on Sun, Jan 15, 2012 at 08:15:55 -0500:
> On Fri, Jan 13, 2012 at 10:57 AM, Daniel Shahaf <da...@elego.de> wrote:
> > [[[
> > Follow-up to r1033547: track mod_dav API change.
> >
> > In r882274, the mod_dav API changed in two ways: the signatures of
> > dav_new_error() and dav_new_error_tag() changed, and 'struct dav_error'
> > changed its errno number member into an apr_status_t.  r1033547 tracked
> > the former change but not the latter.
> 
> dav_svn__log_err() is a very recent addition (a couple of years after
> my original mod_dav_svn 2.3 compatibility patch, some variant of which
> got committed back then).
> 

That explains why only parts of the code were 2.3-compatible.

Committed r1232267; thanks for your review.

Daniel


> Your patch looks reasonable, but I'll stay out of the way ;)  (no
> subversion commit bits here, and for good reason)
> 
> > * subversion/mod_dav_svn/util.c
> >  (dav_svn__log_err): Track the change to 'struct dav_error'.
> > ]]]
> >
> > [[[
> > Index: subversion/mod_dav_svn/util.c
> > ===================================================================
> > --- subversion/mod_dav_svn/util.c       (revision 1231107)
> > +++ subversion/mod_dav_svn/util.c       (working copy)
> > @@ -629,19 +629,20 @@ void dav_svn__log_err(request_rec *r,
> >     /* Log the errors */
> >     /* ### should have a directive to log the first or all */
> >     for (errscan = err; errscan != NULL; errscan = errscan->prev) {
> > +        apr_status_t status;
> > +
> >         if (errscan->desc == NULL)
> >             continue;
> >
> > -        if (errscan->save_errno != 0) {
> > -            errno = errscan->save_errno;
> > -            ap_log_rerror(APLOG_MARK, level, errno, r, "%s  [%d, #%d]",
> > -                          errscan->desc, errscan->status, errscan->error_id);
> > -        }
> > -        else {
> > -            ap_log_rerror(APLOG_MARK, level, 0, r,
> > -                          "%s  [%d, #%d]",
> > -                          errscan->desc, errscan->status, errscan->error_id);
> > -        }
> > +#if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
> > +        status = errscan->aprerr;
> > +#else
> > +        status = errscan->save_errno;
> > +#endif
> > +
> > +        ap_log_rerror(APLOG_MARK, level, status, r,
> > +                      "%s  [%d, #%d]",
> > +                      errscan->desc, errscan->status, errscan->error_id);
> >     }
> >  }
> >
> > ]]]
> 
> 
> 
> -- 
> Born in Roswell... married an alien...

Re: [PATCH] httpd 2.3.16-beta compatibility

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Jan 13, 2012 at 10:57 AM, Daniel Shahaf <da...@elego.de> wrote:
> [[[
> Follow-up to r1033547: track mod_dav API change.
>
> In r882274, the mod_dav API changed in two ways: the signatures of
> dav_new_error() and dav_new_error_tag() changed, and 'struct dav_error'
> changed its errno number member into an apr_status_t.  r1033547 tracked
> the former change but not the latter.

dav_svn__log_err() is a very recent addition (a couple of years after
my original mod_dav_svn 2.3 compatibility patch, some variant of which
got committed back then).

Your patch looks reasonable, but I'll stay out of the way ;)  (no
subversion commit bits here, and for good reason)

> * subversion/mod_dav_svn/util.c
>  (dav_svn__log_err): Track the change to 'struct dav_error'.
> ]]]
>
> [[[
> Index: subversion/mod_dav_svn/util.c
> ===================================================================
> --- subversion/mod_dav_svn/util.c       (revision 1231107)
> +++ subversion/mod_dav_svn/util.c       (working copy)
> @@ -629,19 +629,20 @@ void dav_svn__log_err(request_rec *r,
>     /* Log the errors */
>     /* ### should have a directive to log the first or all */
>     for (errscan = err; errscan != NULL; errscan = errscan->prev) {
> +        apr_status_t status;
> +
>         if (errscan->desc == NULL)
>             continue;
>
> -        if (errscan->save_errno != 0) {
> -            errno = errscan->save_errno;
> -            ap_log_rerror(APLOG_MARK, level, errno, r, "%s  [%d, #%d]",
> -                          errscan->desc, errscan->status, errscan->error_id);
> -        }
> -        else {
> -            ap_log_rerror(APLOG_MARK, level, 0, r,
> -                          "%s  [%d, #%d]",
> -                          errscan->desc, errscan->status, errscan->error_id);
> -        }
> +#if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
> +        status = errscan->aprerr;
> +#else
> +        status = errscan->save_errno;
> +#endif
> +
> +        ap_log_rerror(APLOG_MARK, level, status, r,
> +                      "%s  [%d, #%d]",
> +                      errscan->desc, errscan->status, errscan->error_id);
>     }
>  }
>
> ]]]



-- 
Born in Roswell... married an alien...

Re: [PATCH] httpd 2.3.16-beta compatibility

Posted by Daniel Shahaf <da...@elego.de>.
And another patch:

[[[
Index: subversion/tests/cmdline/davautocheck.sh
===================================================================
--- subversion/tests/cmdline/davautocheck.sh	(revision 1231107)
+++ subversion/tests/cmdline/davautocheck.sh	(working copy)
@@ -292,9 +292,22 @@
 $LOAD_MOD_AUTHZ_HOST
 LoadModule          authz_svn_module "$MOD_AUTHZ_SVN"
 
+__EOF__
+
+if "$HTTPD" -v | grep '/2\.[012]' >/dev/null; then
+  cat >> "$HTTPD_CFG" <<__EOF__
 LockFile            lock
 User                $(id -un)
 Group               $(id -gn)
+__EOF__
+else
+  cat >> "$HTTPD_CFG" <<__EOF__
+# TODO: maybe uncomment this for prefork,worker MPMs only?
+# Mutex file:lock mpm-accept
+__EOF__
+fi
+
+cat >> "$HTTPD_CFG" <<__EOF__
 Listen              $HTTPD_PORT
 ServerName          localhost
 PidFile             "$HTTPD_PID"
]]]

For me, it works but yields
    AH00511: WARNING: MaxRequestWorkers of 16 is less than ThreadsPerChild of
    25, increasing to 25.  MaxRequestWorkers must be at least as large
    as the number of threads in a single server.

Tested using the event MPM only (which was the default in my build).