Merge pull request #1595 from cesanta/http-client

fixed comment, updated TLS section in makefile
This commit is contained in:
Sergey Lyubka 2022-06-20 21:59:24 +01:00 committed by GitHub
commit 4f63b6093f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}