Mod Perl 2 with byte range help


 
Thread Tools Search this Thread
Top Forums Programming Mod Perl 2 with byte range help
# 1  
Old 05-31-2010
Mod Perl 2 with byte range help

I am writing a mod perl 2 download module and I am facing the same issue as this guy.

mp2 / Apache byterange filter | ModPerl | ModPerl

If I remove the check for EOS in byterange_filter.c and recompile Apache2, the byte range filter is executed and the result is correct but I am not sure that is the correct way.

Anyone has any idea?

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script to allocate next available IP from a range

Hi I am looking to automate the process in PERL of allocating IP addresses from a set range of addresses (for example a /22 network 10.10.224.1 - 10.10.227.254) I am able to query the IP addresses that are already in use in the above range, which will produce me a list like this for example... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

2. Shell Programming and Scripting

[Ubuntu / PERL ]Problem installing WWW::Mechanize mod

Hello everyone, I've got some problem intalling a perl module. The installation is well done as you can see below. gueg@ux31:~$ sudo apt-get install libwww-mechanize-perl Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état...... (4 Replies)
Discussion started by: tot94
4 Replies

3. Shell Programming and Scripting

Perl - quick inverse of a number range

Hello, I'm trying to find an nice solution for the following: 1) I have ranges of numbers (begin-end): 10-15, 20-30, 45-50 2) I have begin limit=0 and end limit=60. 3) I need to find out number ranges between begin limit and end limit that do not overlap with the ranges in item1. In this... (6 Replies)
Discussion started by: pn8830
6 Replies

4. Programming

Perl : Numeric Range Pattern Matching

hi Experts just wondering if you can help me check a number between a specific range if i have an ip address , how can i say the valid number for ip between 1 to 254 something like this if ($ip ) =~ /.../ { } what the pattern i need to type thanks (3 Replies)
Discussion started by: doubando
3 Replies

5. Shell Programming and Scripting

Perl- Output file is always 0 byte

Hi all, I am new to perl programming. However i have a script that connects to the database and spools that into an output file. Strange thing is that sometimes this script works and sometimes the ouput spool file is always 0 byte. I have verified the sql query and the query always returns... (5 Replies)
Discussion started by: amit1_x
5 Replies

6. Shell Programming and Scripting

Read Write byte range/chunk of data from specific location in file

I am new to Unix so will really appreciate if someone can guide me on this. What I want to do is: Step1: Read binary file - pick first 2 bytes, convert from hex to decimal. Read the next 3 bytes as well. 2 bytes will specify the number of bytes 'n' that I want to read and write... (1 Reply)
Discussion started by: Kbenipel
1 Replies

7. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

8. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

9. Shell Programming and Scripting

Perl search and replace in range using variable

Hi. I have a file with asterisk field separators and backslash line terminators. The first field in each line names the line type. I am trying to process each range separately. Here's what the data looks like: BA*DATA\ LS*DATA1*DATA2*00020*\ TA*DATA1*DATA2*DATA3*\ TA*DATA1*DATA2*DATA3*\... (1 Reply)
Discussion started by: yoi2hot4ya
1 Replies
Login or Register to Ask a Question
libapache2-mod-perl2-2.0.7::docs::api::ModPerl::RegistryUsereContributed Perl Dlibapache2-mod-perl2-2.0.7::docs::api::ModPerl::RegistryLoader(3pm)

