Commit Graph

584 Commits

Author SHA1 Message Date
Joris Vink 443b1c8c5f format 2013-06-04 16:33:35 +02:00
Joris Vink e7db5ee6b1 rename kore_log to kore_debug, and allow one to turn it off. 2013-06-04 16:30:53 +02:00
Joris Vink 11fca19923 be less spammy 2013-06-04 16:17:42 +02:00
Joris Vink ab0dc25c61 use sched_setaffinity() to set what CPU each worker process should run on. 2013-06-04 13:54:16 +02:00
Joris Vink 8f8ab92521 upon quit time, workers will not accept new connections but will
handle all outstanding http requests.
2013-06-04 13:43:11 +02:00
Joris Vink 0de28488a6 move from multithreads to single threaded worker processes. 2013-06-04 11:55:38 +02:00
Joris Vink ae0a8ece75 update 2013-06-04 08:52:30 +02:00
Joris Vink b65cc93426 allow handlers to return KORE_RESULT_RETRY. This will tell the worker to reschedule the page request again at the end of its list. (Allows module creators to write truely nonblocking modules). 2013-05-31 00:40:06 +02:00
Joris Vink 7dfa7e6ec0 be carefull when we reload the module to not reload it when workers are inside the module callbacks.
do this by implementing a pthread rwlock, and locking it for reading when going into a callback and locking it for writing when we need to reload the mod.
2013-05-31 00:06:54 +02:00
Joris Vink fecbd058cb rework the worker thread so there's actually time to schedule more then one request at a time on them. 2013-05-31 14:24:00 +02:00
Joris Vink e428886e16 decrement the worker load on HTTP_REQUEST_DELETE 2013-05-31 13:30:51 +02:00
Joris Vink 966ba3352e missing profile.html 2013-05-30 23:16:00 +02:00
Joris Vink bb4001d119 ok that was wrong, disconnect http clients whne we're done sending or upon error, not immediately after queueing everything. 2013-05-30 21:57:14 +02:00
Joris Vink ca1c884e43 attempt to clear out send buffer before we shutdown ssl connection.
remove superfleaous debug
2013-05-30 21:39:01 +02:00
Joris Vink 791aba1e82 specify example of onload 2013-05-30 21:27:13 +02:00
Joris Vink cf6a6550f0 allow onload to be given in the config file.
onload specifies what function in your module to call when the module has been loaded or reloaded.
2013-05-30 21:26:39 +02:00
Joris Vink ec5ac40706 wake up the workers once in a while to process anything that is waiting. 2013-05-30 20:55:50 +02:00
Joris Vink f9b3cfcee4 reschedule events if we cannot lock the connection at the time being. 2013-05-30 20:38:25 +02:00
Joris Vink 9ad263e287 do not remove disconnected connections until we actually are ready to disconnect them. 2013-05-30 20:07:06 +02:00
Joris Vink 9243f409cc move to a worker based threading approach where we delegate http requests to workers in a round robin basis (later this should be swapped to find the laziest worker and assign the request to that instead). 2013-05-30 19:36:42 +02:00
Joris Vink 8478d8df54 add chroot and runas directives so we can chroot and drop privilegs properly 2013-05-04 22:18:27 +02:00
Joris Vink 3b30920a60 for now, until we properly handle a persistent HTTP connection for non spdy clients make sure we close the connection after handling the HTTP request. 2013-05-04 21:03:53 +02:00
Joris Vink ce729010f7 - simplify header building using kore_buf_appendf() for normal HTTP requests.
- make sure we dont free nb->buf if its NULL. (semantics).
- remove some superfluffy debug.
- make sure we call [inflate|deflate]End when we dc a client that used zlib.
2013-05-04 20:44:16 +02:00
Joris Vink 45adae62f7 q->value should be set to NULL if a query parameter is present but no value was set for it.
introduce kore_buf_appendv() (much like readv()).
introduce kore_buf_appendf() (printf into buffers).
2013-05-04 19:09:07 +02:00
Joris Vink 61b937ac1b remove unused vars 2013-05-04 16:38:40 +02:00
Joris Vink 8d67ee4c52 add dynamic handler example to our base module 2013-05-29 14:42:40 +02:00
Joris Vink 088d877715 switch dynamic handlers to regex based patterns, much easier. 2013-05-29 14:29:46 +02:00
Joris Vink 2290d09d3b Add dynamic handles, which can be used to partially match a URI and still call a cb handler. This is especially usefull when considering the handlers as a ruleset:
static /	serve_index
static /foo	serve_foo
dynamic /	serve_other

