> unless ($r->is_main) {
> $r->log_error("not the main request; declining...");
> return DECLINED;
> }
> Is there a solution for this?
that should probably by $r->is_initial_req, which returns true only for the
main request, not subrequests.
HTH
--Geoff
return DECLINED;
}
my $file = $r->uri;
# Capture the old DocumentRoot setting.
my $old_docroot = $r->document_root;
$r->log_error("$file - current docroot = $old_docroot");
# Set DocumentRoot to the new value.
my $hostname = $r->hostname;
my $new
.
It might also be nice to have this method croak in a non-prefork mpm.
It already does:
MP_CROAK_IF_THREADS_STARTED("setting $r->document_root");
Joe, would you like to merge in the code you've posted before or do
you want me to handle that?
I can do it, but it'll t
Stas Bekman <[EMAIL PROTECTED]> writes:
> Geoffrey Young wrote:
[...]
>> automatic per-request is definitely the way to go if we can do it -
>> people just don't understand the unusual scoping of this field, so
>> helping them along is probably best.
>
> sure, let's do that.
It might also be ni
Geoffrey Young wrote:
The question is whether we want to make that docroot change persistent
across requests [1] or per-request[2]. Geoff's proposal matches the
former [1]behavior, whereas Joe's the latter[2].
I tend to think that per-request[2] is the sane solution. That's because
you can never kn
> The question is whether we want to make that docroot change persistent
> across requests [1] or per-request[2]. Geoff's proposal matches the
> former [1]behavior, whereas Joe's the latter[2].
>
> I tend to think that per-request[2] is the sane solution. That's because
> you can never know wheth
Geoffrey Young wrote:
take a look at the implementation in mp1 - why won't something like that
work, so long as we're in prefork?
i.e. create a special scalar (quoting from mp1):
SV *doc_root = perl_get_sv("Apache::Server::DocumentRoot", TRUE);
sv_setsv(doc_root, ST(1));
con
Stas Bekman <[EMAIL PROTECTED]> writes:
[...]
> I was just adding a note to the API method doc saying:
>
>it's important to mention that at the end of each request where
>you modify this setting you absolutely must restore it to its
>original value.
>
> but it doesn't work, since the
> So unless I miss something we have two options:
>
> 1) nuke that method completely
>
> 2) either provide a new method that restores the data using a
> preallocated string from the server pool or do that internally in the
> server
>
> 3) or change $r->document_
Stas Bekman wrote:
Cahill, Earl wrote:
[...]
Second, I couldn't get this
$r->document_root(hostname2docroot($r->hostname));
[...]
It's a bug. This patch which will go in shortly fixes it:
[...]
+conf->ap_document_root = apr_pstrdup(r->pool,
SvPV_nolen(new_root))
Cahill, Earl wrote:
[...]
Second, I couldn't get this
$r->document_root(hostname2docroot($r->hostname));
To set the docroot. However, each of the following worked
my $new_docroot = hostname2docroot($r->hostname);
$r->document_root($new_docroot);
And
$r->document_root(&quo
> First, in my little test, I alternate between five different hosts, and
> don't do the cleanup handler to put the docroot back, and everything looks
> fine.
you will eventually, once you get enough requests to cycle through all of
the httpd children.
>
> Second, I could
::RequestRec ();
use Apache::RequestUtil ();
use Apache::Const -compile => qw(DECLINED);
sub handler {
my $r = shift;
my $new_docroot = hostname2docroot($r->hostname);
$r->document_root($new_docroot);
return Apache::DECLINED;
}
sub hostname2docroot {
return "/var/docroot
Geoffrey Young wrote:
>> $r->document_root(hostname2docroot($r->hostname));
>
>
> you just can't do that without setting it back at the end of a request. see
>
> http://www.webreference.com/programming/perl/cookbook/chap4/2.html
>
> for why.
I sh
> $r->document_root(hostname2docroot($r->hostname));
you just can't do that without setting it back at the end of a request. see
http://www.webreference.com/programming/perl/cookbook/chap4/2.html
for why.
> Can't locate object method "document_root" via p
;
use warnings;
use Apache::RequestRec ();
use Apache::Const -compile => qw(OK DECLINED);
sub handler {
my $r = shift;
$r->document_root(hostname2docroot($r->hostname));
return Apache::DECLINED;
}
sub hostname2docroot {
my $hostname = shift || die "n
16 matches
Mail list logo