Commit Graph

381 Commits

Author SHA1 Message Date
Joris Vink
8b20dec081 Add missing pg_config.h header 2014-07-04 09:03:19 +02:00
Joris Vink
8e0ab8cc61 Check for pg version >= 90200 before using PGRES_SINGLE_TUPLE 2014-07-03 22:58:04 +02:00
Joris Vink
b2f31fbcdb remove balsy text 2014-07-03 22:41:56 +02:00
Joris Vink
83b7d64bc0 consistency 2014-07-03 22:40:55 +02:00
Joris Vink
5869f765b0 Update with more instructions 2014-07-03 22:40:12 +02:00
Joris Vink
d4386195da Bring back pgsql_test.c 2014-07-03 22:40:03 +02:00
Joris Vink
beee96cb03 Correct headers now that they are installed
While here, kill some MEDIA things for libs that
don't need it and such and such.
2014-07-03 22:39:32 +02:00
Joris Vink
b6a778a4a5 Install kore headers under /usr/local/include/kore 2014-07-03 22:39:16 +02:00
Joris Vink
d5cd89c544 s/kore_pgsql/pgsql and s/kore_tasks/tasks 2014-07-03 22:15:11 +02:00
Joris Vink
2c6b5e6b0f Normalize kore_*.h headers 2014-07-03 22:14:46 +02:00
Joris Vink
4f126f51d3 Add install/uninstall targets. 2014-07-03 21:38:16 +02:00
Joris Vink
00a180c445 Correct return value check for kore_task_channel_read().
The data we're using are not NUL-terminated strings.
2014-07-03 20:21:05 +02:00
Joris Vink
2bf43fe5f8 Unfuck boundary snprintf check, broke multipart forms 2014-07-03 20:10:55 +02:00
Joris Vink
be4b1c7e7b Move actual code out of contrib into src/. 2014-07-02 12:19:38 +02:00
Joris Vink
5090ebea20 Move contrib/modules to contrib/examples 2014-07-02 12:16:31 +02:00
Joris Vink
2821eccdfa Move tools to contrib/tools 2014-06-30 23:19:16 +02:00
Joris Vink
fe7ca9779f Add task example using libcurl. 2014-06-30 22:35:36 +02:00
Joris Vink
a54d04eb8a Add task glue for BSD as well 2014-06-30 14:43:34 +02:00
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