NAME
ModPerl::RegistryLoader - Compile ModPerl::RegistryCooker scripts at server startup Synopsis # in startup.pl use ModPerl::RegistryLoader (); use File::Spec (); # explicit uri => filename mapping my $rlbb = ModPerl::RegistryLoader->new( package => 'ModPerl::RegistryBB', debug => 1, # default 0 ); $rlbb->handler($uri, $filename); ### # uri => filename mapping using a helper function sub trans { my $uri = shift; $uri =~ s|^/registry/|cgi-bin/|; return File::Spec->catfile(Apache2::ServerUtil::server_root, $uri); } my $rl = ModPerl::RegistryLoader->new( package => 'ModPerl::Registry', trans => &trans, ); $rl->handler($uri); ### $rlbb->handler($uri, $filename, $virtual_hostname); Description This modules allows compilation of scripts, running under packages derived from "ModPerl::RegistryCooker", at server startup. The script's handler routine is compiled by the parent server, of which children get a copy and thus saves some memory by initially sharing the compiled copy with the parent and saving the overhead of script's compilation on the first request in every httpd instance. This module is of course useless for those running the "ModPerl::PerlRun" handler, because the scripts get recompiled on each request under this handler. Methods new() When creating a new "ModPerl::RegistryLoader" object, one has to specify which of the "ModPerl::RegistryCooker" derived modules to use. For example if a script is going to run under "ModPerl::RegistryBB" the object is initialized as: my $rlbb = ModPerl::RegistryLoader->new( package => 'ModPerl::RegistryBB', ); If the package is not specified "ModPerl::Registry" is assumed: my $rlbb = ModPerl::RegistryLoader->new(); To turn the debugging on, set the debug attribute to a true value: my $rlbb = ModPerl::RegistryLoader->new( package => 'ModPerl::RegistryBB', debug => 1, ); Instead of specifying explicitly a filename for each uri passed to handler(), a special attribute trans can be set to a subroutine to perform automatic remapping. my $rlbb = ModPerl::RegistryLoader->new( package => 'ModPerl::RegistryBB', trans => &trans, ); See the handler() item for an example of using the trans attribute. handler() $rl->handler($uri, [$filename, [$virtual_hostname]]); The handler() method takes argument of "uri" and optionally of "filename" and of "virtual_hostname". URI to filename translation normally doesn't happen until HTTP request time, so we're forced to roll our own translation. If the filename is supplied it's used in translation. If the filename is omitted and a "trans" subroutine was not set in new(), the loader will try using the "uri" relative to the "ServerRoot" configuration directive. For example: httpd.conf: ----------- ServerRoot /usr/local/apache Alias /registry/ /usr/local/apache/cgi-bin/ startup.pl: ----------- use ModPerl::RegistryLoader (); my $rl = ModPerl::RegistryLoader->new( package => 'ModPerl::Registry', ); # preload /usr/local/apache/cgi-bin/test.pl $rl->handler(/registry/test.pl); To make the loader smarter about the URI->filename translation, you may provide the "new()" method with a "trans()" function to translate the uri to filename. The following example will pre-load all files ending with .pl in the cgi-bin directory relative to "ServerRoot". httpd.conf: ----------- ServerRoot /usr/local/apache Alias /registry/ /usr/local/apache/cgi-bin/ startup.pl: ----------- { # test the scripts pre-loading by using trans sub use ModPerl::RegistryLoader (); use File::Spec (); use DirHandle (); use strict; my $dir = File::Spec->catdir(Apache2::ServerUtil::server_root, "cgi-bin"); sub trans { my $uri = shift; $uri =~ s|^/registry/|cgi-bin/|; return File::Spec->catfile(Apache2::ServerUtil::server_root, $uri); } my $rl = ModPerl::RegistryLoader->new( package => "ModPerl::Registry", trans => &trans, ); my $dh = DirHandle->new($dir) or die $!; for my $file ($dh->read) { next unless $file =~ /.pl$/; $rl->handler("/registry/$file"); } } If $virtual_hostname argument is passed it'll be used in the creation of the package name the script will be compiled into for those registry handlers that use namespace_from_uri() method. See also the notes on $ModPerl::RegistryCooker::NameWithVirtualHost in the "ModPerl::RegistryCooker" documentation. Also explained in the "ModPerl::RegistryLoader" documentation, this only has an effect at run time if $ModPerl::RegistryCooker::NameWithVirtualHost is set to true, otherwise the $virtual_hostname argument is ignored. Implementation Notes "ModPerl::RegistryLoader" performs a very simple job, at run time it loads and sub-classes the module passed via the package attribute and overrides some of its functions, to emulate the run-time environment. This allows one to preload the same script into different registry environments. Authors The original "Apache2::RegistryLoader" implemented by Doug MacEachern. Stas Bekman did the porting to the new registry framework based on "ModPerl::RegistryLoader". SEE ALSO
"ModPerl::RegistryCooker", "ModPerl::Registry", "ModPerl::RegistryBB", "ModPerl::PerlRun", Apache(3), mod_perl(3) perl v5.14.2 2013-03-12 libapache2-mod-perl2-2.0.7::docs::api::ModPerl::RegistryLoader(3pm)