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

32 Commits

Author SHA1 Message Date
Joris Vink
3b09683f5c Add kore_pgsql_query_params().
This function uses PQsendQueryParams() instead of the normal PQsendQuery()
allowing you to pass binary data in a cleaner fashion.

A basic call would look something like:

char *mydata = "Hello";
size_t mydata_len = strlen(mydata);

kore_pgsql_query_params(&pgsql, req,
    "INSERT INTO foo VALUES($1::text)", KORE_PGSQL_FORMAT_TEXT, 1
    mydata, mydata_len, KORE_PGSQL_FORMAT_TEXT);

kore_pgsql_query_params() is variadic, allowing you to pass any
count of parameters where each parameter has the following:
	data pointer, data length, type of parameter.
2014-09-28 21:39:16 +02:00
Joris Vink
e3417dea16 Remove the pgsql simple layer again.
I rather keep the old idioms instead of adding more complex things
on top of the async ones. Especially since the simple layer would
interfear with existing http state machines from your handler.
2014-09-19 15:53:22 +02:00
Joris Vink
eef40bf2dd add a .gitignore here 2014-09-19 14:51:14 +02:00
Joris Vink
c4c60e1960 Oops, make sure the new simple api can handle > 1 request without borking. 2014-09-19 14:49:12 +02:00
Joris Vink
8e9c3da764 Add a new "simple query" layer to our pgsql api.
This simple query allows you to ditch rolling your own
state machine for handling async pgsql states and instead
asks you to provide 3 functions:
	- init
	- results
	- done

You can see the different in complexity in the pgsql example,
which now contains a pgsql_simple.c holding the same asynchronous
query as in pgsql.c but using the simple pgsql api.

You can of course still roll your own in case you want more control.
2014-09-19 12:32:49 +02:00
Joris Vink
0e11edefb5 s/HTTP_STATUS_RETRY/HTTP_STATE_RETRY 2014-09-19 11:16:56 +02:00
Joris Vink
8982a7b3c9 Disable timeouts for ktunnel 2014-09-18 10:30:59 +02:00
Joris Vink
34d146fc01 Fix ktunnel compilation under BSDs 2014-09-18 09:52:48 +02:00
Joris Vink
c5f00d3443 Add KTunnel example, an anything-over-HTTPS tunnel using Kore. 2014-09-17 08:53:13 +02:00
Joris Vink
6e6b042388 Add KORE_PGSQL_STATE_WAIT to our example 2014-08-15 12:39:31 +02:00
Joris Vink
8565b47800 Attach tasks/pgsqls to http_requests once more.
This way if an http request is removed while tasks or
pgsqls are still active they are free'd out and cancelled
properly.
2014-08-14 22:05:34 +02:00
Joris Vink
0b3c918ba6 Properly check for connection trouble in the pgsql example 2014-08-14 15:13:47 +02:00
Joris Vink
f93747828c Major pgsql rework.
Gone is the ugly KORE_PGSQL macro that hid an overly complex
state machine for the pgsql api.
Gone is the pgsql array that was attached to http_requests.
Gone are the callback hacks inside the pgsql api.

Instead, I strongly encourage people to use the new state machine
api Kore offers to properly deal with asynchronous queries.

The pgsql example in examples/pgsql has been updated to reflect
these changes.
2014-08-14 14:34:23 +02:00
Joris Vink
e0cdc31c73 Take away the reference to the video if we're not streaming 2014-08-12 09:43:19 +02:00
Joris Vink
7349fab13f Sprinkle kore_snprintf() where appropriate. 2014-08-11 11:02:30 +02:00
Joris Vink
70d9df8896 s/id/user 2014-08-11 11:01:59 +02:00
Joris Vink
1616320490 Add an html5 video streaming example 2014-08-10 19:33:43 +02:00
Joris Vink
966ed3d20d Rename the two functions used to read/set headers.
Rename http_request_header_get() to http_request_header().
Rename http_response_header_add() to http_response_header().
2014-08-05 14:26:31 +02:00
Joris Vink
b27322933b The default pid file is kore.pid so no need to set that explicitely 2014-08-05 13:11:53 +02:00
Joris Vink
577462379d Deprecate ssl_no_compression config option, its always on. 2014-08-05 13:07:32 +02:00
Joris Vink
79a736fc16 Add a link to yajl repo 2014-08-04 21:06:35 +02:00
Joris Vink
0c5b0d2288 Add an example that parses JSON via yajl 2014-08-04 21:06:02 +02:00
Joris Vink
9dbcf5399f Add headers example 2014-08-04 20:06:59 +02:00
Joris Vink
b3f65ae13f Add a readme to parameters + update some text 2014-08-04 19:02:23 +02:00
Joris Vink
4a7653f195 Add a parameters example.
This example shows how the parameter system in Kore works
and how to use it properly.
2014-08-04 19:00:25 +02:00
Joris Vink
d35bb9837d update comment in example tasks.c 2014-08-03 21:47:19 +02:00
Joris Vink
850e39fcfb Add more READMEs 2014-08-03 21:44:14 +02:00
Joris Vink
5c21a120fc s/hello-world/integers 2014-08-03 20:31:40 +02:00
Joris Vink
8f523ecf0c Alter readme a bit 2014-08-03 20:30:39 +02:00
Joris Vink
9cba130c4b Add integers example 2014-08-03 20:29:24 +02:00
Joris Vink
55b344f1c3 Redo last move, but properly this time 2014-08-03 17:47:29 +02:00
Joris Vink
93fa404470 Move contrib/examples into examples 2014-08-03 17:45:23 +02:00