/ will be matched to serve_index, while /foo will be matched to serve_foo and /bar will be matched to serve_other for example.
2013-05-29 13:33:32 +02:00
Joris Vink 697ff6d980 Merge remote branch 'origin/master' 2013-05-29 12:27:53 +02:00
Joris Vink 0be748ee0f use SSL_CTX_use_certificate_chain_file instead when loading certificates so we can properly use our intermediate authority. 2013-05-29 12:27:30 +02:00
Joris Vink 1671698f58 increase sbuf length substantially 2013-05-22 12:50:20 +02:00
Joris Vink 65065b4652 zero out tstamp 2013-05-04 14:14:50 +02:00
Joris Vink a88b8de6a2 add proper query argument parsing, modules must call
http_populate_arguments() before using http_argument_lookup() to lookup a given argument.

population uses the appropriate query string (from GET or POST) automatically.
2013-05-03 09:09:27 +02:00
Joris Vink b3cdccbc87 add http_post_data_text() which returns the post data NUL-terminated to the caller. 2013-05-03 07:49:40 +02:00
Joris Vink 85aad24af5 do not NUL terminate the post data, for later. 2013-05-03 07:43:53 +02:00
Joris Vink 2401bd1a9f support for POST in both spdy and normal connections 2013-05-03 07:35:11 +02:00
Joris Vink f34831c6cb update README just a tiny bit. 2013-05-17 08:46:45 +02:00
Joris Vink 879b5716d1 req->method is no longer a string, adapt kore_log() 2013-05-03 01:21:09 +02:00
Joris Vink 90588913d4 allow sending SIGHUP to kore, which will then reload its content module 2013-05-03 00:04:06 +02:00
Joris Vink ba2ed8d954 host header might not come in second.. 2013-05-02 22:35:29 +02:00
Joris Vink e7feaaba76 properly close a spdy stream once both sides have FLAG_FIN. 2013-05-02 17:30:06 +02:00
Joris Vink 4ed4f76e44 allow POST to work with spdy, all POST data is stored in the httpreq->post_data field. (as a kore_buf) 2013-05-02 17:14:07 +02:00
Joris Vink f61bbe8ff4 move buf stuff back into kore.h, wont need it separately 2013-05-02 15:14:00 +02:00
Joris Vink a025f0fa8e save the http request for spdy later on 2013-05-02 15:06:26 +02:00
Joris Vink 4fb8a13f1b mmmm 2013-05-02 15:00:03 +02:00
Joris Vink 84428f7133 move buf stuff into its own header, so we can use it in spdy.h 2013-05-02 14:55:57 +02:00
Joris Vink 60ed3e0fd2 the net qeueuing functions don't need to return status codes, simplifies a lot of other code that revolves around those.
prepare for POST support
2013-05-02 14:47:02 +02:00
Joris Vink 07f2f83def make sure we do not dereference p if its NULL 2013-05-02 13:47:53 +02:00
Joris Vink 807764614b from now on configuration files must specify a domain for the handlers that follow. This allows for easy subdomain configuration.
example:

domain joris.local
static / serve_index

domain .joris.local
static / serve_another_index
2013-05-02 13:30:13 +02:00
Joris Vink 53cbc1a21e make sure we advance the host buffer properly 2013-05-02 12:11:56 +02:00