Fix compiler errors

This commit is contained in:
2025-07-20 21:19:58 +02:00
parent 01bf34b58d
commit 3201eac013
29 changed files with 177 additions and 94 deletions
Binary file not shown.
+3 -2
View File
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdbool.h>
#include <http.h>
#include <chttp.h>
// This example shows how to set up a basic HTTP server
@@ -30,7 +31,7 @@ int main(void)
HTTP_ResponseHandle res;
// Block until a request is available
int ret = http_server_wait(server, &res, &res);
int ret = http_server_wait(server, &req, &res);
// The wait functions returns 0 on success and -1
// on error. By "error" I mean an unrecoverable
Binary file not shown.
+3 -2
View File
@@ -1,4 +1,5 @@
#include <http.h>
#include <string.h>
#include <chttp.h>
// This example shows how to generate response bodies
// using the zero-copy API.
@@ -18,7 +19,7 @@ int main(void)
HTTP_Request *req;
HTTP_ResponseHandle res;
int ret = http_server_wait(server, &res, &res);
int ret = http_server_wait(server, &req, &res);
if (ret < 0) return -1;
http_response_status(res, 200);
Binary file not shown.
+3 -2
View File
@@ -1,4 +1,5 @@
#include <http.h>
#include <stddef.h>
#include <chttp.h>
// This example shows how undo a response that is being built
// when an error occurs.
@@ -14,7 +15,7 @@ int main(void)
HTTP_Request *req;
HTTP_ResponseHandle res;
int ret = http_server_wait(server, &res, &res);
int ret = http_server_wait(server, &req, &res);
if (ret < 0) return -1;
// Say we are building a request..
+1 -1
View File
@@ -1,5 +1,5 @@
#include <stdbool.h>
#include <http.h>
#include <chttp.h>
// NOTE: This example doesn't work yet!
+1 -1
View File
@@ -1,5 +1,5 @@
#include <stdbool.h>
#include <http.h>
#include <chttp.h>
// This example shows how to set up an HTTPS (HTTP over TLS)
// server.
@@ -1,4 +1,4 @@
#include <http.h>
#include <chttp.h>
// This is an example of how to serve different websites
// over a single HTTPS server instance.
@@ -29,7 +29,7 @@ int main(void)
// First, set up an HTTPS server instance with one
// of the certificate. This will act as default certificate
// when ecrypted connections don't target a specific domain.
HTTP_Server *server = http_server_init(
HTTP_Server *server = http_server_init_ex(
HTTP_STR("127.0.0.1"), 8080, 8443,
HTTP_STR("websiteA_cert.pem"),
HTTP_STR("websiteA_key.pem")