Adding / Modifing Response Headers on mp2
Hi! I'm trying to figure out, how to Add / Modify the HTTP Headers like Content Type, Cache aso... on mod_perl 1 I've used: $r->send_cgi_header($custom_headers); but this won't work mod_perl 2... I've searched in Apache::compat all I've found was the function header_out that internally calls $r->headers_out()... Can somebody please tell me how to set the right headers??? Thanks a lot! here is the code from Apache::compat sub table_get_set { my($r, $table) = (shift, shift); my($key, $value) = @_; if (1 == @_) { return wantarray() ? ($table->get($key)) : scalar($table->get($key)); } elsif (2 == @_) { if (defined $value) { return wantarray() ?($table->set($key, $value)) : scalar($table->set($key, $value)); } else { return wantarray() ? ($table->unset($key)) : scalar($table->unset($key)); } } elsif (0 == @_) { return $table; } else { my $name = (caller(1))[3]; warn "Usage: \$r->$name([key [,val]])"; } } sub header_out { my $r = shift; return wantarray() ? ($r->table_get_set(scalar($r->headers_out), @_)) : scalar($r->table_get_set(scalar($r->headers_out), @_)); }
AW: [OT] Perfomance tests, How?
Hi! Here are the doc's: Try ab or http_load. http://perl.apache.org/docs/1.0/guide/performance.html Best regards Lust auf mehr? - http://maedls.at --- NCM - NET COMMUNICATION MANAGEMENT GmbH ---[ Denis Banovic - CTO mailto:[EMAIL PROTECTED] ---[ Mühlstrasse 4a AT - 5023 Salzburg Tel. 0662 / 644 688 ---[ Fax: 0662 / 644 688 - 88 -Ursprüngliche Nachricht- Von: Ruslan U. Zakirov [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 2. April 2003 14:54 An: mod_perl list Betreff: [OT] Perfomance tests, How? Hello All! I need to test my project perfomance. Is there any OpenSource projects like WebBench and other in the Internet? Best regards. Ruslan.
register_cleanup on mod_perl 2.0
Hi! I've a script that looks like this: if ($runnung_on_mod_perl) { Apache->request->register_cleanup(\&init_globals); } Under mod_perl 1.0 works fine with Apache::Registry. Can someone give me an Example how to make a register_cleanup with mod_perl 2? Thanks a lot Denis
register_cleanup
Hi! I'm trying to migrate some stuff from mod_perl 1. I've read the tutorial on perl.apache.org but it didn't help. I've a perl script that looks like this: if ($runnung_on_mod_perl) { Apache->request->register_cleanup(\&init_globals); } Under mod_perl 1.0 works fine with Apache::Registry. But I can't find out how to port this to mod_perl 2. I've tried to use Apache::compat(); but then I got another error from an Module we are using to cache the script's output: "ModPerl::Registry: anonymous handlers not (yet) supported at..." The code looks like this: ... $self->{r} = Apache->request; $self->{r}->push_handlers(PerlHandler => sub {$self->DESTROY}); ... 1) How to do a register_cleanup with mod_perl 2.0 ? 2) How to fix the second error? googling didn't help. Can someone please help me with it? Thanks a lot Denis Banovic