feat: replace custom SSL HTTP implementation with libcurl and add include guards
Add `http_curl.h` providing `curl_post` function using libcurl, update `openai.h` to call `curl_post` instead of `https_post` in both `openai_system` and `openai_chat`, add missing `#ifndef`/`#endif` include guard to `auth.h`, increase HTTP buffer size from 4096 to 1MB, add explicit `(char *)` casts to `malloc`/`realloc` calls in `http.h`, and link `-lcurl` in both `build` and `build_free` Makefile targets.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
all: build run
|
||||
|
||||
build:
|
||||
gcc main.c -lssl -lcrypto -ljson-c -Ofast -o r -Werror -Wall -lpython3.14 -I/usr/include/python3.14 -lreadline -lncurses
|
||||
gcc main.c -lcurl -lssl -lcrypto -ljson-c -Ofast -o r -Werror -Wall -lpython3.14 -I/usr/include/python3.14 -lreadline -lncurses
|
||||
publish r
|
||||
|
||||
build_free:
|
||||
gcc main.c -DFREE_VERSION -lssl -lcrypto -ljson-c -Ofast -o rf -Werror -Wall -lpython3.14 -I/usr/include/python3.14 -lreadline -lncurses
|
||||
gcc main.c -lcurl -DFREE_VERSION -lssl -lcrypto -ljson-c -Ofast -o rf -Werror -Wall -lpython3.14 -I/usr/include/python3.14 -lreadline -lncurses
|
||||
publish rf
|
||||
|
||||
run:
|
||||
|
||||
Reference in New Issue
Block a user