Skip to content

Commit

Permalink
http: more cleanup, documentation fixes
Browse files Browse the repository at this point in the history
The API is very nearly completely converted.
  • Loading branch information
gdamore committed Jan 10, 2025
1 parent 70568fd commit 594f928
Show file tree
Hide file tree
Showing 21 changed files with 263 additions and 658 deletions.
2 changes: 0 additions & 2 deletions demo/http_client/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ main(int argc, char **argv)
nng_http *conn;
nng_url *url;
nng_aio *aio;
nng_http_res *res;
const char *hdr;
int rv;
int len;
Expand Down Expand Up @@ -84,7 +83,6 @@ main(int argc, char **argv)

// Get the connection, at the 0th output.
conn = nng_aio_get_output(aio, 0);
res = nng_http_conn_res(conn);

// Request is already set up with URL, and for GET via HTTP/1.1.
// The Host: header is already set up too.
Expand Down
1 change: 0 additions & 1 deletion demo/reqrep/reqrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ client(const char *url)
nng_socket sock;
nng_dialer dialer;
int rv;
size_t sz;
int sleep = 0;

if ((rv = nng_init(NULL)) != 0) {
Expand Down
7 changes: 3 additions & 4 deletions demo/rest/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ rest_job_cb(void *arg)
}
job->msg = nng_aio_get_msg(aio);
// We got a reply, so give it back to the server.
rv = nng_http_res_copy_data(nng_http_conn_res(job->conn),
nng_msg_body(job->msg), nng_msg_len(job->msg));
rv = nng_http_copy_body(
job->conn, nng_msg_body(job->msg), nng_msg_len(job->msg));
if (rv != 0) {
rest_http_fatal(job, rv);
return;
Expand All @@ -189,7 +189,6 @@ void
rest_handle(nng_http *conn, void *arg, nng_aio *aio)
{
struct rest_job *job;
nng_http_req *req = nng_http_conn_req(conn);
size_t sz;
int rv;
void *data;
Expand All @@ -205,7 +204,7 @@ rest_handle(nng_http *conn, void *arg, nng_aio *aio)
return;
}

nng_http_req_get_data(req, &data, &sz);
nng_http_get_body(conn, &data, &sz);
job->http_aio = aio;

if ((rv = nng_msg_alloc(&job->msg, sz)) != 0) {
Expand Down
61 changes: 0 additions & 61 deletions docs/man/nng_http_req_copy_data.3http.adoc

This file was deleted.

49 changes: 0 additions & 49 deletions docs/man/nng_http_req_get_data.3http.adoc

This file was deleted.

63 changes: 0 additions & 63 deletions docs/man/nng_http_req_set_data.3http.adoc

This file was deleted.

61 changes: 0 additions & 61 deletions docs/man/nng_http_res_copy_data.3http.adoc

This file was deleted.

49 changes: 0 additions & 49 deletions docs/man/nng_http_res_get_data.3http.adoc

This file was deleted.

Loading

0 comments on commit 594f928

Please sign in to comment.