1
0
mirror of https://git.kore.io/kore.git synced 2024-11-11 20:59:07 +01:00
Commit Graph

1613 Commits

Author SHA1 Message Date
Joris Vink
fff0a763ae Let tasks only start after kore_task_run() is called. 2014-06-30 14:35:32 +02:00
Joris Vink
ed1e5e249e Sprinkle volatile 2014-06-30 14:23:04 +02:00
Joris Vink
80c0a4cb6e Task improvements.
Allow tasks to return errors.

Make kore_task_channel_read() return the number of bytes
that was coming in, this way we can detect any truncations.
2014-06-30 14:22:23 +02:00
Joris Vink
56a3cfa6c8 Mention background tasks 2014-06-30 10:11:45 +02:00
Joris Vink
723c99b65e Move kore_pgsql.h into includes/ directly.
Much like kore_tasks.h
2014-06-30 08:42:18 +02:00
Joris Vink
dbd74c4551 Don't call module onloads until after everything is initialized.
This means the onload functions for a module are now called
after a worker has started and never from the parent ever again.
2014-06-29 21:15:23 +02:00
Joris Vink
8ba29104eb Task improvements.
Make sure req is initialized to NULL.
Schedule a task on the event loop only when bound to a request.
2014-06-29 21:14:43 +02:00
Joris Vink
b9bd2e9a14 Move tasks away from http_requests.
Instead if a task is used from inside a request
you MUST call kore_task_bind_request() on it.

This way we can move forward for tasks that
don't belong to page handlers.

Also, some bug fixes for removing http_requests
that are indeed linked to a currently running task.
2014-06-29 20:20:13 +02:00
Joris Vink
146a0189ab More work on the background task implementation.
Tasks are now assigned to available threads instead
of a global task list.

You can now pass messages between your page handler
and the created task using the kore_task_channel_*
functions.

Only one task per time can be assigned to a request
but I feel this is probably a bad design choice.

