Commit Graph

1494 Commits

Author SHA1 Message Date
Joris Vink 66305e551a sig_recv is extern'd in kore.h 2019-02-11 14:01:25 +01:00
Joris Vink 8a8b08f1e6 use %u when logging worker_rlimit_nofiles 2019-02-11 14:00:28 +01:00
Joris Vink 429159ee3c reprime idle timer if SSL_accept() fails.
reported by Daniel Chavez (@dacechavez)
2019-02-08 15:40:00 +01:00
Joris Vink 8040103458 fix for multiple consumers for the async queues. 2019-01-22 11:23:59 +01:00
Joris Vink 39467847fb remove SSL_get_verify_result() check.
If peer verification is turned on this becomes part of the handshake
process anyway and SSL_accept() will fail when appropriate.
2019-01-21 10:36:50 +01:00
Joris Vink 3f083d6126 deal with crls being expired / not-yet-valid.
if a crl is expired or not-yet-valid SSL_get_verify_result()
will return these errors too so check for them explicitly
instead of depending on X509_V_OK.

found by @dacechavez
2019-01-19 11:49:54 +01:00
Joris Vink d1e87c1a54 deal with PyObject_CallObject() returning NULL. 2019-01-15 10:20:13 +01:00
Joris Vink d6b05bcff7 always force reload cert so we get a new x509 store.
Otherwise older OpenSSL or current LibreSSL will fail to add the new
CRL as they still match on subject name rather then hash of the CRL data.
2019-01-14 20:57:40 +01:00
Joris Vink 73cdbd1a01 Let CRLs be reloadable via keymgr.
With these changes CRLs can be reloaded like certificates
by sending a SIGUSR1 to the parent process.

Track mtime on both certificate files and CRL files as well
and only submit them to the workers if this has changed.
2019-01-14 11:41:50 +01:00
Joris Vink c070e77ea5 include signal.h from kore.h 2019-01-11 11:32:33 +01:00
Joris Vink b07cc0237c Support recvfrom()/sendto() on kore python sockets. 2019-01-08 17:49:00 +01:00
Joris Vink 7aa17df4a1 make ACCESSLOG_* unsigned 2018-12-22 10:52:57 +01:00
Joris Vink 4d184e00de correct define number 2018-12-22 10:22:59 +01:00
Joris Vink a868ff2b25 wrap accesslog calls in !KORE_NO_HTTP. 2018-12-22 09:41:55 +01:00
Joris Vink 9aa0e95643 Rework accesslog handling.
Move away from the parent constantly hitting the disk for every
accesslog the workers are sending.

The workers will now write their own accesslogs to shared
memory before the parent will pick those up. The parent
will flush them to disk once every second or if they grow
larger then 1MB.

This removes the heavy penalty for having access logs
turned on when you are dealing with a large volume
of requests.
2018-12-22 09:25:00 +01:00
Joris Vink 0d6a188b01 close fd if we're a directory in filemap. 2018-12-17 16:22:36 +01:00
Joris Vink 61b385ae11 do not set CONN_CLOSE_EMPTY for 1.0 until we reply. 2018-11-30 22:12:43 +01:00
Joris Vink cf2e158773 3.2.0 2018-11-30 21:36:00 +01:00
Joris Vink 4f1acf7060 more intmax_t 2018-11-29 21:25:20 +01:00
Joris Vink 400521073c better format string 2018-11-29 21:24:08 +01:00
Joris Vink e97396366c don't go examples clean 2018-11-29 21:18:15 +01:00
Joris Vink 418c08166a use releng things 2018-11-29 21:13:43 +01:00
Joris Vink af45936447 add releng-build-examples target for myself 2018-11-29 21:13:34 +01:00
Joris Vink ed7b1019fc add /usr/local/include 2018-11-29 21:13:19 +01:00
Joris Vink fe52e3f4e0 update comment 2018-11-29 21:04:49 +01:00
Joris Vink 59ce048ce3 add a Makefile to build all examples. 2018-11-29 21:04:14 +01:00
Joris Vink ccaab50410 add /usr/local/lib to tasks example. 2018-11-29 21:03:22 +01:00
Joris Vink 5da99c8860 make sse example great again 2018-11-29 21:01:08 +01:00
Joris Vink b163d849a6 remove ktunnel example, its too old. 2018-11-29 20:45:26 +01:00
Joris Vink 91f420d94a people keep subbing to non-mailing-list mails. 2018-11-29 15:52:40 +01:00
Joris Vink 272d659f1c we use certain things from sys/param.h 2018-11-29 10:31:14 +01:00
Joris Vink ce3b60b8c8 keep a reference around for tracer. 2018-11-29 09:53:26 +01:00
Joris Vink d9f543ef5b Allow user-supplied tracer callback. 2018-11-29 09:51:24 +01:00
Joris Vink b400fdcd9f include sys/param.h in python.c 2018-11-29 09:11:31 +01:00
Joris Vink fd1ab5879d KODEV_OUTPUT tells kodev the outdir of the binary.
eg:

$ env KODEV_OUTPUT=/tmp kodev build

will place the resulting binary under /tmp/<binary>
2018-11-28 14:24:42 +01:00
Joris Vink 8dd075e71c style 2018-11-28 14:22:27 +01:00
Joris Vink e3efeb9465 Move assets.h into object_dir. 2018-11-28 14:19:32 +01:00
Joris Vink 34829d8592 Add OPENSSL_PATH environment variable. 2018-11-28 13:54:38 +01:00
Joris Vink c431c2bf72 Add support to obtain peer certificate from Python
This will return the DER encoded bytes representing the peer certificate.
2018-11-28 11:28:07 +01:00
Joris Vink 6d78ae04b4 Add async socket example. 2018-11-23 22:34:09 +01:00
Joris Vink a030a6fd38 update README 2018-11-22 15:24:08 +01:00
Joris Vink c74c1f781d Add python-async example. 2018-11-22 15:23:44 +01:00
Joris Vink 8b1a5add4b update 2018-11-22 13:05:02 +01:00
Joris Vink 2d8874dd2a change accept threshold default to 16. 2018-11-16 11:37:09 +01:00
Joris Vink 4e70636269 Reduce accept lock accept lockout time to 100ms. 2018-11-16 11:35:53 +01:00
Joris Vink 5c8efde841 allow foo.method symbols in python.
this way you can create page handlers that reside inside
of other objects.

eg:

static / restapi.index
2018-11-16 11:07:21 +01:00
Joris Vink baafa4897e Add -q flag.
If specified Kore will run quietly and only log important messages.
2018-11-15 16:01:37 +01:00
Joris Vink cb482d8e8f Always use http_response_stream() in req.response.
Keep around the python bytes object while we stream the contents
of it out over the wire. This avoids an entire copy of the data.
2018-11-14 10:03:32 +01:00
Joris Vink 966eaf8f7a Add a kore_python_preinit() hook.
This is called before the python initialization is completed
and allows developers to inject their own built-in methods.
2018-11-12 09:01:05 +01:00
Joris Vink 3925ba60ad don't call close() no underlying socket. 2018-11-12 09:00:36 +01:00