Commit Graph

1020 Commits

Author SHA1 Message Date
Joris Vink 0250c8ecba style 2017-02-01 21:20:43 +01:00
Joris Vink 261fb3c3fa flesh out python example a bit more. 2017-02-01 17:15:18 +01:00
Joris Vink 3d8e0dabc0 expose kore_server_bind() and fatal() to python 2017-02-01 17:12:52 +01:00
Joris Vink 0c0a9371bd Change kore_preload() and kore_onload().
Renamed both of them:
	kore_preload -> kore_parent_configure
	kore_onload  -> kore_worker_configure

These functions will now always be called if they are defined in any module
regardless of your application being built as a single binary or not.
2017-02-01 17:12:11 +01:00
Joris Vink 8629419253 the example uses tls by default, so use it. 2017-01-31 09:21:06 +01:00
Joris Vink bb9dbbec12 typo. 2017-01-30 22:47:41 +01:00
Joris Vink 6e7de9ab93 update python ws example. 2017-01-30 22:40:59 +01:00
Joris Vink 006f764d96 when getting OP_CLOSE disable reads. 2017-01-30 22:35:34 +01:00
Joris Vink 587a663f31 reorder ws disconnect order a bit. 2017-01-30 22:25:08 +01:00
Joris Vink 8b26ecdf14 more websocket improvements.
- send a CLOSE opcode if we haven't yet when removing a ws client.
- ignore unsolicited PONG.
2017-01-30 22:21:57 +01:00
Joris Vink d5a32c2dab use the correct opcode for PONG.
djees i can't hex.
2017-01-30 22:17:47 +01:00
Joris Vink 30666618f8 expose kore_websocket_send() to python. 2017-01-30 22:00:03 +01:00
Joris Vink e4d87b72a0 websocket improvements.
- properly send a CLOSE control frame back if the client sent us one.
- make sure we can send messages that are exactly USHRT_MAX bytes long.
2017-01-30 21:52:22 +01:00
Joris Vink 6bfba49ba5 cleanup data if required. 2017-01-30 21:50:36 +01:00
Joris Vink f78e8f2fd2 allow None as source for kore.websocket_broadcast.
This allows kore.websocket_broadcast() to be used to relay the
messages back to all clients rather then all except the sender.
2017-01-30 21:48:58 +01:00
Joris Vink 6a43dd529c export WEBSOCKET_OP_TEXT and WEBSOCKET_OP_BINARY. 2017-01-30 21:02:58 +01:00
Joris Vink 3d3d705b98 flesh out the python stuff a bit more. 2017-01-30 20:47:24 +01:00
Joris Vink 7bc8bb42e2 implement kore_websockat_broadcast. 2017-01-30 20:30:42 +01:00
Joris Vink 5485967547 add websocket example to python 2017-01-29 22:57:55 +01:00
Joris Vink 7510834968 initial fudging to add websockets to python 2017-01-29 22:57:34 +01:00
Joris Vink 1ecb777d41 only remove the pgsql if it was scheduled.
fixes #172.
2017-01-29 10:34:53 +01:00
Joris Vink 829066dc23 i can't port. 2017-01-26 22:02:11 +01:00
Joris Vink 4940f97079 remove stuff that is not ready yet and add README. 2017-01-26 22:01:23 +01:00
Joris Vink c06ecf1c70 Teach single binaries about SIGHUP.
Make sure kore_onload() and kore_preload() can be called
either in native or python runtime.
2017-01-26 13:26:55 +01:00
Joris Vink 3023ca0e57 Allow single binaries to load modules again. 2017-01-26 13:13:23 +01:00
Joris Vink dcb5fd842f Expose get/post params via req.argument for python. 2017-01-26 12:01:28 +01:00
Joris Vink 1db3cd96d8 allow reloading of python modules on SIGHUP. 2017-01-26 11:13:09 +01:00
Joris Vink 2c66dfa3cf add python_import to example config 2017-01-25 22:43:59 +01:00
Joris Vink da13e1e768 undef _POSIX_C_SOURCE and _XOPEN_SOURCE before Python.h 2017-01-25 22:41:57 +01:00
Joris Vink ef441fb9a1 bah, be gone. 2017-01-25 22:38:43 +01:00
Joris Vink ff48aed926 initial python example.
don't look too much into this yet.
2017-01-25 22:38:06 +01:00
Joris Vink 21f9c29f31 style + move pyhttp_dealloc() into !KORE_NO_HTTP. 2017-01-25 22:33:39 +01:00
Joris Vink f56938283d Merge branch 'master' of github.com:jorisvink/kore 2017-01-25 22:23:34 +01:00
Joris Vink 38df26f59c add first mentions of python support to README. 2017-01-25 22:22:05 +01:00
Joris Vink 5d09214591 only rebuild with "kore build" when we can. 2017-01-25 22:21:40 +01:00
Joris Vink a9537bc6ec add python flavor string to -v 2017-01-25 22:21:30 +01:00
Joris Vink 9976022a47 let python use kore backed memory allocators. 2017-01-25 22:07:58 +01:00
Joris Vink e47806c669 allow memory allocators to deal with 0 bytes.
we just increase the lenght requested to 8 bytes if we get a 0 byte request.

additionally when kore_realloc() is called check if we actually have
to do the work, if not just return the original pointer.
2017-01-25 22:07:08 +01:00
Joris Vink 620cc231dc validators now work in python. 2017-01-25 21:17:12 +01:00
Joris Vink 7c74a0824b push all integers exported to python in a struct. 2017-01-25 20:56:57 +01:00
Joris Vink bbcdec82fc Add initial python support.
Based on work done by Stanislav Yudin.
2017-01-24 20:18:12 +01:00
Yorick de Wid f7e8954609 BSD required AF_INET* headers (#171) 2017-01-18 22:24:49 +01:00
Joris Vink 98148155dc bump copyright year 2017-01-18 10:27:44 +01:00
Joris Vink a572cdbfa6 update copyright year 2017-01-18 10:27:40 +01:00
Joris Vink 2f8c173042 Improve ipv6 host parsing if we get a literal.
Fixes #169.
2017-01-18 10:27:04 +01:00
Yorick de Wid 86d85dd10b Message shutdown request (#168)
* Set server version

* Message shutdown request

* Update messaging example

* Set server verion in generic example

* Allow shutdown with NOHTTP=1
2017-01-17 18:18:01 +01:00
Yorick de Wid 565bf5bdec Set server version (#157) 2017-01-13 13:03:47 +01:00
Joris Vink 57840a8366 Deal with the Host header in a way IPv6 hosts work
Fixes #164.
2017-01-11 11:01:58 +01:00
Joris Vink 10929189a0 make sure we can call pgsql_conn_cleanup() properly. 2017-01-10 15:29:03 +01:00
Manuel Kniep ec5e93010f add missing includes (#163)
to make includes order independent
2017-01-07 23:07:34 +01:00