Preferably we'd want to be able to start tasks
regardless of being in a page handler or not,
this not only ads flexibility but seems like
a better choice overall as it opens a lot more
possibilities about how tasks can be used.
2014-06-29 14:15:40 +02:00
Joris Vink
cf700b34f7 Add initial stab at asynchronous background tasks.
More to follow.
2014-06-28 16:17:18 +02:00
Joris Vink
437f2e9ed2 Be paranoia when it comes to using client supplied integers 2014-05-06 12:24:21 +02:00
Joris Vink
521d4d215e Keep on hackin' Keep on hackin' 2014-04-24 11:18:40 +02:00
Joris Vink
0cb983adc0 Correct snprintf() usage 2014-04-23 16:29:58 +02:00
Joris Vink
27ec8a1d58 Don't let kore_strlcpy() overflow a buffer that is 1 byte long 2014-04-23 14:48:29 +02:00
Joris Vink
f3fe543358 Add integer overflow checks to kore_calloc 2014-04-23 14:26:28 +02:00
Joris Vink
fd7f547013 Fix accesslog under SPDY connections 2014-04-23 13:18:37 +02:00
Joris Vink
2cc6730cba Improve base64 decoding 2014-04-23 12:32:54 +02:00
Joris Vink
4f31d53e76 Allow KORE_RESULT_RETRY from authentication blocks 2014-04-22 23:07:24 +02:00
Joris Vink
332e8f4ba0 Do a better job at base64 decoding stuff 2014-04-22 21:45:26 +02:00
Joris Vink
c14f3031ff Allow us to include config files with "include" 2014-04-22 13:15:19 +02:00
Joris Vink
2bdc9210a0 Wrap with KORE_PEDANTIC_MALLOC 2014-04-22 13:05:16 +02:00
Joris Vink
d98d56fb20 Add KORE_PENDANTIC_MALLOC option.
This option tells Kore to zero out memory when allocated, freed or
when get/put from the pools.
2014-04-22 12:46:23 +02:00
Joris Vink
39dd9d7972 Change kore_buf_appendv() to take a va_list 2014-04-22 12:16:21 +02:00
Joris Vink
d2618db525 Kill __packed__ attributes on some data structs 2014-04-18 17:41:56 +02:00
Joris Vink
109c17fe5d Mention postgresql support (compile with PGSQL=1) 2014-04-17 11:16:37 +02:00
Joris Vink
d6d6f96ca0 Kore pgsql improvements.
Don't wait for a full event loop until we call the page handler
for a received pgsql result. This speeds up page loads using
KORE_PGSQL by quite a lot, especially on a non busy server.
2014-04-17 10:49:48 +02:00
Joris Vink
94de8b27d2 Make sure we call pgsql_load 2014-04-17 09:52:58 +02:00
Joris Vink
c206f3be89 Check if req is NULL before dereferencing it. 2014-04-16 22:15:22 +02:00
Joris Vink
52a0764812 HTTP Post improvements for handlers.
Don't crash if we get a Content-length:0 on POST and our
handlers call http_populate_arguments().
2014-04-15 21:18:23 +02:00
Joris Vink
a35a5182a7 Check connection string right before we connect 2014-04-14 08:45:31 +02:00
Joris Vink
6cabe00740 Make the pgsql connstring programmatically configurable 2014-04-14 08:41:41 +02:00
Joris Vink
4b7a458de6 If kore_pgsql_query() fails, relay this properly 2014-04-13 23:43:54 +02:00
Joris Vink
3f7e7e696e Kill daemon deprication warning on osx. We get it. 2014-04-12 18:49:32 +02:00
Joris Vink
8e88ac41ff Ignore DSYM on osx 2014-04-12 18:49:32 +02:00
Joris Vink
1c685cce90 Comment on why/how we're disabling freelists.
OpenBSD was clever enough to throw these out so no need to
munge the freelist stuff there anymore.
2014-04-11 08:46:50 +02:00
Joris Vink
95819d2dc2 Take away SSL_MODE_RELEASE_BUFFERS for now.
Prevents the weird freelist munging that happens when we're
actually freeing memory (which we should be forcing it to do
by setting freelist_max_len to 0).
2014-04-10 22:52:23 +02:00
Joris Vink
5e2fb37c53 Add *.module to gitignore 2014-04-09 19:14:24 +02:00
Joris Vink
41d1456cb8 Don't leak version on error 2014-04-09 14:45:51 +02:00
Joris Vink
76383f2353 Close fp after reading configuration 2014-04-09 14:43:23 +02:00
Joris Vink
250a1e1ad1 Fix use after free 2014-04-09 14:35:14 +02:00
Joris Vink
630d8ece05 Fuck it, force OpenSSL to not use its freelists no matter what. 2014-04-09 14:14:09 +02:00
Joris Vink
41aed45e4f Do not miscalculate end_headers. 2014-04-09 09:21:22 +02:00
Joris Vink
8e93dbc396 amend example with additional query + kore_pgsql_logerror() 2014-04-02 23:01:47 +02:00
Joris Vink
71b69f108e Fixup the actual example 2014-04-01 21:44:32 +02:00
Joris Vink
39a9f7d6f0 Add new wrappers 2014-04-01 21:44:22 +02:00
Joris Vink
9e3d19fbbd pgsql fixes + new wrappers 2014-04-01 21:43:52 +02:00
Joris Vink
b19897b578 add cert/ 2014-04-02 00:07:52 +02:00
Joris Vink
6195bf646c Change path to reflect new contrib folder 2014-04-02 00:06:35 +02:00
Joris Vink
89b603c247 Support postgresl under the bsds 2014-04-02 00:06:24 +02:00
Joris Vink
211f82847e Add example pgsql module showing how one can use the KORE_PGSQL stuff 2014-03-31 11:30:21 +02:00