Re: Connection aborted

2012-11-15 Thread Dave Morgan

Thanks Andre.

On 14/11/12 12:33 PM, André Warnier wrote:

Dave Morgan wrote:


Snip.




We did find the use statement and removed it. We now get

Software caused connection abort at
/home/apache/metapoint/trunk/Utility.pm line 231.



Ok, so now you know at which line of which module this issue happens.
Is that you only issue (this line in the logs) ?

Pretty well, we also get a similar problem when some IE clients download
pictures (jpg's).

Software caused connection abort at 
/home/apache/metapoint/trunk/Metadot/UploadsManager.pm line 216, OUT chunk 
1.\n

The code here is (edited for brevity)

open OUT, $read_file;
binmode (OUT);
print $CGI-header(%header_values);
{
local $/ = undef;
while(OUT) {
print;
}
}



Because if it is, it doesn't necessarily indicate a problem.  It can happen 
just because
the user clicks on some other link (or closes the window or the browser), 
before your
server has had time to send it the full answer to the present request.
Because of that, there is no more client connection over which Apache can 
continue to send
the response, and the next time your program tries to write something, it 
triggers this
error and message in the log.


This only happens when the client is IE. From searching the net it
appears to be something to do with the http header not quite right.


No offense intended, but that sounds iffy to me; unless your $response below is 
a PDF
document, in which case there was something indeed with some versions of the 
Adobe PDF
plugin for IE not behaving correctly with some standard HTTP headers.

The code is quite simple:

print $CGI-header( $header_info_ref );
print $response;


-- maybe you could add or something-to-do-in-case-of-error here

The response is standard html/text, no fancy formats. I will look into catching 
the error
and doing a dump.



Running curl provides the following output

Snip



The above looks like a perfectly valid request/response to me. Do you get an 
error in the
logs when you do this with curl ?

No, not at all, as I mentioned the only time it happens is sometimes with IE. 
:(



In short, what is your problem ?

I'm not sure there is one, however, this occurs 50-100 times a day which seems 
very high to me.

Thanks for your help.

Dave


--
Dave Morgan
Operations Manager, Cool Places In Canada
http://www.coolplaces.ca
dave.mor...@coolplaces.ca
403 288 8759 / 866 938 0516


Re: Connection aborted (blank line after headers?)

2012-11-15 Thread Randolf Richardson
 Thanks Andre.

 On 14/11/12 12:33 PM, André Warnier wrote:
  Dave Morgan wrote:

 Snip.

 
  We did find the use statement and removed it. We now get
 
  Software caused connection abort at
  /home/apache/metapoint/trunk/Utility.pm line 231.
 
 
  Ok, so now you know at which line of which module this issue happens.
  Is that you only issue (this line in the logs) ?
 Pretty well, we also get a similar problem when some IE clients download
 pictures (jpg's).

 Software caused connection abort at 
 /home/apache/metapoint/trunk/Metadot/UploadsManager.pm line 216, OUT chunk 
 1.\n

 The code here is (edited for brevity)

 open OUT, $read_file;
 binmode (OUT);
 print $CGI-header(%header_values);
 {
  local $/ = undef;
  while(OUT) {
  print;
  }
 }
[sNip]

One question:  Do you need a blank line after the headers to
differentiate from the content?  If $CGI-header isn't providing it,
then this could explain why the client isn't getting the image, and
raw binary data where headers are expected could be a problem too.

open OUT, $read_file;
binmode (OUT);
print $CGI-header(%header_values);
print \r\n; # --- Some systems may only need \n
{
 local $/ = undef;
 while(OUT) {
 print;
 }
}

Consider this to be a random idea that may be worth trying.  I hope
this helps.

Randolf Richardson - rand...@inter-corporate.com
Inter-Corporate Computer  Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/