diff --git a/examples/http-client/Makefile b/examples/http-client/Makefile index 3911369e..a0bb6cec 100644 --- a/examples/http-client/Makefile +++ b/examples/http-client/Makefile @@ -1,16 +1,15 @@ PROG ?= example ROOT ?= $(realpath $(CURDIR)/../..) -CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA) +CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA_CFLAGS) LIN = docker run -it --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2 +SSL = ? -ifneq ($(MBEDTLS),) -CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include -CFLAGS += -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509 +ifeq "$(SSL)" "MBEDTLS" +CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509 endif -ifneq ($(OPENSSL),) -CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include -CFLAGS += -L$(OPENSSL)/lib -lssl -lcrypto +ifeq "$(SSL)" "OPENSSL" +CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto endif all: $(PROG) diff --git a/examples/http-client/main.c b/examples/http-client/main.c index f4deebed..22532816 100644 --- a/examples/http-client/main.c +++ b/examples/http-client/main.c @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) { mg_log_set(log_level); // Set to 0 to disable debug mg_mgr_init(&mgr); // Initialise event manager mg_http_connect(&mgr, s_url, fn, &done); // Create client connection - while (!done) mg_mgr_poll(&mgr, 50); // Infinite event loop + while (!done) mg_mgr_poll(&mgr, 50); // Event manager loops until 'done' mg_mgr_free(&mgr); // Free resources return 0; }