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

1287 Commits

Author SHA1 Message Date
Joris Vink
ef4289689f Only call module onload if its present 2014-01-11 01:35:44 +01:00
Joris Vink
d22405cea7 Call the onload function whenever a module is loaded/reload.
Allows one to teardown whatever they setup properly when
the module gets a full reload. See example module for how it works.
2013-12-21 13:37:34 +01:00
Joris Vink
ddf23ef65b Remove onload, it's gone 2013-12-17 11:48:53 +01:00
Joris Vink
84d2c7fa0d ULONG_MAX -> LONG_MAX 2013-12-16 18:00:33 +01:00
Joris Vink
21b148e3a5 Allow Kore to load multiple modules at once. 2013-12-15 01:11:56 +01:00
Joris Vink
f2aa206f3b Add support for client certificates 2013-12-14 16:31:07 +01:00
Joris Vink
08a2fff5a5 add params 2013-12-12 08:49:02 +01:00
Joris Vink
0f59c617df Add missing params for param-test 2013-12-12 11:36:45 +01:00
Joris Vink
be48cd56e1 ULONG_MAX -> LLONG_MAX 2013-12-12 01:15:40 +01:00
Joris Vink
f86673b97b Remove some stuff that wasn't suppose to be here 2013-12-12 01:04:35 +01:00
Joris Vink
c7dcdbcd82 Rework the way validation and param extraction works.
- Parameter validation is now done only when http_process_*()
  is called and upon http_argument_add().
- You MUST have defined your params in a param block or they will
  be filtered out.
- http_argument_lookup() is dead, welcome http_argument_get() and
  its brothers and sisters:
	http_argument_get_string()
	http_argument_get_uint16()
	http_argument_get_int16()
	http_argument_get_uint32()
	http_argument_get_int32()

  They will automatically do bounds checking on integers for you
  and return proper integers or a NUL-terminated string.

- The http_argument_get* functions no longer create an additional
  copy of the string which you need to free. Easier going.
- http_multiple_args() is dead, byebye
- Make some stuff we don't want to share with the modules static.
2013-12-12 00:58:32 +01:00
Joris Vink
b4c54f9dc0 indent 2013-12-11 19:13:50 +01:00
Joris Vink
0f28b4a62d Enter versioning, starting at 1.0-current 2013-12-10 16:43:19 +01:00
Joris Vink
f0fc1af940 Fix params example in example module 2013-12-10 08:52:37 +01:00
Joris Vink
fc243835c9 Update last_cb_run after we call cb here as well 2013-12-09 11:42:22 +01:00
Joris Vink
02351e1ab4 Update last_cb_run after we call the cb.
Makes sure we don't fall into cascading calls to the cb
if it takes longer to complete then the interval set.
2013-12-09 11:40:59 +01:00
Joris Vink
10aa4a28fe Multipart forms are now also validated via params 2013-12-05 20:28:07 +01:00
Joris Vink
79aea48757 Don't stop passing the accept lock even when workers are very busy.
If a worker reached worker_max_connections and it was its turn to
grab the accept lock it would've gotten stuck and no new connections
would be handled even if other workers would be less busy.

Instead, we now skip the lock if we're too busy and pass it along
in the hopes other workers are less busy.
2013-11-27 23:02:15 +01:00
Joris Vink
6f311a06cf Do not get stuck processing HTTP requests, found by Thorduri 2013-11-25 14:21:47 +01:00
Joris Vink
97c67f7cfb Update TODO
Remove stuff thats been done or obsolete
2013-11-22 09:35:52 +01:00
Joris Vink
b647afcc4f fix brocken DEBUG define 2013-11-21 12:00:07 +01:00
Joris Vink
d15c60670a Fix building the modules under osx. 2013-11-20 10:34:32 +01:00
Thordur Bjornsson
06abae3967 The access log need not be executable.
While there use the nice defines rather then straight up mode
numbers.
2013-11-19 17:27:14 +01:00
Thordur Bjornsson
cc6a424a82 Introduce tools/
Currently only populated with a script to generate certificates.
2013-11-19 13:30:24 +01:00
Thordur Bjornsson
302c3b6c9d If DEBUG is set in the environment, define KORE_DEBUG 2013-11-19 13:10:01 +01:00
Thordur Bjornsson
f9cac98ab5 Detect OS rather then supplying a build target 2013-11-19 13:10:01 +01:00
Thordur Bjornsson
26a5b920f5 Basic gitignore 2013-11-19 13:10:01 +01:00
Joris Vink
269e5cb007 Strip out port from HTTP host request if its present. 2013-11-18 00:53:08 +01:00
Joris Vink
7287b146ce reset back to normal 2013-11-18 00:48:33 +01:00
Joris Vink
7a58d4555c bring back original settings here 2013-11-18 00:44:46 +01:00
Joris Vink
afeb213260 Kore no longer requires root to be started. 2013-11-18 00:42:57 +01:00
Joris Vink
8a3f49d164 Missing file, noticed by thorduri 2013-11-16 17:44:31 +01:00
Joris Vink
1e250c1473 Kore now supports GET parameters and automatic validation of GET/POST parameters.
Kore will automatically removes invalid parameters as a security measure.

