Webserver does not work with IE7

For all those that may be having trouble with certain installations of IE7

If the “Accept” line in the GET request to the (Rabbit) webserver is longer than 256 bytes, the server will ignore the request. After 6 hours of work, I believe the following solution will work:

Add
#define HTTP_MAXBUFFER 512
before including the HTTP.lib library (add it to the top of your code).

This works under DC 9.52. Please post your feedback!

-Mr_E

Hi,

Yes, I found this problem few month back in yahoo forum.
They also mention same solution!

NLKSG

Rabbit has an official fix for this issue:

Please see the replacement http_getline() function as provided in the last Worklog entry in #21226, dated 4/27/2007. I believe this replacement code should work for all DC 9.xx versions. And here it is:

Modified the http_getline() function to truncate a header that is too long and throw away the excess header, rather than aborting the connection. This allows the HTTP server to work with smaller HTTP_MAXBUFFER values. This fix can be made for older versions of Dynamic C by replacing http_getline() with the following function:

_http_nodebug int http_getline(HttpState* state)
{
auto int len;
// Check if we have leftover data from a previous line or header that was
// too large to fit in the buffer. If so, then we should dump it.
while (state->headeroff) {
len = http_sock_bytesready(state);
http_sock_gets(state, state->p, HTTP_MAXBUFFER);
if (len < (HTTP_MAXBUFFER-1)) {
state->headeroff = 0;
}
}
/* is there data waiting yet? */
if ((len = http_sock_bytesready(state)) == -1) {
return 0;
}

if (len >= (HTTP_MAXBUFFER-1)) {
#ifdef HTTP_VERBOSE
printf("HTTP: line too long (%d/%d)
“, len, HTTP_MAXBUFFER);
#endif
// Indicate that we need to dump the rest of the line on subsequent
// calls to this function
state->headeroff = 1;
}
http_sock_gets(state, state->p, HTTP_MAXBUFFER);
#ifdef HTTP_VERBOSE
// if (debug_on > 2)
printf(”----HTTP: getline: ‘%s’
", state->p);
#endif
return 1;
}