-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
Hi dear @lammertb ,
I'm trying to embed the libhttp in my own projects to act as both the server & client.
But actually, I encountered some challenges when trying to connect to an HTTPS server using libhttp.
- At first I only had an instance of
struct lh_ctx_tto set up the server, which I then passed tohttplib_connect_client. Everything went well, except that it crashed when I tried to callhttplib_stop(src/httplib_free_context.c:100). It was trying to clean up SSL_CTX, which was overwritten by another context when it acted as an HTTPS client. - Then I literally realized that I should call
httplib_create_client_contextto generate another instance ofstruct lh_ctx_tfor each client connection. But this time it crashes again inhttplib_close_connection(src/httplib_close_connection.c:124) because there is no place to initializeclient_ctx->workerthreadids. Also,client_ctxis always in theCTX_STATUS_TERMINATEDstatus after creation and cannot beCTX_STATUS_RUNNING, which prevents me from sending Hello to other servers.
Could you please give me some advice?
Thanks in advance.
Regards.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels