Commit Graph

38 Commits

Author SHA1 Message Date
Joris Vink 765214c5dc Update build.sh 2013-10-23 22:58:15 +02:00
Joris Vink 6028a3edc3 Get rid of some bash-ism and do stuff ourselves. 2013-10-15 14:54:02 +02:00
Joris Vink 190315c238 Make inject.c no longer spew warnings, instead use correct widths for time_t on all platforms. 2013-10-15 13:33:35 +02:00
Joris Vink ee99503323 Fix building example module in OpenBSD. 2013-10-15 13:09:00 +02:00
Joris Vink c64d3e7854 Add http_keepalive_time configuration parameter.
Allows you to configure maximum amount of seconds an HTTP connection
can stay open (does not affect SPDY connections). If set to 0 it will
disable keep-alive all together.

Add some inttypes fluff.
2013-10-15 11:10:45 +02:00
Joris Vink 8b47863cd4 Add http_hsts_enable (enabled by default with max-age=31536000) to Kore's configuration file.
If enabled Kore adds the HSTS header to every response.

- Additionally, fix some typos in the example configuration.
- Change default SSL cipher list again, no more RC4 and almost PFS for all browsers.
2013-10-15 10:44:56 +02:00
Joris Vink 0d63fd829b change some comments 2013-09-24 08:59:37 +02:00
Joris Vink 0a49f29e10 Add support for ECDH and provide a better ssl_cipher set by default. 2013-09-24 08:58:05 +02:00
Joris Vink 88c3a3eb98 Add http_header_max and http_postbody_max configuration variables.
- http_header_max:
	Maximum size of HTTP headers (in non SPDY connections).

- http_postbody_max:
	Maximum size of an HTTP POST body (both in SPDY and HTTP mode).

Right now Kore will simply DC the client, ideally we want to send
a 413 (entity too large) to the client however.

See modules/examples/module.conf for more.
2013-09-22 20:05:24 +02:00
Joris Vink 9650a7654a remove test settings 2013-09-10 11:17:40 +02:00
Joris Vink 25e8f93331 Add support for multipart forms.
New API functions (docs need to be updated):
	- http_file_lookup()
	- http_file_add()
	- http_argument_add()
	- kore_strip_chars()
	- kore_mem_find()

- Add an example under the example module on how files can be read.
2013-09-10 11:02:59 +02:00
Joris Vink c9d4f70298 - Add SPDY RST control frame handler.
- Keep HTTP requests in connection, so we can delete them if the connection
  ends before the requests do (this way we don't leak them).
- When spdy_stream_close() is called, delete the attached http request.
  (This shouldn't hurt to do, so hopefully won't cause major fallout).
- When parsing HTTP, find the first occurence of end-of-headers so uploads
  with multipart/form-data can succeed properly.
- Add a test upload page to the example module.
2013-09-09 10:59:56 +02:00
Joris Vink ee3fd3c039 Allow the user defined callback to run on workers as well. 2013-09-03 08:41:09 +02:00
Joris Vink 95c8b8e126 Add a callback that Kore can call in your module every given interval.
The callback is run from the parent process (which runs as root).

Adds kore_cb and kore_cb_interval configuration options.
2013-09-02 08:52:16 +02:00
Joris Vink bbfbfc4c61 add ssl_no_compression option to allow one to disable OpenSSL compression. 2013-08-07 16:59:45 +02:00
Joris Vink 429768ba37 Add ssl_dhparam 2013-08-07 16:55:13 +02:00
Joris Vink 659e19f92f add IPv6 support and support for multiple listeners. 2013-07-27 20:56:15 +02:00
Joris Vink 341172f844 Do not 0 out everything we allocate, and instead fix the behaviour of the code in the appropriate places. 2013-07-16 09:56:36 +02:00
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