0

I started using GCDWebServer version 3.1 in an app last year, and this line in the addHandlerWithMatchBlock method of GCDWebServer.m always caused the system to abort immediately:

GWS_DCHECK(_options == nil);

I ended up just changing it to this to avoid the problem:

GWS_DCHECK(_options != nil);

Now I'm updating to the latest version 3.3.2 and see the same problem. My hack still works here, but I would like to know what a real solution would be. Can someone explain?

arlomedia
  • 8,534
  • 5
  • 60
  • 108

1 Answers1

0

See docs in header:

Addling handlers while the server is running is not allowed.

Attempting to do this will result in undefined behavior.

Pol
  • 3,848
  • 1
  • 38
  • 55
  • Okay, I was initializing the server instance, then starting it, then adding handlers. It sounds like I need to initializing it, then add handlers, then start it. Thanks. – arlomedia May 13 '16 at 18:01