See modules/examples/module.conf for an example of how this works.
2013-11-10 15:17:15 +01:00
Joris Vink
34c2f31a93 Add validators to kore, specified in the configuration using 'validator' keyword.
Example:
	validator	v_id	function	v_id_function
	validator	v_url	regex		^/url/path/[a-z]*$

You can then call these using kore_validator_run(char *, char *), example:

	if (!kore_validator_run("v_url", req->path))
		[req->path is bad];
2013-11-09 16:21:52 +01:00
Joris Vink
c80e1d3767 If there's only a single worker, do not block after accept treshold has been
reached
2013-11-01 22:37:59 +01:00
Joris Vink
2aa4edb04e Kill unused vars 2013-10-26 00:59:03 +02:00
Joris Vink
f17242262b Improve on sending data to the client.
- Attempt to chain as much as we can in the send netbufs
  (keeps down the SSL_write calls, silly seeing it go out with 8 bytes)
- Change NETBUF_SEND_PAYLOAD_MAX to 4K
- Call SSL_write() with max NETBUF_SEND_PAYLOAD_MAX in size
- Go back to flushing the send buffers after each request
- No more need for a fixed pool for nb->buf, go back to the heap for now
- Disable Nagle, we're doing the chaining now anyway
2013-10-26 00:48:09 +02:00
Joris Vink
4247d3139c Chain our sending netbufs together. Gives us a lot less SSL_write() calls. 2013-10-25 14:22:29 +02:00
Joris Vink
4922171d96 Change net_send_queue() in preparation for improving send performance.
No longer takes callbacks, flags, or *out arguments.

Update rest of the code that called these callbacks whenever sending
was completed, instead call them right away now.
2013-10-25 11:10:03 +02:00
Joris Vink
ac025adaa7 Make kore_worker_acceptlock_release() available to loaded modules.
This allows us to move the accept lock manually to another Kore worker
in case we own it and are about to do some heavy lifting on the current
Kore worker.
2013-10-24 09:05:46 +02:00
Joris Vink
e10486fa10 Change urldecode back to 0 2013-10-24 08:56:17 +02:00
Joris Vink
340f4b759c s/==/= 2013-10-23 23:01:14 +02:00
Joris Vink
765214c5dc Update build.sh 2013-10-23 22:58:15 +02:00
Joris Vink
c30ff58b93 control characters have nothing to do inside a URL. 2013-10-18 12:43:20 +02:00
Joris Vink
5d027b7a21 Decode all url encoded components properly. 2013-10-18 12:32:00 +02:00
Joris Vink
ca05fb74d1 Properly calculate GMT time in kore_date_to_time() 2013-10-15 15:06:19 +02:00
Joris Vink
6028a3edc3 Get rid of some bash-ism and do stuff ourselves. 2013-10-15 14:54:02 +02:00
Joris Vink
190315c238 Make inject.c no longer spew warnings, instead use correct widths for time_t on all platforms. 2013-10-15 13:33:35 +02:00
Joris Vink
49df7a313b Make sure d cannot be used uninitialized. 2013-10-15 13:10:30 +02:00
Joris Vink
ee99503323 Fix building example module in OpenBSD. 2013-10-15 13:09:00 +02:00