aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/supplemental/http')
-rw-r--r--src/supplemental/http/http_api.h31
-rw-r--r--src/supplemental/http/http_chunk.c2
-rw-r--r--src/supplemental/http/http_client.c2
-rw-r--r--src/supplemental/http/http_conn.c14
-rw-r--r--src/supplemental/http/http_msg.c6
-rw-r--r--src/supplemental/http/http_msg.h4
-rw-r--r--src/supplemental/http/http_public.c20
-rw-r--r--src/supplemental/http/http_schemes.c6
-rw-r--r--src/supplemental/http/http_server.c2
-rw-r--r--src/supplemental/http/http_server_test.c4
10 files changed, 44 insertions, 47 deletions
diff --git a/src/supplemental/http/http_api.h b/src/supplemental/http/http_api.h
index 61c6e45f..a8f648dc 100644
--- a/src/supplemental/http/http_api.h
+++ b/src/supplemental/http/http_api.h
@@ -12,10 +12,9 @@
#ifndef NNG_SUPPLEMENTAL_HTTP_HTTP_API_H
#define NNG_SUPPLEMENTAL_HTTP_HTTP_API_H
-#include "core/nng_impl.h"
-#include "nng/http.h"
-
+#include "../../core/defs.h"
#include "http_msg.h"
+#include "nng/http.h"
// This represents the "internal" HTTP API. It should not be used
// or exposed to applications directly.
@@ -68,7 +67,7 @@ extern nng_err nni_http_chunks_parse(
nni_http_chunks *, void *, size_t, size_t *);
extern void nni_http_read_chunks(
- nni_http_conn *, nni_http_chunks *, nni_aio *);
+ nni_http_conn *, nni_http_chunks *, nng_aio *);
extern nni_http_req *nni_http_conn_req(nni_http_conn *);
extern nni_http_res *nni_http_conn_res(nni_http_conn *);
@@ -106,21 +105,21 @@ extern int nni_http_conn_getopt(
// Note that the iovs of the aio's are clobbered by these methods -- callers
// must not use them for any other purpose.
-extern void nni_http_write_req(nni_http_conn *, nni_aio *);
-extern void nni_http_read_res(nni_http_conn *, nni_aio *);
-extern void nni_http_read_req(nni_http_conn *, nni_aio *);
-extern void nni_http_write_res(nni_http_conn *, nni_aio *);
-extern void nni_http_read_discard(nni_http_conn *, size_t, nni_aio *);
+extern void nni_http_write_req(nni_http_conn *, nng_aio *);
+extern void nni_http_read_res(nni_http_conn *, nng_aio *);
+extern void nni_http_read_req(nni_http_conn *, nng_aio *);
+extern void nni_http_write_res(nni_http_conn *, nng_aio *);
+extern void nni_http_read_discard(nni_http_conn *, size_t, nng_aio *);
extern nng_err nni_http_req_alloc_data(nni_http_req *, size_t);
extern nng_err nni_http_res_alloc_data(nni_http_res *, size_t);
extern bool nni_http_is_error(nng_http *);
-extern void nni_http_read(nni_http_conn *, nni_aio *);
-extern void nni_http_read_full(nni_http_conn *, nni_aio *);
-extern void nni_http_write(nni_http_conn *, nni_aio *);
-extern void nni_http_write_full(nni_http_conn *, nni_aio *);
+extern void nni_http_read(nni_http_conn *, nng_aio *);
+extern void nni_http_read_full(nni_http_conn *, nng_aio *);
+extern void nni_http_write(nni_http_conn *, nng_aio *);
+extern void nni_http_write_full(nni_http_conn *, nng_aio *);
extern nng_err nni_http_add_header(nng_http *, const char *, const char *);
extern nng_err nni_http_set_header(nng_http *, const char *, const char *);
@@ -324,7 +323,7 @@ extern int nni_http_client_set(
extern int nni_http_client_get(
nni_http_client *, const char *, void *, size_t *, nni_type);
-extern void nni_http_client_connect(nni_http_client *, nni_aio *);
+extern void nni_http_client_connect(nni_http_client *, nng_aio *);
// nni_http_transact_conn is used to perform a round-trip exchange (i.e. a
// single HTTP transaction). It will not automatically close the connection,
@@ -333,14 +332,14 @@ extern void nni_http_client_connect(nni_http_client *, nni_aio *);
// Note that this will fail with NNG_ENOTSUP if the server attempts to reply
// with a chunked transfer encoding. The request and response used are the
// ones associated with the connection.
-extern void nni_http_transact_conn(nni_http_conn *, nni_aio *);
+extern void nni_http_transact_conn(nni_http_conn *, nng_aio *);
// nni_http_transact is used to execute a single transaction to a server.
// The connection is opened, and will be closed when the transaction is
// complete. Note that this will fail with NNG_ENOTSUP if the server attempts
// to reply with a chunked transfer encoding.
extern void nni_http_transact(
- nni_http_client *, nni_http_req *, nni_http_res *, nni_aio *);
+ nni_http_client *, nni_http_req *, nni_http_res *, nng_aio *);
// nni_http_stream_scheme returns the underlying stream scheme for a given
// upper layer scheme.
diff --git a/src/supplemental/http/http_chunk.c b/src/supplemental/http/http_chunk.c
index 1d4335db..99f29800 100644
--- a/src/supplemental/http/http_chunk.c
+++ b/src/supplemental/http/http_chunk.c
@@ -12,7 +12,7 @@
#include <stdbool.h>
#include <string.h>
-#include "core/nng_impl.h"
+#include "../../core/defs.h"
#include "http_api.h"
diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c
index 06215ca0..5cacb39c 100644
--- a/src/supplemental/http/http_client.c
+++ b/src/supplemental/http/http_client.c
@@ -14,7 +14,7 @@
#include <stdlib.h>
#include <string.h>
-#include "core/nng_impl.h"
+#include "../../core/nng_impl.h"
#include "http_api.h"
#include "http_msg.h"
diff --git a/src/supplemental/http/http_conn.c b/src/supplemental/http/http_conn.c
index 5baa3136..21087474 100644
--- a/src/supplemental/http/http_conn.c
+++ b/src/supplemental/http/http_conn.c
@@ -15,10 +15,10 @@
#include <stdio.h>
#include <string.h>
-#include "core/list.h"
-#include "core/nng_impl.h"
+#include "../../core/list.h"
+#include "../../core/nng_impl.h"
+#include "../../supplemental/tls/tls_api.h"
#include "nng/http.h"
-#include "supplemental/tls/tls_api.h"
#include "http_api.h"
#include "http_msg.h"
@@ -52,10 +52,10 @@ struct nng_http_conn {
nni_list rdq; // high level http read requests
nni_list wrq; // high level http write requests
- nni_aio *rd_uaio; // user aio for read
- nni_aio *wr_uaio; // user aio for write
- nni_aio rd_aio; // bottom half read operations
- nni_aio wr_aio; // bottom half write operations
+ nng_aio *rd_uaio; // user aio for read
+ nng_aio *wr_uaio; // user aio for write
+ nng_aio rd_aio; // bottom half read operations
+ nng_aio wr_aio; // bottom half write operations
nni_mtx mtx;
diff --git a/src/supplemental/http/http_msg.c b/src/supplemental/http/http_msg.c
index 09470e31..e6b2a0ab 100644
--- a/src/supplemental/http/http_msg.c
+++ b/src/supplemental/http/http_msg.c
@@ -14,9 +14,9 @@
#include <stdlib.h>
#include <string.h>
-#include "core/list.h"
-#include "core/nng_impl.h"
-#include "core/url.h"
+#include "../../core/list.h"
+#include "../../core/nng_impl.h"
+#include "../../core/url.h"
#include "http_api.h"
#include "http_msg.h"
#include "nng/http.h"
diff --git a/src/supplemental/http/http_msg.h b/src/supplemental/http/http_msg.h
index 4b4e03a6..02e0db07 100644
--- a/src/supplemental/http/http_msg.h
+++ b/src/supplemental/http/http_msg.h
@@ -11,8 +11,8 @@
#ifndef NNG_SUPPLEMENTAL_HTTP_HTTP_MSG
#define NNG_SUPPLEMENTAL_HTTP_HTTP_MSG
-#include "core/defs.h"
-#include "core/list.h"
+#include "../../core/defs.h"
+#include "../../core/list.h"
// Note that as we parse headers, the rule is that if a header is already
// present, then we can append it to the existing header, separated by
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c
index 42b7a1ab..9c8ded2d 100644
--- a/src/supplemental/http/http_public.c
+++ b/src/supplemental/http/http_public.c
@@ -8,7 +8,7 @@
// found online at https://opensource.org/licenses/MIT.
//
-#include "core/nng_impl.h"
+#include "../../core/nng_impl.h"
#include "http_api.h"
#include "nng/http.h"
@@ -73,7 +73,7 @@ nng_http_set_body(nng_http *conn, void *data, size_t sz)
NNI_ARG_UNUSED(conn);
NNI_ARG_UNUSED(data);
NNI_ARG_UNUSED(sz);
- return (NNG_ENOTSUP);
+ return;
#endif
}
@@ -108,7 +108,7 @@ nng_http_get_uri(nng_http *conn)
#ifdef NNG_SUPP_HTTP
return (nni_http_get_uri(conn));
#else
- NNI_ARG_UNUSED(req);
+ NNI_ARG_UNUSED(conn);
return (NULL);
#endif
}
@@ -132,7 +132,7 @@ nng_http_get_version(nng_http *conn)
#ifdef NNG_SUPP_HTTP
return (nni_http_get_version(conn));
#else
- NNI_ARG_UNUSED(res);
+ NNI_ARG_UNUSED(conn);
return (NULL);
#endif
}
@@ -143,7 +143,7 @@ nng_http_set_status(nng_http *conn, nng_http_status status, const char *reason)
#ifdef NNG_SUPP_HTTP
nni_http_set_status(conn, status, reason);
#else
- NNI_ARG_UNUSED(res);
+ NNI_ARG_UNUSED(conn);
NNI_ARG_UNUSED(status);
NNI_ARG_UNUSED(reason);
#endif
@@ -155,8 +155,7 @@ nng_http_get_status(nng_http *conn)
#ifdef NNG_SUPP_HTTP
return (nni_http_get_status(conn));
#else
- NNI_ARG_UNUSED(res);
- NNI_ARG_UNUSED(status);
+ NNI_ARG_UNUSED(conn);
return (0);
#endif
}
@@ -167,8 +166,7 @@ nng_http_get_reason(nng_http *conn)
#ifdef NNG_SUPP_HTTP
return (nni_http_get_reason(conn));
#else
- NNI_ARG_UNUSED(res);
- NNI_ARG_UNUSED(status);
+ NNI_ARG_UNUSED(conn);
return (0);
#endif
}
@@ -560,7 +558,7 @@ nng_http_server_error(nng_http_server *srv, nng_http *conn)
return (nni_http_server_error(srv, conn));
#else
NNI_ARG_UNUSED(srv);
- NNI_ARG_UNUSED(res);
+ NNI_ARG_UNUSED(conn);
return (NNG_ENOTSUP);
#endif
}
@@ -650,6 +648,6 @@ nng_http_reset(nng_http *conn)
#ifdef NNG_SUPP_HTTP
nni_http_conn_reset(conn);
#else
- NNI_ARG_UNUSED(req);
+ NNI_ARG_UNUSED(conn);
#endif
}
diff --git a/src/supplemental/http/http_schemes.c b/src/supplemental/http/http_schemes.c
index df8b9208..1e56cdc5 100644
--- a/src/supplemental/http/http_schemes.c
+++ b/src/supplemental/http/http_schemes.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -11,7 +11,7 @@
#include <stdbool.h>
#include <string.h>
-#include "core/nng_impl.h"
+#include "../../core/nng_impl.h"
#include "http_api.h"
@@ -82,4 +82,4 @@ nni_http_stream_scheme(const char *upper)
}
}
return (NULL);
-} \ No newline at end of file
+}
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index fc7a3075..d1e8a5e7 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
-#include "core/nng_impl.h"
+#include "../../core/nng_impl.h"
#include "http_api.h"
#include "http_msg.h"
diff --git a/src/supplemental/http/http_server_test.c b/src/supplemental/http/http_server_test.c
index fdc38950..ed63e136 100644
--- a/src/supplemental/http/http_server_test.c
+++ b/src/supplemental/http/http_server_test.c
@@ -10,12 +10,12 @@
//
// Basic HTTP server tests.
-#include "core/defs.h"
+#include "../../core/defs.h"
#include <complex.h>
#include <nng/http.h>
#include <nng/nng.h>
-#include <nuts.h>
+#include "../../testing/nuts.h"
const char *doc1 = "<html><body>Someone <b>is</b> home!</body></html>";
const char *doc2 = "This is a text file.";