745 Commits

Author SHA1 Message Date
Joris Vink
4dff0b57ae Add openssl paths for homebrew/ports for osx.
These are the default paths openssl should be installed under
for both projects. This at least kills the need for user CFLAGS
for a normal build.

Inspired by #70.
2015-06-28 13:43:01 +02:00
Joris Vink
a64808c6b0 Improvements to our message framework.
Change the callback prototypes to:
	void callback(struct kore_msg *msg, const void *data);

This allows the callbacks to receive the full kore_msg data structure
as sent over the wire (including length and id). Useful for future
additions to the kore_msg structure (such as worker origin).

Several other improvements:
	* Accesslog now uses the msg framework as well.
	* Websocket WEBSOCKET_BROADCAST_GLOBAL now works.

Small websocket improvement in this commit:
	* Build the frame to be sent only once when broadcasting
	 instead of per connection we are broadcasting towards.
2015-06-23 18:17:14 +02:00
Joris Vink
0e3271cf9d Add EV_CLEAR to the bsd event code for kqueue.
This was missing and makes dealing with events easier.
2015-06-23 18:16:19 +02:00
Joris Vink
c322bbd3c8 Kill the websocket message type. We're not there yet. 2015-06-22 22:20:42 +02:00
Joris Vink
28e48727a5 Kill TCP_NODELAY warnings for socketpair() fds. 2015-06-22 22:11:03 +02:00
Joris Vink
e9832b4416 Remove dh2048.pem from messaging example. 2015-06-22 21:22:24 +02:00
Joris Vink
7100ab0dd3 Remove useless log message. 2015-06-22 21:21:03 +02:00
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. 1.2.3-release 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