Commit Graph

940 Commits

Author SHA1 Message Date
Joris Vink 8b723479ec bump 2016-08-01 15:01:19 +02:00
Joris Vink a16348d524 Remove links to kore.io for releases 2016-08-01 09:59:32 +02:00
Joris Vink c2dd274c40 update with latest 2016-08-01 09:41:12 +02:00
Joris Vink 441cc34f31 bump to release 2016-08-01 09:38:40 +02:00
Joris Vink 77adb35193 JSONRPC requires HTTP, let users figure that out the hard way. 2016-08-01 09:25:56 +02:00
Joris Vink db4f6cf01f align pointers from kore_malloc() properly. 2016-07-28 14:52:15 +02:00
Joris Vink 0b92afe53d Explicitly set offset to 0 for http_file. 2016-07-27 16:43:05 +02:00
Joris Vink 46cee2ff46 Typo. 2016-07-15 22:34:21 +02:00
Joris Vink f5923af1c6 Add /usr/local/[include|lib] for BSD / JSONRPC. 2016-07-15 22:33:58 +02:00
Joris Vink 6ba8dd439b Merge pull request #135 from raphaelmonrouzeau/master
Add conditional JSON-RPC support
2016-07-15 22:25:52 +02:00
Raphaël Monrouzeau 06d9ca96da JSONRPC Updated to last kore_buf* commit 2016-07-15 13:17:30 +02:00
Raphaël Monrouzeau cd9ce057ea JSONRPC Changed Makefile option location 2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau 32ac27d4c3 JSONRPC Reverted explicit deallocation calls
The possibility to call jsonrpc_destroy_request was left. Someone may
want to abruptly interrupt the process of its request for some odd
reason, in that case an exlicit call still would be to be made.
2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau 7a4e4223c4 JSONRPC If support compiled in log it at start 2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau a818555c96 JSONRPC use size_t to get in line with last commit
Kore now uses size_t for kore_buf and http_response() so response size
check is useless and u_int32_t variables should be converted.
2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau 016dc27346 JSONRPC Made request destruction explicit
Caller has now to destroy jsonrpc_request after use. This permits them
to read / inspect it after having responded.
2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau 8c78b28be3 JSONRPC Removed upload size limit check
A true application dependant limit check would require stream parsing.
As the limit enforcement was done, it added nothing of value compared
to HTTP request limit check, which is in Kore already.
2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau 3366ec6573 Required params to be structured as per spec 2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau 4ffe43cf87 Compliantly don't return anything to notifications
And don't return anything either if protocol doesn't match.
2016-07-15 13:08:08 +02:00
Raphaël Monrouzeau db02e990ea JSON-RPC support for Kore.
The API surface is very limited. Jsonrpc support reads request from HTTP
body and such can't be activated if NOHTTP=1. At the moment there is no
websocket support either (which is a shame). It depends upon the
third-party Yajl library.

Errors can be emitted using jsonrpc_error() and results using
jsonrpc_result(), for the later you'll have to provide a callback which
will write the inner of the result object.

If errors happen during the response write process, no further error
output will be attempted and an HTTP error 500 will be returned.

Read the provided example for getting a better idea of the API.
2016-07-15 13:08:08 +02:00
Joris Vink 2cf83aea3c Merge branch 'raphaelmonrouzeau-kore_buf_noalloc' 2016-07-14 12:42:40 +02:00
Joris Vink 00b64033ca More buf improvements.
- make sure kore_buf_alloc() and kore_buf_init() buffers behave
  the same way in regards to calling kore_buf_release() and what not.
2016-07-14 12:41:39 +02:00
Joris Vink 43fec8678e kore_buf_create -> kore_buf_alloc. 2016-07-14 12:34:29 +02:00
Joris Vink b28b60c2ff buf API changes.
- rename kore_buf_destroy() to kore_buf_cleanup().
- rename kore_buf_create() to kore_buf_alloc().
2016-07-14 12:33:13 +02:00
Joris Vink 3b0477cf97 kore_mem_free -> kore_free 2016-07-14 12:29:49 +02:00
Joris Vink 7cf73b5fa5 Merge branch 'kore_buf_noalloc' of https://github.com/raphaelmonrouzeau/kore into raphaelmonrouzeau-kore_buf_noalloc 2016-07-14 12:28:51 +02:00
Joris Vink 33c0b3c753 Make pools thread-safe if built with TASKS.
Use CAS to implement primitive spinlock ontop of the pool
if we have been built with TASKS=1.

