aboutsummaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-01-24 17:38:16 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-01 16:11:38 -0800
commit3dae30ed5e543dc73fc993334ef56b9b157b9b3c (patch)
treed7e294b5d544aa18e8fc8749abfe605a05fa4bd7 /src/protocol
parent5914e40c2ff7fcf346c90705785f3fb7650a9fdc (diff)
downloadnng-3dae30ed5e543dc73fc993334ef56b9b157b9b3c.tar.gz
nng-3dae30ed5e543dc73fc993334ef56b9b157b9b3c.tar.bz2
nng-3dae30ed5e543dc73fc993334ef56b9b157b9b3c.zip
fixes #173 Define public HTTP server API
This introduces enough of the HTTP API to support fully server applications, including creation of websocket style protocols, pluggable handlers, and so forth. We have also introduced scatter/gather I/O (rudimentary) for aios, and made other enhancements to the AIO framework. The internals of the AIOs themselves are now fully private, and we have eliminated the aio->a_addr member, with plans to remove the pipe and possibly message members as well. A few other minor issues were found and fixed as well. The HTTP API includes request, response, and connection objects, which can be used with both servers and clients. It also defines the HTTP server and handler objects, which support server applications. Support for client applications will require a client object to be exposed, and that should be happening shortly. None of this is "documented" yet, bug again, we will follow up shortly.
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/bus0/bus.c7
-rw-r--r--src/protocol/pair0/pair.c5
-rw-r--r--src/protocol/pipeline0/pull.c4
-rw-r--r--src/protocol/pipeline0/push.c4
-rw-r--r--src/protocol/pubsub0/pub.c6
-rw-r--r--src/protocol/pubsub0/sub.c4
-rw-r--r--src/protocol/reqrep0/rep.c6
-rw-r--r--src/protocol/reqrep0/req.c6
-rw-r--r--src/protocol/survey0/respond.c6
-rw-r--r--src/protocol/survey0/survey.c2
10 files changed, 23 insertions, 27 deletions
diff --git a/src/protocol/bus0/bus.c b/src/protocol/bus0/bus.c
index 3e15000b..1176bf01 100644
--- a/src/protocol/bus0/bus.c
+++ b/src/protocol/bus0/bus.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -31,7 +31,6 @@ static void bus0_sock_send(void *, nni_aio *);
static void bus0_sock_recv(void *, nni_aio *);
static void bus0_pipe_getq(bus0_pipe *);
-static void bus0_pipe_send(bus0_pipe *);
static void bus0_pipe_recv(bus0_pipe *);
static void bus0_sock_getq_cb(void *);
@@ -110,7 +109,7 @@ bus0_sock_close(void *arg)
{
bus0_sock *s = arg;
- nni_aio_cancel(s->aio_getq, NNG_ECLOSED);
+ nni_aio_abort(s->aio_getq, NNG_ECLOSED);
}
static void
diff --git a/src/protocol/pair0/pair.c b/src/protocol/pair0/pair.c
index bac405b8..10498c0a 100644
--- a/src/protocol/pair0/pair.c
+++ b/src/protocol/pair0/pair.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -191,7 +191,6 @@ static void
pair0_getq_cb(void *arg)
{
pair0_pipe *p = arg;
- pair0_sock *s = p->psock;
if (nni_aio_result(p->aio_getq) != 0) {
nni_pipe_stop(p->npipe);
diff --git a/src/protocol/pipeline0/pull.c b/src/protocol/pipeline0/pull.c
index 8c16cb17..44eb87f9 100644
--- a/src/protocol/pipeline0/pull.c
+++ b/src/protocol/pipeline0/pull.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
diff --git a/src/protocol/pipeline0/push.c b/src/protocol/pipeline0/push.c
index 3dd83fe0..2829e2aa 100644
--- a/src/protocol/pipeline0/push.c
+++ b/src/protocol/pipeline0/push.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
diff --git a/src/protocol/pubsub0/pub.c b/src/protocol/pubsub0/pub.c
index f4a33b77..285f40ca 100644
--- a/src/protocol/pubsub0/pub.c
+++ b/src/protocol/pubsub0/pub.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -105,7 +105,7 @@ pub0_sock_close(void *arg)
{
pub0_sock *s = arg;
- nni_aio_cancel(s->aio_getq, NNG_ECLOSED);
+ nni_aio_abort(s->aio_getq, NNG_ECLOSED);
}
static void
diff --git a/src/protocol/pubsub0/sub.c b/src/protocol/pubsub0/sub.c
index 6c504d75..a756e326 100644
--- a/src/protocol/pubsub0/sub.c
+++ b/src/protocol/pubsub0/sub.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c
index ee8e4277..f1a3a409 100644
--- a/src/protocol/reqrep0/rep.c
+++ b/src/protocol/reqrep0/rep.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -116,7 +116,7 @@ rep0_sock_close(void *arg)
{
rep0_sock *s = arg;
- nni_aio_cancel(s->aio_getq, NNG_ECLOSED);
+ nni_aio_abort(s->aio_getq, NNG_ECLOSED);
}
static void
diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c
index 94c7f1a0..2a641933 100644
--- a/src/protocol/reqrep0/req.c
+++ b/src/protocol/reqrep0/req.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -71,7 +71,6 @@ struct req0_pipe {
nni_mtx mtx;
};
-static void req0_resender(void *);
static void req0_getq_cb(void *);
static void req0_sendraw_cb(void *);
static void req0_sendcooked_cb(void *);
@@ -312,7 +311,6 @@ static void
req0_getq_cb(void *arg)
{
req0_pipe *p = arg;
- req0_sock *s = p->req;
// We should be in RAW mode. Cooked mode traffic bypasses
// the upper write queue entirely, and should never end up here.
diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c
index 73e919c3..2f0514a9 100644
--- a/src/protocol/survey0/respond.c
+++ b/src/protocol/survey0/respond.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -116,7 +116,7 @@ resp0_sock_close(void *arg)
{
resp0_sock *s = arg;
- nni_aio_cancel(s->aio_getq, NNG_ECLOSED);
+ nni_aio_abort(s->aio_getq, NNG_ECLOSED);
}
static void
diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c
index 3944a105..b8f10f0e 100644
--- a/src/protocol/survey0/survey.c
+++ b/src/protocol/survey0/survey.c
@@ -118,7 +118,7 @@ surv0_sock_close(void *arg)
surv0_sock *s = arg;
nni_timer_cancel(&s->timer);
- nni_aio_cancel(s->aio_getq, NNG_ECLOSED);
+ nni_aio_abort(s->aio_getq, NNG_ECLOSED);
}
static void