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

1424 Commits

Author SHA1 Message Date
Joris Vink
cd80685d9d get rid of pyko 2019-03-21 21:37:16 +01:00
Joris Vink
b9a714de65 remove pyko 2019-03-21 21:35:24 +01:00
Joris Vink
58c2739dee If fd is -1 in pysock_op_iternext just return None.
None in pysock signals EOF and if it was closed under our feet we should
relay that properly.
2019-03-21 14:44:41 +01:00
Joris Vink
370041656e Get rid of WORKER_LOCK_TIMEOUT.
Instead let the workers send a message on the msg channel to each
other when they have given up the accept lock and it is now available
to be grabbed.
2019-03-21 14:03:11 +01:00
Joris Vink
8b0279879a rework timers so they fire more predictably.
this change also stops python coroutines from waking up very
late after their timeout has expired.

in filerefs, don't prime the timer until we actually have something
to expire, and kill the timer when the last ref drops.
2019-03-21 10:17:08 +01:00
Joris Vink
ce012e7bd5 set fd to -1 on close. 2019-03-21 10:09:24 +01:00
Joris Vink
d371454dad do not grab the result if it was in a gatherop 2019-03-19 13:58:00 +01:00
Joris Vink
8afaac9fde log pid number of worker upon start. 2019-03-19 13:42:22 +01:00
Joris Vink
681a88d535 simplify af_unix recvfrom/sendto support. 2019-03-19 13:27:50 +01:00
Erik Karlsson
d60994abb5 add python sendto recvfrom abstract socket support 2019-03-19 11:11:44 +01:00
Joris Vink
9caa45a050 Allow python validator methods to be async. 2019-03-18 09:34:31 +01:00
Joris Vink
c3ab570f56 Append full module path if it is a directory. 2019-03-16 16:13:52 +01:00
Joris Vink
31b6365da3 include sys/types.h explictly. 2019-03-14 19:20:46 +01:00
Joris Vink
ec7c8b8e1d fix a few minor problems with pylock.
- when pylocks are deallocated we ended up deleting the wrong object.
- do not call Py_DECREF on the op when inside the op its iternext call.
2019-03-14 17:31:57 +01:00
Joris Vink
2217c7a2c8 pysock: call disable read/write only when needed 2019-03-14 09:27:13 +01:00
Joris Vink
d41054bd26 remove the socket from the event queue on dealloc. 2019-03-13 16:01:42 +01:00
Joris Vink
b06160c768 Make sure coros are woken up on eof. 2019-03-13 15:45:55 +01:00
Joris Vink
3b4574d791 Rework pysocket async/await.
Attach the events directly to the pysocket data structure instead of
one event per pysocket_op.

Makes the code easier, gives us a good performance boost and reduces
the number of system calls required when doing an await on a socket.
2019-03-13 11:07:15 +01:00
Joris Vink
01f9b4fcde Check for EAGAIN when calling connect(2).
Linux does this under certain conditions.
2019-03-12 20:04:08 +01:00
Joris Vink
eb9b7f7b14 explicitly include sys/types.h
some smaller libc variants do not include this from sys/param.h.
2019-03-06 09:29:46 +01:00
Joris Vink
61863bfd3a kill recv() timer if we have data.
also reset any exception that is set when we have successfully
read data from a socket.
2019-03-04 16:37:25 +01:00
Joris Vink
a0c203f507 remove norwegian debug 2019-03-01 20:57:31 +01:00
Joris Vink
31a9a70d5a cleanup. 2019-03-01 20:56:03 +01:00
Erik Karlsson
01c1a8f8f8 support AF_UNIX in recvfrom()/sendto() python sockets 2019-03-01 20:13:28 +01:00
Joris Vink
2057f4db58 sprinkle more kore_quiet around 2019-02-27 19:59:31 +01:00
Joris Vink
1ebd82969c Add timeout support to proc.recv() 2019-02-26 15:22:55 +01:00
Joris Vink
f4cd70956b Add an optional timeout to socketop.recv(). 2019-02-25 10:35:00 +01:00
Joris Vink
1e7ccc2adf remove stale python example. 2019-02-25 10:00:59 +01:00
Joris Vink
bf1e8e5ffb bump copyright to 2019 2019-02-22 16:57:28 +01:00
Joris Vink
3dbb80463a allow double quotes in kore.proc argument lists. 2019-02-22 16:56:34 +01:00
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