Problem: compiling mod_tidy with Apache 2.2

2006-01-19 Thread Sierk Bornemann

Hi!

I am the project maintainer of the Apache2 module mod_tidy 
(http://mod-tidy.sourceforge.net/), and there seems to be a problem 
compiling mod_tidy with Apache 2.2, because API has changed from 
Apache2.0 to Apache2.2:


Compiler error messages:
--
src/mod_tidy.c: In function 'mod_tidy_filter':
src/mod_tidy.c:189: warning: implicit declaration of function 
'APR_BRIGADE_FOREACH'

src/mod_tidy.c:189: error: expected ';' before '{' token
src/mod_tidy.c:154: warning: unused variable 'r'
apxs:Error: Command failed with rc=65536
--

APR_BRIGADE_FOREACH does not longer exist, so there must be a short fix 
reflecting this.


I have a short patch here, which compiles well under apache2.0.55 and 
which lets to a functionable binary under Linux (OpenSuse), but I have 
no possibility yet to check, if it also compiles and works with apache2.2.


For convenience, I have attached the little patch as a Unix diff to this email.
The source tarball of mod_tidy is available on: 
http://mod-tidy.sourceforge.net/src/
Is here anybody, who can help and have a look into the source and the 
patch or propose a better patch to solve the problem?



Thanks in advance,
Sierk Bornemann

Sierk Bornemann | Hannover | Germany
e-mail:  [EMAIL PROTECTED]
URL: http://sierkbornemann.de/ 38,39c38,39
 $Date: 2006-01-12 22:47:25 +0100 (Thu, 12 Jan 2006) $ 
 $Revision: 96 $ 
---
 $Date: 2006-01-17 20:51:26 +0100 (Tue, 17 Jan 2006) $ 
 $Revision: 106 $ 
47a48
 #include apr_version.h
189c190,197
 APR_BRIGADE_FOREACH(e, bb) {
---
 #if APR_MAJOR_VERSION
 for (e = APR_BRIGADE_FIRST(bb);
  e != APR_BRIGADE_SENTINEL(bb);
  e = APR_BUCKET_NEXT(e))
 #else
 APR_BRIGADE_FOREACH(e, bb)
 #endif
 {
310c318
   meta name=\revision\ content=\$Id: 
mod_tidy.c 96 2006-01-12 21:47:25Z bornemann $\/\n
---
   meta name=\revision\ content=\$Id: 
 mod_tidy.c 106 2006-01-17 19:51:26Z bornemann $\/\n
605c613
   $Date: 2006-01-12 22:47:25 +0100 (Thu, 
12 Jan 2006) $\n
---
   $Date: 2006-01-17 20:51:26 +0100 (Tue, 
 17 Jan 2006) $\n


AW: Problem: compiling mod_tidy with Apache 2.2

2006-01-19 Thread Plüm , Rüdiger , VIS


 -Ursprüngliche Nachricht-
 Von: Sierk Bornemann 
 

[..cut..]

 --
 
 APR_BRIGADE_FOREACH does not longer exist, so there must be a 
 short fix 
 reflecting this.

The macro APR_BRIGADE_FOREACH is marked deprecated in apr-util 0.9.x
which is used by Apache 2.0.x for quite a long time (3.5 years,
see http://svn.apache.org/viewcvs.cgi?rev=58680view=rev)
Thus it is not contained in apr-util 1.2.2 which is used by Apache
httpd 2.2.0. So please use different code to iterate over a brigade
as shown in the comments above the definition of APR_BRIGADE_FOREACH
in apr-util 0.9.x.

Regards

Rüdiger


[..cut..]


Re: Problem: compiling mod_tidy with Apache 2.2

2006-01-19 Thread Steffen

Compiling on Windows and Apache 2.2.0 works with the patch.

Steffen

http://www.apachelounge.com
- Original Message - 
From: Sierk Bornemann [EMAIL PROTECTED]

To: dev@httpd.apache.org
Sent: Thursday, January 19, 2006 3:28 PM
Subject: Problem: compiling mod_tidy with Apache 2.2



Hi!

I am the project maintainer of the Apache2 module mod_tidy
(http://mod-tidy.sourceforge.net/), and there seems to be a problem
compiling mod_tidy with Apache 2.2, because API has changed from
Apache2.0 to Apache2.2:

Compiler error messages:
--
src/mod_tidy.c: In function 'mod_tidy_filter':
src/mod_tidy.c:189: warning: implicit declaration of function
'APR_BRIGADE_FOREACH'
src/mod_tidy.c:189: error: expected ';' before '{' token
src/mod_tidy.c:154: warning: unused variable 'r'
apxs:Error: Command failed with rc=65536
--

APR_BRIGADE_FOREACH does not longer exist, so there must be a short fix
reflecting this.

I have a short patch here, which compiles well under apache2.0.55 and
which lets to a functionable binary under Linux (OpenSuse), but I have
no possibility yet to check, if it also compiles and works with apache2.2.

For convenience, I have attached the little patch as a Unix diff to this
email.
The source tarball of mod_tidy is available on:
http://mod-tidy.sourceforge.net/src/
Is here anybody, who can help and have a look into the source and the
patch or propose a better patch to solve the problem?


Thanks in advance,
Sierk Bornemann

Sierk Bornemann | Hannover | Germany
e-mail:  [EMAIL PROTECTED]
URL: http://sierkbornemann.de/







38,39c38,39
 $Date: 2006-01-12 22:47:25 +0100 (Thu, 12 Jan 2006) $
 $Revision: 96 $
---

$Date: 2006-01-17 20:51:26 +0100 (Tue, 17 Jan 2006) $
$Revision: 106 $

47a48

#include apr_version.h

189c190,197
 APR_BRIGADE_FOREACH(e, bb) {
---

#if APR_MAJOR_VERSION
for (e = APR_BRIGADE_FIRST(bb);
 e != APR_BRIGADE_SENTINEL(bb);
 e = APR_BUCKET_NEXT(e))
#else
APR_BRIGADE_FOREACH(e, bb)
#endif
{

310c318
 meta name=\revision\ content=\$Id: mod_tidy.c 96 2006-01-12
21:47:25Z bornemann $\/\n
---

meta name=\revision\ content=\$Id: mod_tidy.c 106 2006-01-17
19:51:26Z bornemann $\/\n

605c613
 $Date: 2006-01-12 22:47:25 +0100 (Thu, 12 Jan 2006) $\n
---

$Date: 2006-01-17 20:51:26 +0100 (Tue, 17 Jan 2006) $\n






Re: Problem: compiling mod_tidy with Apache 2.2

2006-01-19 Thread Oden Eriksson
torsdagen den 19 januari 2006 16.59 skrev Steffen:
 Compiling on Windows and Apache 2.2.0 works with the patch.

 Steffen

 http://www.apachelounge.com
 - Original Message -
 From: Sierk Bornemann [EMAIL PROTECTED]
 To: dev@httpd.apache.org
 Sent: Thursday, January 19, 2006 3:28 PM
 Subject: Problem: compiling mod_tidy with Apache 2.2

  Hi!
 
  I am the project maintainer of the Apache2 module mod_tidy
  (http://mod-tidy.sourceforge.net/), and there seems to be a problem
  compiling mod_tidy with Apache 2.2, because API has changed from
  Apache2.0 to Apache2.2:
 
  Compiler error messages:
  --
  src/mod_tidy.c: In function 'mod_tidy_filter':
  src/mod_tidy.c:189: warning: implicit declaration of function
  'APR_BRIGADE_FOREACH'
  src/mod_tidy.c:189: error: expected ';' before '{' token
  src/mod_tidy.c:154: warning: unused variable 'r'
  apxs:Error: Command failed with rc=65536
  --
 
  APR_BRIGADE_FOREACH does not longer exist, so there must be a short fix
  reflecting this.
 
  I have a short patch here, which compiles well under apache2.0.55 and
  which lets to a functionable binary under Linux (OpenSuse), but I have
  no possibility yet to check, if it also compiles and works with
  apache2.2.
 
  For convenience, I have attached the little patch as a Unix diff to this
  email.
  The source tarball of mod_tidy is available on:
  http://mod-tidy.sourceforge.net/src/
  Is here anybody, who can help and have a look into the source and the
  patch or propose a better patch to solve the problem?
 

Looks similar to my hack in Mandriva.

-- 
Regards // Oden Eriksson
Mandriva: http://www.mandriva.com
NUX: http://li.nux.se
--- src/mod_tidy.c	2005-11-11 01:47:57.0 +0100
+++ src/mod_tidy.c.oden	2005-12-16 02:33:27.0 +0100
@@ -186,7 +186,9 @@
 			cfg-tidyoptions, NULL );
 	}
 
-APR_BRIGADE_FOREACH(e, bb) {
+for (e = APR_BRIGADE_FIRST(bb);
+ e != APR_BRIGADE_SENTINEL(bb);
+ e = APR_BUCKET_NEXT(e)) {
 const char *str;
 apr_size_t len;