fixed comment, updated TLS section in makefile

This commit is contained in:
Sergio R. Caprile 2022-06-20 14:50:45 -03:00
parent 46bf79455c
commit 3bd3a4ff7b
2 changed files with 7 additions and 8 deletions

View File

@ -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)

View File

@ -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;
}