Commit Graph

20 Commits

Author SHA1 Message Date
Joris Vink c999bf5001 Kore can now disconnect SPDY session if they've been idle too long.
Configurable via spdy_idle_time in your configuration file.

Setting this to 0 will keep SPDY sessions open indefinately.
2013-07-13 20:19:01 +02:00
Joris Vink f59e94a7b6 Add spdy_session_teardown() which can properly teardown a SPDY session.
Use this throughout the spdy code to propagate session errors (if any) occur.

At the same time fix BSD's missing CONN_WRITE_BLOCK
2013-07-13 19:56:38 +02:00
Joris Vink bb09e8b2a9 add base64 encoder/decoder in prep for http/2.0 and websockets 2013-07-10 15:00:53 +02:00
Joris Vink 9b1f0a3fab add a skeleton framework for creating new modules. 2013-07-10 09:28:00 +02:00
Joris Vink 354a3f1ad1 Fix header includes in the module example as well, from Ewan Higgs via github. 2013-07-06 21:00:48 +02:00
Joris Vink bbc98cf2a7 Add MODULE_BUILD_DATE to static.h when building.
Contains %Y-%m-%d %H-%M-%S timestamp of when the module was built.
2013-07-06 18:07:06 +02:00
Joris Vink a2392e645f use kore_mem_free() in example module 2013-07-01 11:52:45 +02:00
Joris Vink 7828bd0cfc add ssl_cipher 2013-06-27 08:46:01 +02:00
Joris Vink 1582528ba5 Merge remote-tracking branch 'origin/master' 2013-06-27 00:32:16 +02:00
Joris Vink 2fc5233358 Rework the way worker processes give each other the accept lock.
Instead of waiting until one worker is filled up on connections
the workers find the next lowest loaded worker and will hand
over the lock to them instead. This will cause a nicer spread of load.

Instead of running one accept per event loop, we attempt to accept
as many as worker_max_connections allows.

Refactor net sending/recv code a bit.
2013-06-27 00:22:48 +02:00
Joris Vink 1412449fe7 skip certain files when building 2013-06-26 19:15:49 +02:00
Joris Vink 124f3ecad9 no need to use kore_log() in a debug context 2013-06-26 15:59:42 +02:00
Joris Vink 113dbaba53 reset worker_max_connections back to default 2013-06-26 15:58:09 +02:00
Joris Vink 7a2e855d28 set tstamp to 0 in the correct location 2013-06-26 16:57:34 +02:00
Joris Vink 0dda6f996f Add a form of synchronization between what worker will be accepting
new connections and which ones will not be notified for it.

Fixes the thundering herd problem, and nicely spreads out load between
all the workers equally. A configuration option (workers_max_connections)
is available to tweak how many connections a worker will have before
giving up the accept lock.

Two ways are added to this commit for access locking:
- Locking via semaphores.
- Locking via GCC's builtin atomic methods.

The default is running with semaphores disabled (OpenBSD cannot do
sem_init() with pshared set to 1, which is required).

If you want to use semaphores add KORE_USE_SEMAPHORES to CFLAGS,
and -lpthread to LDFLAGS in the Makefile.

Other fixes:
- BSD: add a timeout to kevent().
- Merge kore_worker_wait together, linux knows waitpid() as well.
- Send the correct SIGQUIT signal to workers instead of SIGINT.
- Fix kore_time_ms().
- Log fatal worker messages in syslog.
- Refactor code even more.
- Do not free our own kore_worker structure.
2013-06-26 16:37:22 +02:00
Joris Vink 3e5c17b8a3 refactor code quite a bit. 2013-06-26 11:18:32 +02:00
Joris Vink cff44cd5f3 fix some broken things in the build script. 2013-06-25 08:26:06 +02:00
Joris Vink d2c4fde7fe fix so we can properly add binary media 2013-06-24 18:29:40 +02:00
Joris Vink f48fe0a326 remove unused 2013-06-24 18:23:29 +02:00
Joris Vink ae5da79f61 new build script for modules, which should be used as a base for
all new modules written by others.
2013-06-24 18:22:35 +02:00