Thursday, 17 July 2008
|
| [Fwd: aurora issues] Philip M. Gollucci 22:03:23 |
| | --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | Add comment |
Wednesday, 16 July 2008
|
| AT Bug Torsten Foertsch 17:23:03 |
| | Hi,
on my Linux box sometimes (quite often) the httpd don't start during make test. The error_log doesn't say anything useful:
[Wed Jul 16 13:08:53 2008] [info] mod_unique_id: using ip addr 192.168.0.4 [Wed Jul 16 13:08:54 2008] [info] Init: Seeding PRNG with 0 bytes of entropy [Wed Jul 16 13:08:54 2008] [info] Init: Generating temporary RSA private keys (512/1024 bits) [Wed Jul 16 13:08:54 2008] [info] Init: Generating temporary DH parameters (512/1024 bits) [Wed Jul 16 13:08:54 2008] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] [Wed Jul 16 13:08:54 2008] [info] Init: Initializing (virtual) servers for SSL [Wed Jul 16 13:08:54 2008] [info] mod_ssl/2.2.9 compiled against Server: Apache/2.2.9, Library: OpenSSL/0.9.8g END in modperl_extra.pl, pid=7145
However, it should because httpd fails to start because an undefined value is passed to Apache::TestConfig::untaint_path and hence perl croaks. Why it sometimes do start I don't know.
To see the actual perl error I had to start httpd with:
strace -ff -ostrace -s 4096 /opt/apache22-prefork/sbin/httpd -d $PWD/t \ -f $PWD/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS -e debug
and look into the strace.PID file with the largest PID. There at the end I found the error message.
So I instrumented the code a bit:
... # return an untainted PATH sub untaint_path { my $path = shift; # return '' unless( defined $path ); unless( defined $path ) { use Carp; use Data::Dumper; Carp::confess(Data: umper->Dump([\%ENV], ['*ENV'])); } ($path) = ( $path =~ /(.*)/ ); ...
Now I found (manually formatted):
[Wed Jul 16 13:18:16 2008] [error] %ENV = ( 'TestDirective__env_srv1' => 'env_srv1', 'IFS' => undef, 'HARNESS_ACTIVE' => 1, 'APACHE_TEST_HTTP_09_OK' => 0, 'PERL_LWP_USE_HTTP_10' => 1, 'ENV' => undef, 'MOD_PERL_API_VERSION' => 2, 'TestDirective__env_srv2' => 'env_srv2', 'HARNESS_VERSION' => '2.64', 'CDPATH' => undef, 'BASH_ENV' => undef, 'MOD_PERL' => 'mod_perl/2.0.5-dev' ); at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/TestConfig.pm line 1776 Apache::TestConfig::untaint_path(undef) called at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/TestConfig.pm line 1102 Apache::TestConfig::open_cmd('Apache::TestConfig=HASH(0x137bff8)', '"/opt/apache22-prefork/sbin/httpd" -l') called at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/TestConfigParse.pm line 436 Apache::TestConfig::get_httpd_static_modules('Apache::TestConfig=HASH(0x137bff8)') called at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/TestConfigParse.pm line 361 Apache::TestConfig::inherit_config('Apache::TestConfig=HASH(0x137bff8)') called at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/TestConfig.pm line 417 Apache::TestConfig::httpd_config('Apache::TestConfig=HASH(0x137bff8)') called at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/Test.pm line 110 Apache::Test::config() called at /home/r2/work/mp2/trunk/clean-trunk-prefork/Apache-Test/lib/Apache/Test.pm line 121 Apache::Test::vars('documentroot') called at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_extra.pl line 129 main::test_hooks_startup() called at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_extra.pl line 42 require conf/modperl_extra.pl called at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_startup.pl line 18 eval {...} called at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_startup.pl line 19 main::BEGIN() called at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_extra.pl line 0 eval {...} called at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_extra.pl line 0 require /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_startup.pl called at (eval 2) line 1 eval 'require qCompilation failed in require at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_startup.pl line 18. BEGIN failed--compilation aborted at /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_startup.pl line 36. Compilation failed in require at (eval 2) line 1. [Wed Jul 16 13:18:16 2008] [error] Can't load Perl file: /home/r2/work/mp2/trunk/clean-trunk-prefork/t/conf/modperl_startup.pl for server localhost:8529, exiting...
Now, AT experts are needed to mull over:
1) why don't the error message show up in the error_log 2) is the enclosed patch a sufficient cure or does it rather hide a real problem (why is $ENV{PATH} undef in the first place)
The strace output for that process starts with these lines:
setsid() = 7719 close(0) = 0 open("/dev/null", O_RDONLY) = 0 close(1) = 0 open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 1 close(2) = 0 open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 2 stat("/opt/apache22-prefork/bin/suexec", 0x7fffb935fda0) = -1 ENOENT (No such file or directory)
So the first question is answered. However I don't know if it is wise to redirect STDERR to /dev/null. The string "error_log" doesn't appear in combination with an open syscall in that trace.
Torsten
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | 3 answer | Add comment |
|
| [RFC] Basic LoadFile support for Apache::Test Torsten Foertsch 01:05:54 |
| | Hi,
I don't know much about Apache::Test guts. Hence I ask for review before committing this patch.
It treats LoadFile directives similar to LoadModule. One can skip them by adding the name as specified in the httpd.conf to the skip list (not tested).
LoadFile directives are written at the very top of the generated httpd.conf.
It works at least for mod_proxy_html.
Torsten
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | 2 answer | Add comment |
Tuesday, 15 July 2008
|
| Apache::DBI 1.07 requires global $r Fred Moyer 01:50:22 |
| | Just ran into this issue with Apache::DBI 1.07:
[Sun Jul 13 14:16:02 2008] [error] Global $r object is not available. Set: PerlOptions +GlobalRequest in httpd.conf at /home/phred/dev/perl/lib/site_perl/5.8.8/Apache/DBI.pm line 144.
Traced it from a bug report to:
http://rt.cpan.org/Public/Bug/Display.html?id=36346
and then
http://rt.cpan.org/Public/Bug/Display.html?id=29209
I see a couple issues with the patch that caused this, but I'm not sure what problem the patch was trying to solve.
I can offer up some tuits to release 1.08 and roll that patch back. I'm not sure how many users are using global $r with mod_perl, but I would guess that the global request is a bigger issue than the problem which the patch was supposed to solve.
|
| | 3 answer | Add comment |
Sunday, 13 July 2008
|
| Bus Error with mod_perl 2.04 David E. Wheeler 10:27:24 |
| | Howdy,
I can get Apache to crash with a Bus Error with this httpd.conf:
LoadModule perl_module modules/mod_perl.so ServerName localhost ServerRoot /usr/local/apache2 PidFile logs/httpd.pid Listen 80 User daemon Group daemon StartServers 2 ErrorLog logs/error_log CustomLog logs/access_log combined TypesConfig conf/mime.types PerlModule mod_perl2 PerlPassEnv PERL5LIB PerlModule MyConfig
This is MyConfig.pm:
package MyConfig;
require Apache2::ServerUtil; my $s = Apache2::ServerUtil->server; $s->add_config([ 'NameVirtualHost *:80', '<VirtualHost *:80>', ' DocumentRoot /usr/local/apache2/htdocs', '</VirtualHost>', ]);
1;
If I comment out the <VirtualHost> section, it works. So there's something about <VirtualHost> sections that add_config doesn't seem to like. I've attached the Crash file created by Mac OS X. I'm using mod_perl 2.04 as a DSO with Apache 2.2.8 and Perl 5.10. Holler if you need more details on my configuration.
Thanks,
David
Process: httpd [67450] Path: /usr/local/apache2/bin/httpd Identifier: httpd Version: ??? (???) Code Type: X86 (Native) Parent Process: sh [67449]
Date/Time: 2008-04-22 12:46:14.202 -0700 OS Version: Mac OS X 10.5.2 (9C7010) Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000 Crashed Thread: 0
Thread 0 Crashed: 0 httpd 0x0002f43b open_multi_logs + 46 1 httpd 0x0002f7be init_config_log + 112 2 httpd 0x00002b88 ap_run_open_logs + 106 3 httpd 0x0000a701 main + 2438 4 httpd 0x000023ee start + 54
Thread 0 crashed with X86 Thread State (32-bit): eax: 0x00000000 ebx: 0x0002f419 ecx: 0x00842000 edx: 0x00853790 edi: 0x00000000 esi: 0x00000000 ebp: 0xbffff818 esp: 0xbffff7d0 ss: 0x0000001f efl: 0x00010206 eip: 0x0002f43b cs: 0x00000017 ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037 cr2: 0x00000000
Binary Images: 0x1000 - 0x69fff +httpd ??? (???) /usr/local/apache2/bin/httpd 0x8d000 - 0x9aff3 libaprutil-1.0.dylib ??? (???) <931e8ac4ce826f08f2abffcac57a63b3> /usr/lib/libaprutil-1.0.dylib 0xa3000 - 0xc1fe3 libexpat.1.dylib ??? (???) <eff8a63a23a7d07af62b36fdb329e393> /usr/lib/libexpat.1.dylib 0xc9000 - 0xdefef libapr-1.0.dylib ??? (???) <34917fe927e85ef7f60ec1303338e9af> /usr/lib/libapr-1.0.dylib 0xec000 - 0xeefff libutil.dylib ??? (???) <5ac8a5517aae408d0fdb6da13a2faf89> /usr/lib/libutil.dylib 0xf3000 - 0xf5ff7 +ServerUtil.bundle ??? (???) /usr/local/lib/perl5/site_perl/5.10.0/darwin-2level/auto/Apache2/ServerUtil/ServerUtil.bundle 0x200000 - 0x220fff +mod_perl.so ??? (???) /usr/local/apache2/modules/mod_perl.so 0x22c000 - 0x357feb +libperl.dylib ??? (???) <4e9bb84c90f0608918e2be04525bc49a> /usr/local/lib/perl5/5.10.0/darwin-2level/CORE/libperl.dylib 0x8fe00000 - 0x8fe2da53 dyld 96.2 (???) <7af47d3b00b2268947563c7fa8c59a07> /usr/lib/dyld 0x9244f000 - 0x92456fe9 libgcc_s.1.dylib ??? (???) <a9ab135a5f81f6e345527df87f51bfc9> /usr/lib/libgcc_s.1.dylib 0x92bce000 - 0x92bd2fff libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib 0x93004000 - 0x930f8ff4 libiconv.2.dylib ??? (???) <c508c60fafca17824c0017b2e4369802> /usr/lib/libiconv.2.dylib 0x9542f000 - 0x954b6ff7 libsqlite3.0.dylib ??? (???) <6978bbcca4277d6ae9f042beff643f7d> /usr/lib/libsqlite3.0.dylib 0x96c97000 - 0x96df6ff3 libSystem.B.dylib ??? (???) <4899376234e55593b22fc370935f8cdf> /usr/lib/libSystem.B.dylib 0xffff0000 - 0xffff1780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | 14 answers | Add comment |
Friday, 11 July 2008
|
| [Fwd: [rt.cpan.org #37592]] Geoffrey Young 08:21:25 |
| |
-------- Original Message -------- Subject: [rt.cpan.org #37592] Date: Thu, 10 Jul 2008 12:15:12 -0400 From: Doug via RT <bug-mod_perl@rt.cpan.org> Reply-To: bug-mod_perl@rt.cpan.org To: undisclosed-recipients:; References: <RT-Ticket-37592@rt.cpan.org>
Thu Jul 10 12:15:09 2008: Request 37592 was acted upon. Transaction: Ticket created by dougbitcard Queue: mod_perl Subject: (No subject given) Broken in: 2.0.2 Severity: Normal Owner: Nobody Requestors: dougbitcard@claar.org Status: new Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=37592 >
APR::Date::parse_rfc does not accept a date of the form:
Wed, 14 Nov 2007 17:03 -0800
(Note that there are no seconds on the time)
This is RFC822 compliant: hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT]
And it is RFC2822 compliant: time-of-day = hour ":" minute [ ":" second ]
Apparently, APR::Date will work with a date specification that does not include seconds, but only if the year is only 2 digits.
My report is based on observed behavior in 2.0.2, but also on the latest documentation. This is on a linux FC6 system if that matters.
|
| | 1 answer | Add comment |
Monday, 30 June 2008
|
| Re: svn commit: r672819 - in /perl/modperl/trunk: src/modules/perl/mod_perl.c
src/modules/perl/modp Philippe M. Chiasson 21:48:26 |
| | torsten@apache.org wrote:
Author: torsten Date: Mon Jun 30 09:51:30 2008 New Revision: 672819 Log: silence some "unused" warnings Modified: perl/modperl/trunk/src/modules/perl/mod_perl.c perl/modperl/trunk/src/modules/perl/modperl_env.c perl/modperl/trunk/src/modules/perl/modperl_perl_global.c perl/modperl/trunk/src/modules/perl/modperl_util.c perl/modperl/trunk/xs/Apache2/Access/Apache2__Access.h perl/modperl/trunk/xs/Apache2/Directive/Apache2__Directive.h Shouldn't this change have been applied to trunk/ and then svnmerged to the threading/ branch ?
Otherwise, the next person to svnmerge will almost certainly get a nasty merge conflict. It's also fixable after the fact with 'svnmerge block'.
-- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
|
| | 2 answer | Add comment |
|
| silence unused warnings Torsten Foertsch 21:11:54 |
| | Hi,
this patch silence a few warnings about unused variables and unused return codes. It is against the threading branch but is applyable with offsets to trunk. Is it OK to apply it?
Torsten
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | 3 answer | Add comment |
|
| Apache::Test problem Torsten Foertsch 21:05:46 |
| | Hi,
I have mod_proxy_html in my httpd.conf. This requires an additional LoadFile directive to load libxml prior to LoadModule. Unfortunately the httpd.conf generated by the test framework includes the "LoadModule mod_proxy_html" but omits the "LoadFile libxml.so".
I can solve this problem by adding mod_proxy_html to the skip list in TEST.PL:
Apache::TestConfig::autoconfig_skip_module_add('mod_proxy_html.c');
But I cannot know all modules that need special LoadFiles that a user of my perl module may load.
How is this situation resolved best?
Torsten
|
| | 1 answer | Add comment |
|
| Re: svn commit: r672738 - /perl/modperl/branches/threading/Makefile.PL Philippe M. Chiasson 20:41:32 |
| | torsten@apache.org wrote:
Author: torsten Date: Mon Jun 30 03:34:11 2008 New Revision: 672738 Log: allow for other suffixes than "-dev" or "-rc\d+" in our VERSION_STRING Good idea, should make it to the trunk/ as well, IMO.
Modified: ============================================================================== --- perl/modperl/branch es/threading/Makefile.PL (original) +++ perl/modperl/branch es/threading/Makefile.PL Mon Jun 30 03:34:11 2008 @@ -480,7 +480,7 @@ open my $fh, 'Changes'; while (<$fh>) { - if (/^=item.*-(dev|rc\d+)/) { + if (/^=item\s+\Q$VERSION\E-(\w+)/) { $VERSION .= "-$1"; last; } -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
|
| | Add comment |
|
| Question about branching Torsten Foertsch 20:37:27 |
| | Hi,
this is an excerpt of our BRANCHING document:
####################################### ### make a new branch ### ####################################### we will create a branch mybranch branch: -m "creating mybranch" check out: change externals to point to the new A-T branch (if one was done) svn propedit svn:externals . The threading branch doesn't have a new A-T or docs. Hence, A-T and docs point to the current trunk. I don't want to commit something by chance to these trees. Can I have SVN automatically forbid such changes?
initialize svnmerge tracking in the branch (if you plan to pull trunk/ changes into the branch) Is this thought to be one big commit? Or should it rather be a set of smaller changes?
mybranch/ $> svnmerge init When am I supposed to do this before I begin to integrate trunk changes or after all changes are committed to my branch?
property 'svnmerge-integrated' set on '.' mybranch/ $> svn ci -F svnmerge-commit-message.txt Is this done as a separate commit or is it the one big commit or the last one?
Sorry for being so stupid, Torsten
|
| | 2 answer | Add comment |
Saturday, 28 June 2008
|
| possible bug in Apache2::XSLoader and APR::XSLoader Torsten Foertsch 13:50:55 |
| | Hi,
what is the purpose of Apache2::XSLoader and APR::XSLoader?
Both modules contain a load() function that reads:
sub load { return unless BOOTSTRAP; XSLoader::load(@_); }
I believe this is wrong. The XSLoader::load function contains this code:
my @modparts = split(/::/,$module); my $modfname = $modparts[-1];
my $modpname = join('/',@modparts); my $modlibname = (caller())[1]; my $c = @modparts; $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename my $file = "$modlibname/auto/$modpname/$modfname.$dl_dlext";
You see $modlibname is built from the caller's filename. If APR::XSLoader is used this caller is /path/to/APR/XSLoader.pm and not as expected by the code the filename of the caller of APR::XSLoader::load.
As a result XSLoader tries to load the shared lib from the wrong location.
A simple change makes it work as expected:
goto &XSLoader::load;
This way instead of pushing a new frame on the call stack the current (APR::XSLoader::load) frame is replaced by XSLoader::load. Hence caller() sees the original caller.
Torsten
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | 2 answer | Add comment |
|
| [Fwd: CPAN Upload: P/PH/PHRED/Apache-Bootstrap-0.04_01.tar.gz] Fred Moyer 08:28:06 |
| | More hacking on this today.
Summary of changes from 0.03 to 0.04_01:
- more tests, coverage for success conditions - now we actually fail at compile time if base mod_perl is not present
I think it's making headway and will be fairly useful at some point, but I'd like your input.
The goal here is to have a module that makes it easy to bootstrap and maintain dual life (mp1+mp2) Apache::*/Apache2::* modules.
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | Add comment |
Tuesday, 24 June 2008
|
| 2nd Try: Cannot Access Includes Above Current Directory if using SSL Steve Benson 05:37:20 |
| | Sorry to ask again but I could use a suggestion or two. I'm new to your list and configuring Apache with the SSL module enabled and have a newbie configuration glitch I've not been able to resolve. I'm very puzzled over why my scripts with included files, either SSI or PHP, work fine outside of the SSL directory structure (but still at similar nested levels in directory tree but not SSL). i.e. given that /www/sd/htdocs/include/middle.html exists with index.shtml in /www/sd/htdocs/test (http) with the lines <!--#include file="../include/middle.html" --> and <!--#echo var="DOCUMENT_NAME" --> run fine and middle.html is included and the document name is displayed. Excellent!
But the same index.shtml in /www/sd/htdocs/jobs (https) <!--#include file="../include/middle.html" --> fails to include middle.html and the error_log file reports: unable to include file "/www/sd/htdocs/include/middle.html" in parsed file /www/sd/htdocs/jobs/index.shtml Not problem with <!--#echo var="DOCUMENT_NAME" --> the document name is displayed. Only half excelent.
I changed the SSI to <!--#include virtual="../include/middle.html" --> as you suggested but the result was the same. I changed the relative path used to absolute and also got the same result. I can use includes in the SSL directory as long as they're at the same level or below. If I move the above example (including the include directory) down one level in the https directory tree i.e. given that /www/sd/htdocs/jobs/include/middle.html exists with index.shtml in /www/sd/htdocs/jobs/test (https) <!--#include file="../include/middle.html" --> it also fails. So I can't go up even within the https directory tree. The same scenario under http presents no problems.
The SSI is mostly for testing trying to figure out why my PHP scripts are acting this way. I'm trying to keep it simple so I can find the root cause of my SSL (https) virtual server failure to work with upper level include files.
I imagine there's something in my SSL configuration causing this but after trying many <Directory>, <Location> and even a ScriptAlias changes to the ssl.conf I've not been able to get around this. I've created a number of Apache web sites but this is my first using SSL(mod_ssl incorporated into Apache 2.0.48, openssl). I've never encountered anything like this before in web development. My configuration is: RH Linux Kernel 2.4.20-8, Apache 2.0.48, OpenSSL -0.9.6l, PHP 4.3.4, Apache was compiled with SSL and SSI enabled. SSL appears to work OK i.e. recognized by browser, cert and key accepted etc.
I appreciate any suggestions.
Thanks,
............ Steve
|
| | 1 answer | Add comment |
Sunday, 22 June 2008
|
| Apache::Bootstrap 0.02 Fred Moyer 07:43:20 |
| | Hacking away on this some more.
http://people.apache.org/~phred/Apache-Bootstrap-0.02.tar.gz
As I tested this out with Apache::Dispatch today, I came to the realization that Apache::Bootstrap itself must be bootstrapped in the Makefile.PL. Here's how I did it in Apache::Dispatch, parts ripped off from ExtUtil::MakeMaker. I'm still fuzzy on the details of how not to cause CPAN testers failures.
Any thoughts here welcome - still bootstrapping this (no pun intended
BEGIN { my $AB_VER = 0.02; my $fail_msg = "Warning: prerequisite Apache::Bootstrap $AB_VER not found.";
eval { require Apache::Bootstrap }; die $fail_msg . "\n" if $@;
die $fail_msg . " We have $Apache::Bootstrap::VERSION.\n" if $Apache::Bootstrap::VERSION < $AB_VER; }
... some code
my $mp_gen = Apache::Bootstrap->satisfy_mp_generation(2);
|
| | 1 answer | Add comment |
Saturday, 31 May 2008
|
| [RFC] Apache::Bootstrap 0.01 proof of concept Fred Moyer 05:10:02 |
| | Busy fingers today.
I've pulled the bootstrap code out of Apache::Reload into a standalone module Apache::Bootstrap. I didn't fix any of the current issues, merely ported it out, and tested the implementation with Apache::Reload, which seems to be working as well as when it the bootstrap code was embedded.
I've posted a proof of concept for review [1]. Please take a look and provide feedback. I've also posted the refactored A::R Makefile.PL [2].
If this approach sits well I'll move ahead with updating it to address the CPAN testers PRs that are coming in from version issues.
[1] http://people.apache.org/~phred/Apache-Bootstrap-0.01.tar.gz
[2] http://people.apache.org/~phred/A_R_Makefile.PL
- Fred
-- Red Hot Penguin Consulting LLC mod_perl/PostgreSQL consulting and implementation http://www.redhotpenguin.com/
|
| | 6 answers | Add comment |
|
| [Fwd: [rt.cpan.org #36305] Overridden get_basic_credentials broken
w/ NTLM Authentication] Geoffrey Young 02:28:23 |
| |
-------- Original Message -------- Subject: [rt.cpan.org #36305] Overridden get_basic_credentials broken w/ NTLM Authentication Date: Fri, 30 May 2008 13:43:17 -0400 From: RFRANKEL via RT <bug-Apache-Test@rt.cpan.org> Reply-To: bug-Apache-Test@rt.cpan.org To: undisclosed-recipients:; References: <RT-Ticket-36305@rt.cpan.org>
Fri May 30 13:43:16 2008: Request 36305 was acted upon. Transaction: Ticket created by RFRANKEL Queue: Apache-Test Subject: Overridden get_basic_credentials broken w/ NTLM Authentication Broken in: 1.29, 1.30 Severity: Important Owner: Nobody Requestors: RFRANKEL@cpan.org Status: new Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36305 >
Apache::TestRequest::get_basic_credentials dies when accessing a realm using mod_ntlm for authentication. The reason is that $realm is undefined.
Patch to fix below:
--- TestRequest.pm~ 2007-11-14 01:44:36.000000000 -0500 +++ TestRequest.pm 2008-05-30 11:35:57.681722000 -0400 @@ -260,7 +260,7 @@ my($self, $realm, $uri, $proxy) = @_;
for ($realm, '__ALL__') { - next unless $credentials{$_}; + next unless $_ && $credentials{$_}; return @{ $credentials{$_} }; }
|
| | 2 answer | Add comment |
Tuesday, 27 May 2008
|
| [Fwd: Re: "bool" redefined warning in my build, but what part of
the toolchain is causing Philip M. Gollucci 21:46:35 |
| | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Forgot to CC list.
- -- - ------------------------------------------------------------------------ Philip M. Gollucci (philip@ridecharge.com) o:703.549.2050x206 Senior System Admin - Riderway, Inc. http://riderway.com / http://ridecharge.com 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C
Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIPEj7dbiP+9ubjBwRAkC6AJsGikCxVrzBIQM94CMy1utVaqQ6LACcDpNa +XVy4gZpP50zAI2c6Rmc3/U= =0wnD -----END PGP SIGNATURE-----
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org |
| | Add comment |
|
| [PATCH] - fixup Apache::* externals to use tags Fred Moyer 21:46:01 |
| | This change modifies svn externals to pull tagged versions of A::SL, A::R, and A::T.
Please note that because due to my previous oops the current version of A::T in the mp 2.04 release is 1.31, so 1.31 will need to be packaged and tagged, then this updated before we ship 2.05, I have added this to the 2.0.5 todo.
+1 (pretty sure I can vote on my patch, checked the ASF guidelines but didn't find a definitive answer there.
phred@pooky ~/dev/svn/modperl/mod_perl-2.0 $ svn diff .
Property changes on: . ___________________________________________________________________ Name: svn:externals - Apache-Test https://svn.apache.org/repos/asf/perl/Apache-Test/trunk docs https://svn.apache.org/repos/asf/perl/modperl/docs/trunk/src/docs/2.0
+ Apache-Test https://svn.apache.org/repos/asf/perl/Apache-Test/tags/1_30 Apache-Reload https://svn.apache.org/repos/asf/perl/Apache-Reload/tags/0_10 Apache-SizeLimit https://svn.apache.org/repos/asf/perl/Apache-SizeLimit/tags/0_91 docs https://svn.apache.org/repos/asf/perl/modperl/docs/trunk/src/docs/2.0
|
| | 2 answer | Add comment |
Sunday, 25 May 2008
|
| "bool" redefined warning in my build, but what part of the toolchain
is causing it? Fred Moyer 00:26:20 |
| | I'm guessing this is an issue with the OS X toolchain since I'm not seeing it on Linux, but any confirmation would be helpful. It's not like this output is easy on the eyes to parse
cp FilterRec.bs ../../../blib/arch/auto/Apache2/FilterRec/FilterRec.bs chmod 644 ../../../blib/arch/auto/Apache2/FilterRec/FilterRec.bs cp FilterRec.pm ../../../blib/lib/Apache2/FilterRec.pm In file included from /Users/phred/dev/perl/lib/5.8.8/darwin-2level/CORE/perl.h:2120, from /Users/phred/dev/svn/modperl/mod_perl-2.0/src/modules/perl/modperl_perl_includes.h:65, from /Users/phred/dev/svn/modperl/mod_perl-2.0/src/modules/perl/modperl_common_includes.h:24, from /Users/phred/dev/svn/modperl/mod_perl-2.0/src/modules/perl/mod_perl.h:21, from FilterRec.xs:18: /Users/phred/dev/perl/lib/5.8.8/darwin-2level/CORE/handy.h:85:1:
warning: "bool" redefined
In file included from /usr/include/mach-o/dyld.h:29, from /Users/phred/dev/sl/httpd2/include/apr_portable.h:166, from /Users/phred/dev/sl/httpd2/include/http_protocol.h:31, from /Users/phred/dev/svn/modperl/mod_perl-2.0/src/modules/perl/modperl_apache_includes.h:30, from /Users/phred/dev/svn/modperl/mod_perl-2.0/src/modules/perl/mod_perl.h:20, from FilterRec.xs:18: /usr/lib/gcc/i686-apple-darwin9/4.0.1/include/stdbool.h:36:1: warning: this is the location of the previous definition rm -f ../../../blib/arch/auto/Apache2/FilterRec/FilterRec.bundle env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib FilterRec.o -L/usr/local/lib -L/opt/local/lib -o ../../../blib/arch/auto/Apache2/FilterRec/FilterRec.bundle \ \
chmod 755 ../../../blib/arch/auto/Apache2/FilterRec/FilterRec.bundle /Users/phred/dev/perl/bin/perl /Users/phred/dev/perl/lib/5.8.8/ExtUtils/xsubpp -typemap /Users/phred/dev/per
|
| | Add comment |
Saturday, 24 May 2008
|
| Problems compiling mod_proxy_html with Apache 2.1.3-beta Devin L. Ganger 18:44:05 |
| | I'm trying to build a full reverse proxy that can properly handle the cookies from my back-end systems.
My system is running Solaris 9/SPARC, gcc 3.4.2, with the following libraries:
BerkeleyDB 4.2.52 expat 1.95.5 iconv 1.8 libxml2 2.6.19 OpenSSL 0.9.7f PCRE 4.5 zlib 1.2.2
At first I tried using Apache 2.0.53 with Nick Kew's mod_proxy_html.c add-on, as well as his patch to mod_proxy to support the ProxyPassReverseCookieDomain and ProxyPassReverseCookiePath directives. When I tried to apply the patch to the source, it failed to apply cleanly.
So now I'm using Apache 2.1.3-beta. Compiling and installing Apache goes fine, but when I try to compile mod_proxy_html.c, it's failing:
$ bin/apxs -c -i -I /usr/local/include/libxml2 mod_proxy_html.c /usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DSOLARIS2=9 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE64_SOURCE -g -O2 -pthreads -I/usr/local/include -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/include -I/usr/local/include/libxml2 -c -o mod_proxy_html.lo mod_proxy_html.c && touch mod_proxy_html.slo mod_proxy_html.c:91: error: parse error before "regex_t" mod_proxy_html.c:91: warning: no semicolon at end of struct or union mod_proxy_html.c:91: warning: no semicolon at end of struct or union mod_proxy_html.c:92: warning: data definition has no type or storage class mod_proxy_html.c:94: error: parse error before '}' token mod_proxy_html.c:94: warning: data definition has no type or storage class mod_proxy_html.c:96: error: parse error before "urlmap" mod_proxy_html.c:96: warning: no semicolon at end of struct or union mod_proxy_html.c:107: error: parse error before '}' token mod_proxy_html.c:107: warning: data definition has no type or storage class mod_proxy_html.c:111: error: parse error before "proxy_html_conf" mod_proxy_html.c:111: warning: no semicolon at end of struct or union mod_proxy_html.c:117: error: parse error before '}' token mod_proxy_html.c:117: warning: data definition has no type or storage class mod_proxy_html.c: In function `pcharacters': mod_proxy_html.c:169: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:169: error: (Each undeclared identifier is reported only once mod_proxy_html.c:169: error: for each function it appears in.) mod_proxy_html.c:169: error: parse error before ')' token mod_proxy_html.c: At top level: mod_proxy_html.c:183: error: parse error before '*' token mod_proxy_html.c: In function `preserve': mod_proxy_html.c:185: error: `len' undeclared (first use in this function) mod_proxy_html.c:185: error: `ctx' undeclared (first use in this function) mod_proxy_html.c: At top level: mod_proxy_html.c:199: error: parse error before '*' token mod_proxy_html.c: In function `pappend': mod_proxy_html.c:200: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:200: error: `len' undeclared (first use in this function) mod_proxy_html.c: At top level: mod_proxy_html.c:204: error: parse error before '*' token mod_proxy_html.c: In function `dump_content': mod_proxy_html.c:205: error: `m' undeclared (first use in this function) mod_proxy_html.c:211: error: `regmatch_t' undeclared (first use in this function) mod_proxy_html.c:211: error: parse error before "pmatch" mod_proxy_html.c:215: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:226: error: `pmatch' undeclared (first use in this function) mod_proxy_html.c: In function `pcdata': mod_proxy_html.c:281: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:281: error: parse error before ')' token mod_proxy_html.c: In function `pcomment': mod_proxy_html.c:289: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:289: error: parse error before ')' token mod_proxy_html.c: In function `pendElement': mod_proxy_html.c:302: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:302: error: parse error before ')' token mod_proxy_html.c: In function `pstartElement': mod_proxy_html.c:321: error: `m' undeclared (first use in this function) mod_proxy_html.c:324: error: `ctx' undeclared (first use in this function) mod_proxy_html.c:324: error: parse error before ')' token mod_proxy_html.c:326: error: `regmatch_t' undeclared (first use in this function) mod_proxy_html.c:326: error: parse error before "pmatch" mod_proxy_html.c:425: error: `pmatch' undeclared (first use in this function) mod_proxy_html.c: At top level: mod_proxy_html.c:583: error: parse error before '*' token mod_proxy_html.c:583: warning: data definition has no type or storage class mod_proxy_html.c:584: error: parse error before '*' token mod_proxy_html.c:584: warning: data definition has no type or storage class mod_proxy_html.c:585: error: parse error before '*' token mod_proxy_html.c:585: warning: data definition has no type or storage class mod_proxy_html.c: In function `proxy_html_child_init': mod_proxy_html.c:590: error: `REG_EXTENDED' undeclared (first use in this function) mod_proxy_html.c:590: error: `REG_ICASE' undeclared (first use in this function) mod_proxy_html.c:590: warning: assignment from incompatible pointer type mod_proxy_html.c:592: warning: assignment from incompatible pointer type mod_proxy_html.c:594: warning: assignment from incompatible pointer type mod_proxy_html.c: In function `sniff_encoding': mod_proxy_html.c:606: error: `regmatch_t' undeclared (first use in this function) mod_proxy_html.c:606: error: parse error before "match" mod_proxy_html.c:640: error: `match' undeclared (first use in this function) mod_proxy_html.c:640: warning: passing arg 1 of `ap_regexec' from incompatible pointer type mod_proxy_html.c:643: warning: passing arg 1 of `ap_regexec' from incompatible pointer type mod_proxy_html.c: At top level: mod_proxy_html.c:669: error: 'metafix' redeclared as different kind of symbol mod_proxy_html.c:101: error: previous declaration of 'metafix' was here mod_proxy_html.c: In function `metafix': mod_proxy_html.c:676: error: `regmatch_t' undeclared (first use in this function) mod_proxy_html.c:676: error: parse error before "pmatch" mod_proxy_html.c:679: error: `pmatch' undeclared (first use in this function) mod_proxy_html.c:679: warning: passing arg 1 of `ap_regexec' from incompatible pointer type mod_proxy_html.c: In function `proxy_html_filter_init': mod_proxy_html.c:721: error: `fctx' undeclared (first use in this function) mod_proxy_html.c: At top level: mod_proxy_html.c:754: error: parse error before '*' token mod_proxy_html.c: In function `check_filter_init': mod_proxy_html.c:769: error: `cfg' undeclared (first use in this function) mod_proxy_html.c: In function `proxy_html_filter': mod_proxy_html.c:790: error: `ctxt' undeclared (first use in this function) mod_proxy_html.c: In function `proxy_html_config': mod_proxy_html.c:864: error: `ret' undeclared (first use in this function) mod_proxy_html.c: In function `proxy_html_merge': mod_proxy_html.c:871: error: `base' undeclared (first use in this function) mod_proxy_html.c:871: error: parse error before ')' token mod_proxy_html.c:872: error: `add' undeclared (first use in this function) mod_proxy_html.c:872: error: parse error before ')' token mod_proxy_html.c:873: error: `conf' undeclared (first use in this function) mod_proxy_html.c:876: error: `a' undeclared (first use in this function) mod_proxy_html.c:879: error: `save' undeclared (first use in this function) mod_proxy_html.c: In function `set_urlmap': mod_proxy_html.c:919: error: `cfg' undeclared (first use in this function) mod_proxy_html.c:919: error: parse error before ')' token mod_proxy_html.c:920: error: `map' undeclared (first use in this function) mod_proxy_html.c:921: error: `newmap' undeclared (first use in this function) mod_proxy_html.c:945: error: `REG_EXTENDED' undeclared (first use in this function) mod_proxy_html.c:946: error: `REG_ICASE' undeclared (first use in this function) mod_proxy_html.c:947: error: `REG_NOSUB' undeclared (first use in this function) mod_proxy_html.c:948: error: `REG_NEWLINE' undeclared (first use in this function) mod_proxy_html.c: In function `set_doctype': mod_proxy_html.c:957: error: `cfg' undeclared (first use in this function) mod_proxy_html.c:957: error: parse error before ')' token mod_proxy_html.c: At top level: mod_proxy_html.c:979: error: parse error before '*' token mod_proxy_html.c: In function `set_param': mod_proxy_html.c:980: error: `arg' undeclared (first use in this function) mod_proxy_html.c:982: error: `cfg' undeclared (first use in this function) mod_proxy_html.c: In function `set_flags': mod_proxy_html.c:991: error: parse error before ')' token mod_proxy_html.c:992: error: parse error before ')' token mod_proxy_html.c:993: error: parse error before ')' token mod_proxy_html.c: At top level: mod_proxy_html.c:1003: error: parse error before ')' token mod_proxy_html.c:1003: error: initializer element is not constant mod_proxy_html.c:1003: error: (near initialization for `proxy_html_cmds[3].cmd_data') mod_proxy_html.c:1003: error: initializer element is not constant mod_proxy_html.c:1003: error: (near initialization for `proxy_html_cmds[3]') mod_proxy_html.c:1006: error: initializer element is not constant mod_proxy_html.c:1006: error: (near initialization for `proxy_html_cmds[4].func') mod_proxy_html.c:1006: error: parse error before ')' token mod_proxy_html.c:1006: error: initializer element is not constant mod_proxy_html.c:1006: error: (near initialization for `proxy_html_cmds[4].cmd_data') mod_proxy_html.c:1006: error: initializer element is not constant mod_proxy_html.c:1006: error: (near initialization for `proxy_html_cmds[4]') mod_proxy_html.c:1009: error: initializer element is not constant mod_proxy_html.c:1009: error: (near initialization for `proxy_html_cmds[5].func') mod_proxy_html.c:1009: error: parse error before ')' token mod_proxy_html.c:1009: error: initializer element is not constant mod_proxy_html.c:1009: error: (near initialization for `proxy_html_cmds[5].cmd_data') mod_proxy_html.c:1009: error: initializer element is not constant mod_proxy_html.c:1009: error: (near initialization for `proxy_html_cmds[5]') mod_proxy_html.c:1013: error: initializer element is not constant mod_proxy_html.c:1013: error: (near initialization for `proxy_html_cmds[6].func') mod_proxy_html.c:1013: error: parse error before ')' token mod_proxy_html.c:1013: error: initializer element is not constant mod_proxy_html.c:1013: error: (near initialization for `proxy_html_cmds[6].cmd_data') mod_proxy_html.c:1013: error: initializer element is not constant mod_proxy_html.c:1013: error: (near initialization for `proxy_html_cmds[6]') mod_proxy_html.c:1017: error: initializer element is not constant mod_proxy_html.c:1017: error: (near initialization for `proxy_html_cmds[7].func') mod_proxy_html.c:1017: error: parse error before ')' token mod_proxy_html.c:1017: error: initializer element is not constant mod_proxy_html.c:1017: error: (near initialization for `proxy_html_cmds[7].cmd_data') mod_proxy_html.c:1017: error: initializer element is not constant mod_proxy_html.c:1017: error: (near initialization for `proxy_html_cmds[7]') mod_proxy_html.c:1020: error: initializer element is not constant mod_proxy_html.c:1020: error: (near initialization for `proxy_html_cmds[8]') apxs:Error: Command failed with rc=65536 .
At first, I thought (given the reference to regex_t) that it was a problem with my PCRE library (perhaps a conflict with my external library), but I recompiled Apache with --with-pcre and no change.
I've redownloaded the mod_proxy_html.c file in several different ways to rule out the possibility that it was corrupted, and I did take a look at the file to see if anything was obviously missing (I'm not a C programmer). I've searched Google and various other sources and haven't seen anyone else having this problem. Any ideas on pointers to where I can get more information about this problem, or things to try to nail down what the problem is?
-- Devin L. Ganger <devin@thecabal.org> "Aikido is based around the central precept of letting an attack take its natural course. You, of course, don't want to impede that natural flow by being in its way." -- overheard on the PyraMOO
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
|
| | 4 answer | Add comment |
|
| Hacking in #modperl tomorrow Fred Moyer 09:49:35 |
| | Will be working on getting the externals ready for 2.05. If you have some tuits, stop by!
Sent from my iPhone
|
| | Add comment |
Friday, 23 May 2008
|
| SVN 1.5 Philip M. Gollucci 20:09:08 |
| | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi All,
http://subversion.tigris.org/svn_1.5_releasenotes.html#externals
We should definitely make sure of this.
FWIW, the ASF is server 1.5.0.r5 as of a week ago.
- -- - ------------------------------------------------------------------------ Philip M. Gollucci (philip@ridecharge.com) o:703.549.2050x206 Senior System Admin - Riderway, Inc. http://riderway.com / http://ridecharge.com 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C
Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFINuwkdbiP+9ubjBwRAg7xAJ4gfrPsYkX663tmyjRIFTCEBLFPJgCff1un OdeQflqtsretGtWeDazDtcM= =XgTr -----END PGP SIGNATURE-----
|
| | Add comment |
Tuesday, 20 May 2008
|
| [Patch] SSM support for multicast.c Colm MacCarthaigh 03:26:06 |
| | As promised ;)
Patch also contains some whitespace/style cleanups my editor applied (uggh) and and I checked the IPv6 BSD for interface finding and modified it a little.
-- Colm MacCбrthaigh Public Key: colm+pgp@stdlib.net
Index: network_io/unix/multicast.c =================================================================== --- network_io/unix/multicast.c(revision 124104) +++ network_io/unix/multicast.c(working copy) @@ -25,7 +25,7 @@ #endif /* Only UDP and Raw Sockets can be used for Multicast */ -static apr_status_t mcast_check_type(apr_socket_t* sock) +static apr_status_t mcast_check_type(apr_socket_t *sock) { int type; apr_status_t rv; @@ -43,7 +43,7 @@ } } -static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, +static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, apr_sockaddr_t *iface) { mip->imr_multiaddr = mcast->sa.sin.sin_addr; @@ -56,7 +56,7 @@ } #if APR_HAVE_IPV6 -static unsigned int find_if_index(const apr_sockaddr_t *iface) +static unsigned int find_if_index(const apr_sockaddr_t *iface) { unsigned int index = 0; struct ifaddrs *ifp, *ifs; @@ -75,12 +75,10 @@ } for (ifp = ifs; ifp; ifp = ifp->ifa_next) { - if (ifp->ifa_addr != NULL && - ifp->ifa_addr->sa_family == AF_INET6) { - /* TODO: Is this correct? */ + if (ifp->ifa_addr != NULL && ifp->ifa_addr->sa_family == AF_INET6) { if (memcmp(&iface->sa.sin6.sin6_addr, &ifp->ifa_addr->sa_data[0], - sizeof(ifp->ifa_addr)) == 0) { + sizeof(iface->sa.sin6.sin6_addr)) == 0) { index = if_nametoindex(ifp->ifa_name); break; } @@ -92,7 +90,7 @@ return index; } -static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, +static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, const apr_sockaddr_t *iface) { memcpy(&mip->ipv6mr_multiaddr, mcast->ipaddr_ptr, @@ -108,7 +106,7 @@ #endif -static int sock_is_ipv4(apr_socket_t* sock) +static int sock_is_ipv4(apr_socket_t *sock) { if (sock->local_addr->family == APR_INET) return 1; @@ -116,7 +114,7 @@ } #if APR_HAVE_IPV6 -static int sock_is_ipv6(apr_socket_t* sock) +static int sock_is_ipv6(apr_socket_t *sock) { if (sock->local_addr->family == APR_INET6) return 1; @@ -124,19 +122,19 @@ } #endif -static apr_status_t do_mcast(int type, apr_socket_t *sock, +static apr_status_t do_mcast(int type, apr_socket_t *sock, apr_sockaddr_t *mcast, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm) + apr_sockaddr_t *source) { struct ip_mreq mip4; apr_status_t rv = APR_SUCCESS; #if APR_HAVE_IPV6 struct ipv6_mreq mip6; #endif - - /* We do not currently support Single Source Multicast. */ - if (ssm != NULL) - return APR_ENOTIMPL; +#if MCAST_JOIN_SOURCE_GROUP + struct group_source_req mip; + int ip_proto; +#endif rv = mcast_check_type(sock); @@ -144,37 +142,68 @@ return rv; } - if (sock_is_ipv4(sock)) { + if (source != NULL) { +#if MCAST_JOIN_SOURCE_GROUP + if (sock_is_ipv6(sock)) + ip_proto = IPPROTO_IP; + else if (sock_is_ipv6(sock)) + ip_proto = IPPROTO_IPV6; + else + return APR_ENOTIMPL; - fill_mip_v4(&mip4, mcast, iface); + if (type == IP_ADD_MEMBERSHIP) + type = MCAST_JOIN_SOURCE_GROUP; + else if (type == IP_DROP_MEMBERSHIP) + type = MCAST_LEAVE_SOURCE_GROUP; + else + return APR_ENOTIMPL; - if (setsockopt(sock->socketdes, IPPROTO_IP, type, - (const void *)&mip4, sizeof(mip4)) == -1) { + mip.gsr_interface = find_if_index(iface); + memcpy(&mip.gsr_group, mcast->ipaddr_ptr, sizeof(mip.gsr_group)); + memcpy(&mip.gsr_source, source->ipaddr_ptr, sizeof(mip.gsr_source)); + + if (setsockopt(sock->socketdes, ip_proto, type, (const void *) &mip, + sizeof(mip)) == -1) { rv = errno; } +#else + /* We do not support Source-Specific Multicast. */ + return APR_ENOTIMPL; +#endif } + else { + if (sock_is_ipv4(sock)) { + + fill_mip_v4(&mip4, mcast, iface); + + if (setsockopt(sock->socketdes, IPPROTO_IP, type, + (const void *) &mip4, sizeof(mip4)) == -1) { + rv = errno; + } + } #if APR_HAVE_IPV6 - else if (sock_is_ipv6(sock)) { - if (type == IP_ADD_MEMBERSHIP) { - type = IPV6_JOIN_GROUP; - } - else if (type == IP_DROP_MEMBERSHIP) { - type = IPV6_LEAVE_GROUP; - } - else { - return APR_ENOTIMPL; - } + else if (sock_is_ipv6(sock)) { + if (type == IP_ADD_MEMBERSHIP) { + type = IPV6_JOIN_GROUP; + } + else if (type == IP_DROP_MEMBERSHIP) { + type = IPV6_LEAVE_GROUP; + } + else { + return APR_ENOTIMPL; + } - fill_mip_v6(&mip6, mcast, iface); + fill_mip_v6(&mip6, mcast, iface); - if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &mip6, sizeof(mip6)) == -1) { - rv = errno; + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &mip6, sizeof(mip6)) == -1) { + rv = errno; + } } - } #endif - else { - rv = APR_ENOTIMPL; + else { + rv = APR_ENOTIMPL; + } } return rv; } @@ -183,7 +212,7 @@ apr_byte_t value) { apr_status_t rv = APR_SUCCESS; - + rv = mcast_check_type(sock); if (rv != APR_SUCCESS) { @@ -192,7 +221,7 @@ if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, type, - (const void *)&value, sizeof(value)) == -1) { + (const void *) &value, sizeof(value)) == -1) { rv = errno; } } @@ -201,7 +230,7 @@ unsigned int loopopt = value; type = IPV6_MULTICAST_LOOP; if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &loopopt, sizeof(loopopt)) == -1) { + &loopopt, sizeof(loopopt)) == -1) { rv = errno; } } @@ -213,8 +242,8 @@ return APR_ENOTIMPL; } - if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &value, sizeof(value)) == -1) { + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &value, sizeof(value)) == -1) { rv = errno; } } @@ -229,10 +258,10 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm) + apr_sockaddr_t *source) { #ifdef IP_ADD_MEMBERSHIP - return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, ssm); + return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, source); #else return APR_ENOTIMPL; #endif @@ -241,17 +270,16 @@ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *leave, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm) + apr_sockaddr_t *source) { #ifdef IP_DROP_MEMBERSHIP - return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, ssm); + return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, source); #else return APR_ENOTIMPL; #endif } -APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, - apr_byte_t ttl) +APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl) { #ifdef IP_MULTICAST_TTL return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl); @@ -260,7 +288,7 @@ #endif } -APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, +APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt) { #ifdef IP_MULTICAST_LOOP @@ -278,16 +306,16 @@ if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, IP_MULTICAST_IF, - (const void *)&iface->sa.sin.sin_addr, - sizeof(iface->sa.sin.sin_addr)) == -1) { + (const void *) &iface->sa.sin.sin_addr, + sizeof(iface->sa.sin.sin_addr)) == -1) { rv = errno; } } #if APR_HAVE_IPV6 else if (sock_is_ipv6(sock)) { unsigned int idx = find_if_index(iface); - if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_MULTICAST_IF, - &idx, sizeof(idx)) == -1) { + if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_MULTICAST_IF, + &idx, sizeof(idx)) == -1) { rv = errno; } } Index: include/apr_network_io.h =================================================================== --- include/apr_network_io.h(revision 124104) +++ include/apr_network_io.h(working copy) @@ -758,14 +758,13 @@ * @param join The address of the multicast group to join * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) - * @param ssm Single Source Multicast Address to accept transmissions from. - * @remark Single Source Multicast is not currently implemented, and you must - * pass NULL for the argument. + * @param source Source Address to accept transmissions from (non-NULL + * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm); + apr_sockaddr_t *source); /** * Leave a Multicast Group. All arguments must be the same as @@ -774,14 +773,13 @@ * @param leave The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) - * @param ssm Single Source Multicast Address that transmissions came from. - * @remark Single Source Multicast is not currently implemented, and you must - * pass NULL for the argument. + * @param source Source Address to accept transmissions from (non-NULL + * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *leave, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm); + apr_sockaddr_t *source); /** * Set the Multicast Time to Live (ttl) for a multicast transmission.
|
| | 4 answer | Add comment |
|