0

when I use mongoose to process some http requests, it fails to get post data sometimes. Has anyone met the some problem? I am not sure whether the mongoose is stable enough. Can anyone give some ideas? Thanks in advance.

I use the restClient to send the http request. The mongoose library is downloaded from:http://code.google.com/p/mongoose/

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471
cici
  • 11
  • 2

1 Answers1

0

The problem I encountered is Uploading the file size exceeds 120MB, the will be a memory warning, and then the program crashes.After a preliminary test, to find the code of memory level 2 warnings:

MongooseServer.m
void *handleRequest(enum mg_event event,
                struct mg_connection *conn,
                const struct mg_request_info *request_info)
{
    ...
    if ((cl = mg_get_header(conn, "Content-Length")) != NULL) {

        len = atoi(cl);
        if ((buf = malloc(len)) != NULL) {
            mg_read(conn, buf, len);
            body = [NSData dataWithBytes:buf length:len];
            free(buf);
        }
    }
    ...
}

Specific problem is where I also did not identify, had determined after further debugging