This allows tasks to safely use kore_malloc() and kore_free()
since those are now backed by pools.
2016-07-12 16:30:57 +02:00
Joris Vink 3c43d1203c Move towards size_t in the pool API. 2016-07-12 14:01:02 +02:00
Joris Vink 4ad50caa29 Large changes to the memory subsystem in kore.
- Change pools to use mmap() for allocating regions.
- Change kore_malloc() to use pools for commonly sized objects.
  (split into multiple of 2 buckets, starting at 8 bytes up to 8192).
- Rename kore_mem_free() to kore_free().

The preallocated pools will hold up to 128K of elements per block size.

In case a larger object is to be allocated kore_malloc() will use
malloc() instead.
2016-07-12 13:54:14 +02:00
Raphaël Monrouzeau db3cf28d22 Added kore_buf no alloc functions.
kore_buf_create and kore_buf_free do use kore_malloc. But sometimes you
may embed a kore_buf inside a structure and would like a single way to
initialize / destroy it.
2016-07-09 12:30:24 +02:00
Raphaël Monrouzeau a07cf87b15 Ignored .lvimrc and prior vim stale files if there 2016-07-09 12:27:01 +02:00
Joris Vink d30921103b Code cleanup, several API breaking changes in here 2016-07-08 10:03:41 +02:00
Joris Vink a8917e355a Add prototype for kore_onload(). 2016-07-07 13:18:41 +02:00
Joris Vink e96ed9ad66 Change default domain for kore create skeleton. 2016-07-07 12:36:08 +02:00
Joris Vink d2c30fd70b for single binaries use progname as the log id. 2016-07-06 22:02:10 +02:00
Joris Vink 9abf15a498 Make kore_onload() to be done per worker.
Mimics the behaviour of dso builds.
2016-07-06 21:59:17 +02:00
Joris Vink 39a5f21986 Allow "kore build" to produce single binaries.
Producing single binaries can now be done with building with
"kore build". To get started edit your build.conf and add the
following directives:

single_binary = yes
kore_source = /path/to/kore

optionally you can add kore_flavor to instruct how kore should
be built:

kore_flavor = NOTLS=1

When doing this your build.conf must also include the correct
linking options as the linking is now done fully by kore build.

The binary produced will include your configuration and takes
over a few of kore its command line flags (such as -f, -n or -r).
2016-07-06 16:16:15 +02:00
Joris Vink 7ac1ea379d Unbreak json_yajl example. 2016-07-06 09:23:41 +02:00
Joris Vink 27acc51241 Improve kore_strlcpy().
Make it return the original length of the input string so the caller
can check for truncation. Also guard against len being 0 as this would
not do anything with the destination string (not even NUL terminate it).
2016-07-04 11:41:37 +02:00
Joris Vink 589c7667be Cleanup cli.c a bit.
- Define CXXFLAGS_MAX as CFLAGS_MAX as we use CFLAGS_MAX usually.
- Fix formatting of a few blocks of code.
2016-06-29 16:25:52 +02:00
Joris Vink ec7a7b33e7 Merge pull request #132 from nibroc/cpp
Compile and link C++ with g++ instead of gcc
2016-06-29 16:23:00 +02:00
Corbin Hughes 91d29a9914 Better name consistency and only print CXXFLAGS if compiling C++ 2016-06-27 22:33:51 -05:00
Corbin Hughes 698b3f374f Compile and link C++ with g++ instead of gcc 2016-06-26 15:49:59 -05:00
Joris Vink 8d92dd2af4 Allow building against libressl again. 2016-06-26 11:36:33 +02:00
Joris Vink 43a726c02d Use sys/types.h instead of sys/param.h for assets. 2016-06-23 16:18:36 +02:00
Joris Vink 89f81a8b5a Revert "Throw a handshake failure if we cannot find the given SNI hostname."
This reverts commit afd4182975.
2016-06-09 13:52:37 +02:00
Joris Vink afd4182975 Throw a handshake failure if we cannot find the given SNI hostname. 2016-06-08 16:46:28 +02:00
Joris Vink f62430d1fa Isolate ECDSA keys in keymgr as well. 2016-06-08 16:31:14 +02:00
Joris Vink 87a826d89b Better wording. 2016-06-08 14:25:16 +02:00
Joris Vink a261c03435 mention keymgr. 2016-06-08 14:24:51 +02:00