Hi,

I have written a request handler in Perl.  I recently changed some code
in this to convert
from using CGI within mod_perl to using Apache::Registry.  The old code
was ...

  $DB->{ApacheReq} = shift;
  :
  $DB->{Page} = CGI::new();
  :

The new code is ...

  :
  $DB->{ApacheReq}= Apache::Request->new(shift);
  :
  $DB->SetupPageArguments();
  :
  sub SetupPageArguments()
  {
  my ($DB, $nLoop, @Query, $Key, $Value);

    $DB=shift;
    @{$DB->{Page}->{'.parameters'}}=$DB->{ApacheReq}->param();

    for($nLoop=0; $nLoop<=$#{$DB->{Page}->{'.parameters'}}; $nLoop++)
    {
 
if(!defined($DB->{ApacheReq}->param($DB->{Page}->{'.parameters'}[$nLoop]
)))
      {
        $DB->{Page}->{$DB->{Page}->{'.parameters'}[$nLoop]}[0]='';
      }
      else
      {
 
@{$DB->{Page}->{$DB->{Page}->{'.parameters'}[$nLoop]}}=$DB->{ApacheReq}-
>param($DB->{Page}->{'.parameters'}[$nLoop]);
      }
    }
  }


My handler then referes to the '.parameters' field and the arrays of
values.  For most posts 
this works fine.  However, when I send a large block of data in with the
request I have found 
that portions of the middle are left out.  Putting the old code back
means that the whole of the 
text is seen.

I am using a client program written in C++ to send the requests in.  All
requests are sent as a 
multipart message, with each form field having one part within the
message.  On the particular 
instance I have been looking at the overall content size for the request
(excluding the header) 
in my application is set to 21555.  (I have not set the flag to limit
post size as you can see 
from the above).  The end of the request appears as ...

:
:
:
function NewProductExtension(Id, ExtensionId, Description, MinRequired,
MaxRequired, Visible, WarnLessThan, WarnGreaterThan, LessThanWarning,
GreaterThanWarning, Width, Units)\n{\n  new ProductExtension(Id,
ExtensionId, Description, MinRequired, MaxRequired, Visible,
WarnLessThan, WarnGreaterTha<*********>ion CheckProductExtensions()
{
var nLoop;
var Rc=new String('');

  for(nLoop=0; nLoop<Products.length; nLoop++)
  {
    if(Products[nLoop].ExtensionCount>Products[nLoop].Extensions.length)
    {
      Rc=Rc+(Products[nLoop].ProductId+',');
    }
  }
  Rc=Rc.substr(0, Rc.length-1);
  return(Rc);
}

where <*********> denotes the portion that is missing (about 100 lines
or so)


I also sometimes see spurious data added after the request.

My server is running linux 2.4.18 on a two-way Intel box.  I have Apache
1.3.26 / mod_perl 1.27
I downloaded Apache::Registry from CPAN and I have version 2.01.  My C
compiler is gcc 2.96

I have not been able to run a LAN trace to see what's being sent, but
since it is OK with CGI I 
assume that I am sending what my client says I'm sending.

Unfortunately I do not understand how the C / Perl and XS files all
stitch together so my attempts 
to look at the code have not been fruitful.

I have adopted some code that works neatly under the Apache::Registry
but will have to be fudged to work with CGI so I am keen to get this
working.

Can anyone help ?

Rob Lambden

Reply via email to