Gossamer Forum
Home : General : Perl Programming :

weird mod_perl error

Quote Reply
weird mod_perl error
This isn't exactly a perl question, but hopefully someone can help.

For some reason I'm getting this error in my mod_perl script. When it happens, the page partly loads then freezes. One place I get it is when a long mysql search result is being printed. It does not crash the script though. I have no idea why it's giving a forbidden error. The page is not protected by anthing like .htaccess. Any idea what it could mean?

[Wed Jan 22 06:04:53 2003] [error] [client xxx.xxx.xxx.xxx] request failed: erroneous characters after protocol string: HTTP/1.0 403 Forbidden

Last edited by:

xev: Jan 22, 2003, 3:59 AM
Quote Reply
Re: [xev] weird mod_perl error In reply to
I think it is to do with something like the code red virus and isn't related to your script.
Quote Reply
Re: [Paul] weird mod_perl error In reply to
That's doubtful because I am developing this site on my personal computer and my firewall only allows me access. It's definately a coding error.. I just need to know what the error mean so I know where to start :)
Quote Reply
Re: [xev] weird mod_perl error In reply to
Hmm well that's what all the websites are saying that I just found when I performed a search on Yahoo Smile

If you feel it is your code then it's difficult to help with no access to the code.
Quote Reply
Re: [xev] weird mod_perl error In reply to
This is in http_protocol.c.....

Code:
static void get_mime_headers(request_rec *r)
{
- char field[DEFAULT_LIMIT_REQUEST_FIELDSIZE + 2]; /* getline's two extra */
+ char field[DEFAULT_LIMIT_REQUEST_FIELDSIZE + 2]; /* ap_getline's two extra */
conn_rec *c = r->connection;
char *value;
char *copy;
@@ -1071,7 +1087,7 @@
* Read header lines until we get the empty separator line, a read error,
* the connection closes (EOF), reach the server limit, or we timeout.
*/
- while ((len = getline(field, sizeof(field), c->client, 1)) > 0) {
+ while ((len = ap_getline(field, sizeof(field), c->client, 1)) > 0) {

if (r->server->limit_req_fields &&
(++fields_read > r->server->limit_req_fields)) {
@@ -1081,7 +1097,7 @@
"this server's limit.<P>\n");
return;
}
- /* getline returns (size of max buffer - 1) if it fills up the
+ /* ap_getline returns (size of max buffer - 1) if it fills up the
* buffer before finding the end-of-line. This is only going to
* happen if it exceeds the configured limit for a field size.
*/
@@ -1173,6 +1189,14 @@
ap_log_transaction(r);
return r;
}

+ else if (r->status == HTTP_BAD_REQUEST) {
+ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
+ "request failed: erroneous characters after protocol string: %s",
+ ap_escape_logitem(r->pool, r->the_request));

+ ap_send_error_response(r, 0);
+ ap_log_transaction(r);
+ return r;
+ }
return NULL;

}

Last edited by:

Paul: Jan 22, 2003, 4:21 AM
Quote Reply
Re: [Paul] weird mod_perl error In reply to
hmm.. interesting

This says that it is because the server returned HTTP_BAD_REQUEST

How is it possible to get that when half the page already loaded? Now I'm even more confused lol Wink

Thanks though, at least this is a start.
Post deleted by xev In reply to
Quote Reply
Re: [xev] weird mod_perl error In reply to
I am running this script on my personal computer. I was getting this error when accessing the script from my computer's world ip address. Because of this, my requests were being routed from my computer, to my isp, then back to me.

I recently changed this so I simply access the site directly by using 127.0.0.1. After doing this the error cleared up.

I now am even more confused but hopefully the error won't resurface on the production server.