1
0
mirror of https://git.kore.io/kore.git synced 2024-11-12 05:10:48 +01:00
Commit Graph

74 Commits

Author SHA1 Message Date
Joris Vink
9eb32e668e use correct base64 alphabet (URL and Filename Safe Alphabet) 2013-07-10 15:04:01 +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
c1723f2db5 Clean up header includes, based on a diff from Ewan Higgs via github.
And while we're messing in it, make sure bsd.c compiles again.
2013-07-06 20:55:22 +02:00
Joris Vink
b4a0330a96 - Better spread load between all worker processes.
- Introduce own memory management system on top of malloc to keep track
  of all our allocations and free's. Later we should introduce a pooling
  mechanism for fixed size allocations (http_request comes to mind).
- Introduce ssl_cipher in configuration.

Memory usage is kind of high right now, but it seems its OpenSSL
doing it rather then Kore.
2013-06-27 08:43:07 +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
a1b400c400 Add access logging to Kore. 2013-06-24 09:36:40 +02:00
Joris Vink
b9f47b0f86 configuration files are now passed using the -c option.
allow debug output when the -d flag is specified.
2013-06-05 08:55:07 +02:00
Joris Vink
90e1b3a7da use syslog() for informative messages from all parts of kore. 2013-06-04 23:24:47 +02:00
Joris Vink
e7db5ee6b1 rename kore_log to kore_debug, and allow one to turn it off. 2013-06-04 16:30:53 +02:00
Joris Vink
0de28488a6 move from multithreads to single threaded worker processes. 2013-06-04 11:55:38 +02:00
Joris Vink
088d877715 switch dynamic handlers to regex based patterns, much easier. 2013-05-29 14:29:46 +02:00
Joris Vink
f61bbe8ff4 move buf stuff back into kore.h, wont need it separately 2013-05-02 15:14:00 +02:00
Joris Vink
84428f7133 move buf stuff into its own header, so we can use it in spdy.h 2013-05-02 14:55:57 +02:00
Joris Vink
f46bba50ef add very basic support for HTTP/1.1. 2013-05-02 03:51:04 +02:00
Joris Vink
a9ebf37cae allow modules to add headers to the response before calling http_response()
by calling http_response_header_add().

fix wrong overflow check in spdy_stream_get_header().

html_inject now exports last modified timestamp for the files that are
compiled into the module in the format static_mtime_<type>_<name>.

modules can now look into the request headers using http_request_header_get().
2013-05-01 21:16:09 +02:00
Joris Vink
a228cdba0e introduce kore_split_string() to properly split strings apart.
introduce kore_date_to_time() to conver http-date formatted strings to time_t.
2013-05-01 20:10:45 +02:00
Joris Vink
d9bbb0b1f1 initial module support 2013-05-01 16:03:48 +02:00
Joris Vink
d59847c448 SPDY works, we can serve content. Now for dynamic modules so we can
get stuff on the road.

TODO: add plain HTTP support if SPDY isnt working in the browser.
2013-05-01 12:23:21 +02:00
Joris Vink
05156c9a3a properly deflate/inflate of name/value blocks. and add ability
to get headers from them.
2013-05-01 00:35:33 +02:00
Joris Vink
c8b422d29d allow us to expand receive buffers automatically so we can keep chaining data into the same netbuf. This gives us the possibility to retain the ctrl_frame by the time we reach the proper cb for the actual frame message. 2013-04-28 23:42:13 +02:00
Joris Vink
23c0ec67c6 begin with the ability to read control frames. something feels fishy with epoll() and its triggering of events. I probably got it wrong. 2013-04-28 19:11:44 +02:00
Joris Vink
68d0523817 Add initial SSL stuff + bare bones NPN advertisement. So far chrome connects and
shows our connection as SPDY/3, good start.
2013-04-21 20:21:46 +02:00
Joris Vink
857c3f9121 first commit 2013-04-17 22:34:27 +02:00