Optionally disable debug aborts conditions #217
Comments
Abort should only be called on programmer errors. What specific case are you hitting? |
For example - whenever I stop the server, |
That's because you are not retaining the server most likely or calling stop more than once. |
Ah, you're right; I can't believe I missed that. Do you have any suggestions as to why I experience very long upload times with multipart form data (files)? |
Check the Xcode log, GCDWebServer logs a lot if |
Examining the logs, I get lots of |
Could how I make the multipart-data request be an issue? I'm using XMLHttpRequest+form data to make the POST request. |
I can't really help with that, sorry, there are too many things that go wrong outside of GCDWebServer. I'd recommend using the Chrome web inspector to understand what's happening to the requests. Good luck! |
just so you know, I'm experiencing this with bare-bones |
What does it mean if I receive aborts in edit: pending, seems like I fixed it |
If you could provide any pointers I'd appreciate it. Here's the code I'm using to create the server and process multipart POST requests. It aborts in __weak typeof(self) ws = self;
_webServer = [GCDWebServer new];
[_webServer
addDefaultHandlerForMethod:@"GET" requestClass:[GCDWebServerRequest class]
processBlock:^GCDWebServerResponse* (GCDWebServerRequest *request){
if(![ws shouldRespondToRequest:request]) return ws.notFoundResponse;
GCDWebServerResponse *response = [ws responseForHTTPGetRequest:request];
response.gzipContentEncodingEnabled = true; // compress all responses
[response setValue:@"*" forAdditionalHeader:@"Access-Control-Allow-Origin"];
return response;
}];
[_webServer
addDefaultHandlerForMethod:@"POST" requestClass:[GCDWebServerMultiPartFormRequest class]
processBlock:^GCDWebServerResponse* (GCDWebServerRequest *request){
if(![ws shouldRespondToRequest:request]) return ws.notFoundResponse;
GCDWebServerResponse *response = [ws responseForHTTPPostRequest:request];
response.gzipContentEncodingEnabled = true; // compress all responses
[response setValue:@"*" forAdditionalHeader:@"Access-Control-Allow-Origin"];
return response;
}];
[_webServer startWithPort:kWebServerPort bonjourName:nil];
// responseForHTTPPostRequest:
NSString *identifier = [request firstArgumentForControlName:kAPIKey_Ids].string;
NSLog(@"%@", identifier);
return _emptyJSONResonse; |
There are times when GCDWebServer will halt and abort on non-breaking errors. Being able to toggle a flag somewhere would be ideal, rather than just going off of the DEBUG flag.
The text was updated successfully, but these errors were encountered: