Commit Graph

738 Commits

Author SHA1 Message Date
Joris Vink 49ca95f390 Add our messaging framework.
With this framework apps can now send messages between worker processes.

A new API function exists:
	int kore_msg_register(u_int8_t id, void (*cb)(const void *, u_int32_t);

This API call allows your app to register a new message callback for a given ID.

You can then send messages on this ID to other workers using:
	void kore_msg_send(u_int8_t id, void *data, u_int32_t length);

This framework will interally be used for a few things such as allowing
websocket data to broadcasted between all workers, adding unified caching
and hopefully eventually moving the access log to this as well.

Some internals have changed with this commit:
	* worker_clients has been called connections.
	* the parent now initializes the net, and event subsystems.
	* kore_worker_websocket_broadcast() is dead.
2015-06-22 21:13:32 +02:00
Joris Vink 63b0c0a903 Fix typo. 2015-06-14 17:21:16 +02:00
Joris Vink db198578c6 Allow Kore to function under DragonflyBSD.
From David Carlier
2015-06-14 16:54:44 +02:00
Joris Vink 9217fb0bd8 Fix typo. 2015-06-14 16:50:10 +02:00
Joris Vink 13795ead63 NetBSD fixes, from David Carlier. 2015-06-14 16:44:37 +02:00
Joris Vink 512e305e20 When building assets, skip empty files. 2015-06-11 19:33:30 +02:00
Joris Vink 81d119ff93 Let kore build pickup any environment CFLAGS. 2015-06-11 19:20:08 +02:00
Joris Vink 3682c759f9 Kill docker files.
After some pondering they do not belong in this repo. If anyone
wants to maintain these outside of this repo, go right ahead.
2015-06-11 18:46:44 +02:00
Joris Vink 1d604643b5 Add task_threads configuration option.
Before Kore would spawn a task thread per task started
if none were available. This was an obvious bad idiom
but never really hit me hard until now.

Kore will now only spawn as many task threads as configured
by "task_threads" and queue up any newly started tasks ontop
of already running threads if the limit was hit.
2015-06-04 10:29:22 +02:00
Joris Vink 854b916597 Update usage text. 2015-05-28 22:20:43 +02:00
Joris Vink 428818c76b Correct the module its init() function. 2015-05-28 19:58:06 +02:00
Joris Vink 21035cd3f2 Merge pull request #67 from Geenz/master
Small tweak to kore's output when running a module
2015-05-27 16:25:13 +02:00
Geenz 0f5b39c977 Small tweak to kore's output when running a module 2015-05-27 09:34:47 -04:00
Joris Vink 76823c9d07 Merge pull request #66 from Geenz/master
Rename BENCHMARK to NOTLS.

This communicates better what the build option actually does.
2015-05-25 15:51:07 +02:00
Geenz 817b916e1f Call it NOTLS instead.
Per @jorisvink's feedback.
2015-05-25 09:42:34 -04:00
Geenz c44de3f629 Rename BENCHMARK to reflect its actual function.
NO_SSL makes a bit more sense, especially for people who proxy their requests via nginx, apache, or similar.
2015-05-25 09:28:13 -04:00
Joris Vink 9d7cf2aa4a Move to 1.2.4-develop 2015-05-21 15:50:12 +02:00
Joris Vink 035fd1c2aa Mention 1.2.3 release 2015-05-21 15:48:53 +02:00
Joris Vink 2ee09b6a43 Kill lingering PHONY target. 2015-05-21 14:59:56 +02:00
Joris Vink 6efd3ffae2 Merge pull request #63 from thorduri/docker-toplevel-gc
top level dockerfile not generally useful.
2015-05-21 14:46:50 +02:00
Thordur Bjornsson 43fb9d832d oops, missed dockerignore 2015-05-21 14:46:12 +02:00
Thordur Bjornsson abacc14a2c top level dockerfile not generally useful.
So, garbage collect.
2015-05-21 14:42:25 +02:00
Joris Vink fa109725ee Bump KORE_VERSION to 1.2.3 in preparation for release. 2015-05-21 14:10:48 +02:00
Joris Vink 30ab464b91 Merge pull request #62 from thorduri/docker
Contain the kore.
2015-05-21 14:10:00 +02:00
Joris Vink 749b0884a6 Prepare for 1.2.3-release 2015-05-21 13:46:44 +02:00
Joris Vink 20a4cd80c5 Kill own definition of be64toh() for openbsd. 2015-05-21 11:01:50 +02:00
Joris Vink 02e06b8bb6 Stop client initiated TLS renegotiations completely. 2015-05-20 16:36:13 +02:00
Thordur Bjornsson 9c2e902b81 Contain the kore.
Add a top level Dockerfile, not really useful for anything besides
hacking on kore. See `make contain`;

Add docker top level directory, it contains an `app` container,
with a `kore run` ENTRYPOINT, an example of using that image is

   FROM kore/app

   COPY . myapp
   CMD ["myapp"]

There is also a `build` image, which is the base for both aforementioned
containers.
2015-05-20 16:31:28 +02:00
Joris Vink ff2574899d small style fix. 2015-05-20 11:36:02 +02:00
Joris Vink cdefb66ed8 Spacing. 2015-05-20 11:34:57 +02:00
Joris Vink 15fd954501 Merge pull request #61 from thorduri/runas
Make runas behave similarly to chroot.
2015-05-20 11:34:07 +02:00
Thordur Bjornsson d8ccf3c7bf Gunk the default runas/chroot values.
Fatal in the config setup if running without skip_{chroot,runas} and
no values specified.
2015-05-20 11:08:51 +02:00
Thordur Bjornsson e47df37230 Make runas behave similarly to chroot.
Add new command line knob '-r', that disables runas similar to '-n',
it's implied as well for kore command runs.

Add default runas (nobody) user and chroot (/var/empty) path, if none
are specified, fallback to these.
2015-05-20 10:28:19 +02:00
Joris Vink ee59eb3f77 Small changes to the example configuration. 2015-05-19 21:53:58 +02:00
Joris Vink ab8b57e6d4 Merge pull request #60 from QuentinPerez/add-noreturn
add noreturn attribute
2015-05-19 09:57:54 +02:00
Quentin PEREZ e2e5631b8c add noreturn attribute
fix false-positive warning
2015-05-19 09:45:04 +02:00
Joris Vink a97e18bbe9 Shuffle some HTTP_REQUEST_NO_CONTENT_LENGTH around 2015-05-19 09:13:29 +02:00
Joris Vink e33710b26a Wrap expression with some additional parenthesis. 2015-05-19 09:04:46 +02:00
Joris Vink 242340b045 Bump to 1.2.3-rc2 2015-05-19 08:48:17 +02:00
Joris Vink e4e9a2f81e Merge pull request #58 from QuentinPerez/fix-null-dereference
fix-null-dereference
2015-05-19 06:35:08 +02:00
Quentin Perez ff4faa98b7 fix-null-dereference
http.c:1214, req->method
http.c:1272, req->flags
2015-05-18 23:42:50 +02:00
Joris Vink 5228fe1cbc Fix typo in configuration option worker_accept_treshold.
There is no backwards comptabile option available.

Fixes #53
2015-05-18 12:20:28 +02:00
Joris Vink 5f48a03703 Merge pull request #52 from pborreli/typos
Fixed typos
2015-05-17 10:23:52 +02:00
Pascal Borreli 4e9d9968ac Fixed typos 2015-05-17 02:51:46 +01:00
Joris Vink 3ee07cfbfe Add SSE (Server Side Events) example. 2015-05-15 19:23:26 +02:00
Joris Vink 875b3a46e6 SPDY stream changes.
Allow callers to set an onclose callback method for SPDY streams
so they can get notified when a stream is closed.

Also add SPDY_NO_CLOSE which tells the underlying Kore layer
to not send a FIN for a SPDY stream until a module does it itself.
2015-05-15 19:17:09 +02:00
Joris Vink 1dd7407a41 Close SPDY streams if len == 0 and SPDY_NO_CLOSE is not set. 2015-05-15 19:16:35 +02:00
Joris Vink cefeaf7992 HTTP layer improvements.
Add HTTP_REQUEST_NO_CONTENT_LENGTH which can be set by
a handler before calling http_response() to avoid Kore
from setting the content-length altogether.

If we are on a SPDY connection do not close the stream
if we do not pass data to http_response().
2015-05-15 19:12:18 +02:00
Joris Vink 0c4dbad2fb Kore timer improvements.
Introduces kore_timer_remove() and updates kore_timer_add()
to return the newly added timer as a struct kore_timer.

Also allow arguments to be passed to timers.
2015-05-15 19:11:10 +02:00
Joris Vink e2ce032b02 Do not treat EPOLLRDHUP as a connection error. 2015-05-15 19:10:23 +02:00