Commit Graph

713 Commits

Author SHA1 Message Date
Joris Vink d30921103b Code cleanup, several API breaking changes in here 2016-07-08 10:03:41 +02:00
Joris Vink e96ed9ad66 Change default domain for kore create skeleton. 2016-07-07 12:36:08 +02:00
Joris Vink d2c30fd70b for single binaries use progname as the log id. 2016-07-06 22:02:10 +02:00
Joris Vink 9abf15a498 Make kore_onload() to be done per worker.
Mimics the behaviour of dso builds.
2016-07-06 21:59:17 +02:00
Joris Vink 39a5f21986 Allow "kore build" to produce single binaries.
Producing single binaries can now be done with building with
"kore build". To get started edit your build.conf and add the
following directives:

single_binary = yes
kore_source = /path/to/kore

optionally you can add kore_flavor to instruct how kore should
be built:

kore_flavor = NOTLS=1

When doing this your build.conf must also include the correct
linking options as the linking is now done fully by kore build.

The binary produced will include your configuration and takes
over a few of kore its command line flags (such as -f, -n or -r).
2016-07-06 16:16:15 +02:00
Joris Vink 27acc51241 Improve kore_strlcpy().
Make it return the original length of the input string so the caller
can check for truncation. Also guard against len being 0 as this would
not do anything with the destination string (not even NUL terminate it).
2016-07-04 11:41:37 +02:00
Joris Vink 589c7667be Cleanup cli.c a bit.
- Define CXXFLAGS_MAX as CFLAGS_MAX as we use CFLAGS_MAX usually.
- Fix formatting of a few blocks of code.
2016-06-29 16:25:52 +02:00
Corbin Hughes 91d29a9914 Better name consistency and only print CXXFLAGS if compiling C++ 2016-06-27 22:33:51 -05:00
Corbin Hughes 698b3f374f Compile and link C++ with g++ instead of gcc 2016-06-26 15:49:59 -05:00
Joris Vink 8d92dd2af4 Allow building against libressl again. 2016-06-26 11:36:33 +02:00
Joris Vink 43a726c02d Use sys/types.h instead of sys/param.h for assets. 2016-06-23 16:18:36 +02:00
Joris Vink 89f81a8b5a Revert "Throw a handshake failure if we cannot find the given SNI hostname."
This reverts commit afd4182975.
2016-06-09 13:52:37 +02:00
Joris Vink afd4182975 Throw a handshake failure if we cannot find the given SNI hostname. 2016-06-08 16:46:28 +02:00
Joris Vink f62430d1fa Isolate ECDSA keys in keymgr as well. 2016-06-08 16:31:14 +02:00
Joris Vink ae31ec01ac Separate private keys from worker processes.
Kore will now isolate RSA private keys to a separate process (keymgr).

Worker processes that require RSA signing for TLS connections will
communicate with this keymgr process in order to do so.

This behaviour cannot be disabled and is always turned on.
2016-06-08 13:56:38 +02:00
Raphaël Monrouzeau 159de3960d Added new function kore_pgsql_v_query_params().
Same as kore_pgsql_query_params but takes a va_list as last parameter
(non-v version takes a variable list of parameters).

Lets people write easier to call wrappers around the query calls. I use
it in a wrapper that takes next states (error, current, continue) as
arguments in a handler with multiple async queries.
2016-06-07 13:12:31 +02:00
Joris Vink 2dfd22a79a Change kore_buf_stringify() a bit.
Takes a size_t pointer as its second argument now, if not
NULL this will be populated with the length of the string
that is being returned.
2016-06-02 07:08:19 +02:00
Joris Vink 3b43df5536 remove useless cast. 2016-05-16 09:45:27 +02:00
Joris Vink 3c9d2d5948 missing va_end() in kore_pgsql_query_params().
from @fahlgren.
2016-05-16 09:25:37 +02:00
Joris Vink 5fe9512828 spacing. 2016-05-05 15:29:43 +02:00
Joris Vink be28c77c6d Merge pull request #118 from wtfuzz/master
cast difference between pointers as unsigned in kore_mem_find()
2016-05-05 15:28:59 +02:00
Elliot Schlegelmilch d37ecf9649 If we're iterating over rlimits, we should use rlim_t.
> error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'rlim_t' (aka 'long') [-Werror,-Wsign-compare]
2016-04-27 18:18:21 -07:00
Matt Thompson 43d3e0e746 double tab variable name 2016-04-01 17:55:43 +00:00
Matt Thompson 43a5703456 changed needle length type to size_t in kore_mem_find(). updated function prototype in kore.h. Use tab instead of space indentation 2016-04-01 17:54:10 +00:00
Matt Thompson 3ef8562bac use offset variable instead of pointer arithmetic 2016-03-31 12:55:23 -05:00
Matt Thompson 61eaaccd30 cast difference between pointers as unsigned in kore_mem_find() 2016-03-21 23:30:28 +00:00
Joris Vink fb6512259c small style changes. 2016-03-21 15:30:11 +01:00
Ángel González 1bda217d57 Based on #115 pull request, adds http_method_text, similar to http_status_text 2016-03-21 15:12:27 +01:00
Joris Vink 4a69657dce Don't call close on an fd that is -1. 2016-02-25 22:04:24 +01:00
Joris Vink f7b0b7c7ac Sometimes content_length wasn't properly updated. 2016-02-22 14:08:21 +01:00
Joris Vink 0294212a3c Do not free results from http_request_header(). 2016-02-21 18:29:06 +01:00
Joris Vink 318647945f more consistency in fatal messages. 2016-02-13 15:45:33 +01:00
Joris Vink 8fcf4762f4 Improve http_body_recv().
- If we fail to write to our temporary file error instead of fatal.
- Return KORE_RESULT_ERROR on other errors as well.
2016-02-13 15:41:37 +01:00
Joris Vink c83abd5afb If ele is 0 return 0 instead of fataling. 2016-02-13 15:27:02 +01:00
Joris Vink 1c8836b2e1 Add precaution against calling kore_split_string with ele == 0 2016-02-13 14:35:11 +01:00
Joris Vink 0c0393fc64 constify 2016-02-13 14:33:06 +01:00
Joris Vink c91fa9ab70 don't be dumb. 2016-02-13 14:13:59 +01:00
Joris Vink 9340d132db don't bother with empty things in kore_text_trim. 2016-02-13 14:02:10 +01:00
Daniel Fahlgren 04aec1c2dd Fix typo in log message 2016-02-12 08:57:58 +01:00
Joris Vink 12e1820a4f Unbreak normal POST parsing.
It was broken for > 2 fields due to recent large changes,
unfortunately i didn't catch this until now.
2016-02-06 15:32:23 +01:00
Joris Vink d4435bec8d Correct pretty bad typo. 2016-02-06 14:59:54 +01:00
Joris Vink 40f69924bb Move shared file reading code to kore_read_line() 2016-02-01 22:10:10 +01:00
Joris Vink 17e311dba9 constify kore_parse_config_file() parameter. 2016-02-01 21:59:31 +01:00
Joris Vink ac864a7419 Update output message to match others. 2016-02-01 21:54:09 +01:00
Joris Vink 3b1204d599 Make sure certkey and certfile are NULL after freeing.
From oneswig but I accidentally removed it during the merge.
2016-02-01 21:42:33 +01:00
Joris Vink d0e9441b60 remove debug. 2016-02-01 21:41:25 +01:00
Joris Vink c8484ee9ab Redo config parsing a bit.
No longer just call kore_string_split() on the line
but separate out the configuration directive and let
the appropriate callbacks parse things on their own.
2016-02-01 21:33:51 +01:00
Joris Vink 82a9e6ef59 Formatting and unbreaking NOHTTP builds. 2016-02-01 20:02:02 +01:00
Joris Vink f4d00645ed Merge pull request #99 from oneswig/master
Add resource management as part of the kore shutdown process.
2016-02-01 19:51:27 +01:00
Joris Vink 1f5e482b8a Build option changes.
- Build with -O2 unless NOOPT is set to 1.
- Hide -g behind DEBUG instead of always building with it.
- Explicitely set the standard used to c99, use pedantic.
2016-02-01 15:33:40 +01:00
Stig Telfer 7963a2deaa Added cleanup for the module handlers and validators 2016-02-01 12:13:22 +00:00
Stig Telfer 55d2451b90 Add cleanup of http_body_path pool 2016-02-01 10:10:04 +00:00
Stig Telfer bd975541dd Merge branch 'master' into oneswig 2016-02-01 10:04:59 +00:00
Joris Vink f2f5a3742f Let SIGTERM properly shutdown Kore as well. 2016-01-31 16:48:17 +01:00
Joris Vink cb489ce80f Define WAIT_ANY if not defined previously. 2016-01-31 16:47:00 +01:00
Joris Vink 3284265b74 Remove the -v stuff and always show cflags and ldflags. 2016-01-27 21:37:59 +01:00
Joris Vink b777ea65cd Long day .. actually add the new build flavor code. 2016-01-27 21:32:57 +01:00
Stig Telfer 2ac6e7d41d Merge branch 'master' into oneswig 2016-01-24 13:46:38 +00:00
Stig Telfer fd0ddca46c Add cleanup function for platform_event on BSD systems 2016-01-22 11:26:56 +00:00
Stig Telfer ec73c35952 Add missing C library headers 2016-01-22 11:08:13 +00:00
Joris Vink 192f458f97 remove unused variable. 2016-01-18 11:43:44 +01:00
Joris Vink a2216c84b0 Properly check if path was already set. 2016-01-18 11:43:10 +01:00
Joris Vink fcb86ddb8b Massive rework of HTTP layer.
This commit is a flag day, your old modules will almost certainly
need to be updated in order to build properly with these changes.

Summary of changes:

- Offload HTTP bodies to disk if they are large (inspired by #100).
  (disabled by default)
- The http_argument_get* macros now takes an explicit http_request parameter.
- Kore will now throw 404 errors almost immediately after an HTTP request
  has come in instead of waiting until all data has arrived.

API changes:

- http_argument_get* macros now require an explicit http_request parameter.
  (no more magic invokations).
- http_generic_404() is gone
- http_populate_arguments() is gone
- http_body_bytes() is gone
- http_body_text() is gone
- http_body_read() has been added
- http_populate_post() has been added
- http_populate_get() has been added
- http_file_read() has been added
- http_file_rewind() has been added
- http_file_lookup() no longer takes name, fname, data and len parameters.
- http_file_lookup() now returns a struct http_file pointer.
- http_populate_multipart_form() no longer takes an secondary parameter.

New configuration options:

- http_body_disk_offload:
	Number of bytes after which Kore will offload the HTTP body to
	disk instead of retaining it in memory. If 0 this feature is
	disabled. (Default: 0)

- http_body_disk_path:
	The path where Kore will store temporary HTTP body files.
	(this directory does not get created if http_body_disk_offload is 0).

New example:

The upload example has been added, demonstrating how to deal with file
uploads from a multipart form.
2016-01-18 11:30:22 +01:00
Joris Vink 96641d3caa Merge branch 'master' of /opt/git/kore 2016-01-18 11:29:47 +01:00
Joris Vink 0dcd6087cf Add kore_buf_stringify().
NUL-terminates a kore_buf and returns a char pointer.
2016-01-18 11:26:55 +01:00
Joris Vink 3c40168e50 Deal with SSL_ERROR_SYSCALL properly. 2016-01-14 10:50:46 +01:00
Ansen Dong 490163de4a if read() return EINTER,retry 2016-01-14 03:02:53 -05:00
Joris Vink ed8110f109 Paranoia about overflows. 2016-01-09 13:51:50 +01:00
Carl Ekerot 53e8220ff6 Fix off-by-one error when reallocing buffer
There was an invalid boundary check when appending to a buffer. The
consequence of this was that the POST data buffer was deterministically
realloced.
2016-01-09 01:57:59 +01:00
Joris Vink e580e6678e Simplify checking filename component. 2016-01-08 21:19:37 +01:00
Joris Vink ce874f09ea Cut memory usage for incoming HTTP bodies in half.
Kore pre-allocates a kore_buf for the full size of the
incoming HTTP body ... but also was passing the full
size to the net_recv_reset() function.

Instead of this, properly read smaller chunks from the
network and append them to the body buffer as they roll in.
2016-01-08 20:56:21 +01:00
Joris Vink 0647901ef5 Improve http_body_max directive a bit.
Allow setting it to 0 which will disable HTTP requests
that have a body (POST/PUT).

Reduce default http_body_max to 1MB by default, 10MB seems large.

Revisit to this code inspired by #100.
2016-01-08 17:54:40 +01:00
Joris Vink 0c47574fe9 If a body is too large send a 413 instead of 411. 2016-01-08 17:47:15 +01:00
Joris Vink f2d8834e8e After receiving a body, prime the netbuf again.
Not doing this results in nothing being read anymore
from the connection after a POST with a content-length of > 0.

Found by Xuning Niu.
2016-01-07 10:40:33 +01:00
Joris Vink e9b56c81a5 Do not fatal if no listeners are defined. 2016-01-07 10:09:44 +01:00
Joris Vink 2f4387e0cd correct headers. 2016-01-07 09:24:45 +01:00
Joris Vink 07ed037a00 Reduce memory footprint for NOTLS builds. 2016-01-07 09:20:09 +01:00
Stig Telfer 18d3cc032d rename *_fini to *_cleanup 2016-01-04 21:40:14 +00:00
Joris Vink 2fc326c0ce Remove whitespace. 2016-01-04 13:09:45 +01:00
Joris Vink c4b1206ae3 Bump copyright to 2016. 2016-01-04 12:58:51 +01:00
Joris Vink a281fd5713 Introduce synchronous pgsql queries.
Semantics for using pgsql API have changed quite heavily
with this commit. See the examples for more information.

Based on Github issue #95 by PauloMelo (paulo.melo@vintageform.pt)
with several modifications by me.
2016-01-04 11:12:43 +01:00
Stig Telfer 223c5c4c28 net_send_queue: Handle case where new data exactly fits available buffer. 2015-12-29 22:07:24 +00:00
Stig Telfer ac45e8cd62 Revert incorrect parameter validation 2015-12-29 21:29:35 +00:00
Stig Telfer 0c51d9da53 Add resource management as part of the kore shutdown process. 2015-12-29 19:39:39 +00:00
Joris Vink 4356c3e628 Allow domain wildcards in the configuration. 2015-12-16 19:51:06 +01:00
Joris Vink 519c3c16d4 Do not run kore_split_string() on original cookie
This broke after http_request_header() started returning
a pointer to the actual header value instead of a copy.

Reminded by PauloMelo via github.
2015-12-14 18:48:48 +01:00
PauloMelo a6ccf2bae9 correct tabsize 2015-12-11 22:31:14 +00:00
PauloMelo d811bf71dc add kore_buf_reset 2015-12-11 21:31:59 +00:00
Joris Vink 8a6f4a935e Set handle function pointer for message callbacks. 2015-12-10 09:26:24 +01:00
Joris Vink 6ac15d37cb Make sure user agent is still set properly. 2015-12-10 09:25:22 +01:00
Joris Vink d3332d5921 Add kore_platform_schedule_write(). 2015-12-09 21:29:44 +01:00
Dmitrii Golub 3eaa325eb5 fix typo: -r for skip privs 2015-12-08 04:42:16 +03:00
Dmitrii Golub ab391df7ff Better CFLAGS and CFLAGS limit 2015-12-04 17:16:56 +03:00
Joris Vink b4611ee38d Kill off zlib_dict.c 2015-12-04 14:11:37 +01:00
Joris Vink 77364e49cd Do not call handle if not set, similar to bsd.c. 2015-12-02 21:57:16 +01:00
Joris Vink 961a2e3685 Allow apps to override connection handling.
Setting the handle callback allows your application
to take care of network events for the connection.

Look at the connection state and flags to determine
if read/write is possible and go from there.

See kore_connection_handle() for more details.
2015-12-01 20:55:00 +01:00
Joris Vink 428802afc8 More cleanup after introducing NOHTTP=1.
* The cli tools must know when building as KORE_NO_HTTP.
* Reshuffle some structs around to avoid forward declarations.
* Move wscbs under !KORE_NO_HTTP as its for websockets.
* Remove unused members from struct connection.

Applications that use the connect callbacks for new connections
must now set the connection state themselves, see nohttp example.
2015-11-30 16:23:34 +01:00
Joris Vink 4fd6d8a7a4 Correct usage of http_request_header().
Since latest change we no longer need free its result.
2015-11-29 17:22:30 +01:00
Joris Vink 7bdae240cf Change semantics for http_request_header().
The result returned by this function no longer needs to
be freed by the caller.
2015-11-29 14:19:44 +01:00
Joris Vink fd52d4c39d Spacing 2015-11-27 18:12:08 +01:00
Joris Vink 769c78a6e8 Introduce NOHTTP=1 build option.
This basically turns off the HTTP layer for Kore. It does not
compile in anything for HTTP.

This allows Kore to be used as a network application platform as well.
Added an example for this called nohttp.

Other changes that sneaked in while hacking on this:
* Use calloc(), kill pendantic malloc option.
* Killed off SPDY/3.1 support completely, will be superseded by http2

Note that comes with massive changes to a lot of the core API
functions provided by Kore, these might break your application.
2015-11-27 16:22:50 +01:00
Joris Vink a88e56ae25 Do not call TAILQ_INIT() on domain list twice. 2015-11-27 11:15:36 +01:00
Shih-Yuan Lee (FourDollars) 384ac824ee Fix typos. 2015-11-04 09:54:55 +08:00
Joris Vink 7b3224ad30 Remove 'behind' argument from timers.
Also calculate next run for a timer as now + interval
instead of last nextrun + interval - delta.
2015-08-06 08:20:41 +02:00
Joris Vink a20fb00789 req can be NULL if we are coming from an error path. 2015-08-02 16:53:40 +02:00
Joris Vink a572a9eeae Always correctly add websocket frame length.
In certain scenarios the addition frame length
would not be set, found the hard way.
2015-07-16 06:55:44 +02:00
Joris Vink 1003cbcd50 Just point hldr_extra to kw->id.
Not sure what state of crazy my mind was in for writing
the previous code like that.
2015-07-07 16:11:40 +02:00
Joris Vink 0281fb7b99 Update the msg->dst member accordingly when sending.
This way the worker will always receive a message with
the correct destination set instead of KORE_MSG_WORKER_ALL.
2015-07-06 21:16:22 +02:00
Joris Vink 064f2095b0 Update message framework with src/dst for workers.
One can now send messages to specific workers and
receiving workers can see the origin of the messages.
2015-07-06 21:08:36 +02:00
Joris Vink d8508f4a7b Add the actual task changes for last commit. 2015-07-01 11:03:54 +02:00
Joris Vink be3fa17201 Do not send connection:close for websocket upgrades. 2015-06-30 16:43:21 +02:00
Joris Vink a4e462b36c Merge pull request #68 from Indrikoterio/master
Make sure we set connection to upgrade only in websocket responses.
2015-06-30 16:37:15 +02:00
Cleve Lendon 18becccd5a Fix indentation. 2015-06-30 18:07:45 +09:00
Joris Vink 4dff0b57ae Add openssl paths for homebrew/ports for osx.
These are the default paths openssl should be installed under
for both projects. This at least kills the need for user CFLAGS
for a normal build.

Inspired by #70.
2015-06-28 13:43:01 +02:00
Cleve Lendon fef3ee8efe Fix websockets. Connection must be Upgrade, not keep-alive, Upgrade 2015-06-26 12:14:01 +09:00
Joris Vink a64808c6b0 Improvements to our message framework.
Change the callback prototypes to:
	void callback(struct kore_msg *msg, const void *data);

This allows the callbacks to receive the full kore_msg data structure
as sent over the wire (including length and id). Useful for future
additions to the kore_msg structure (such as worker origin).

Several other improvements:
	* Accesslog now uses the msg framework as well.
	* Websocket WEBSOCKET_BROADCAST_GLOBAL now works.

Small websocket improvement in this commit:
	* Build the frame to be sent only once when broadcasting
	 instead of per connection we are broadcasting towards.
2015-06-23 18:17:14 +02:00
Joris Vink 0e3271cf9d Add EV_CLEAR to the bsd event code for kqueue.
This was missing and makes dealing with events easier.
2015-06-23 18:16:19 +02:00
Joris Vink c322bbd3c8 Kill the websocket message type. We're not there yet. 2015-06-22 22:20:42 +02:00
Joris Vink 28e48727a5 Kill TCP_NODELAY warnings for socketpair() fds. 2015-06-22 22:11:03 +02:00
Joris Vink 7100ab0dd3 Remove useless log message. 2015-06-22 21:21:03 +02:00
Joris Vink 49ca95f390 Add our messaging framework.
With this framework apps can now send messages between worker processes.

A new API function exists:
	int kore_msg_register(u_int8_t id, void (*cb)(const void *, u_int32_t);

This API call allows your app to register a new message callback for a given ID.

You can then send messages on this ID to other workers using:
	void kore_msg_send(u_int8_t id, void *data, u_int32_t length);

This framework will interally be used for a few things such as allowing
websocket data to broadcasted between all workers, adding unified caching
and hopefully eventually moving the access log to this as well.

Some internals have changed with this commit:
	* worker_clients has been called connections.
	* the parent now initializes the net, and event subsystems.
	* kore_worker_websocket_broadcast() is dead.
2015-06-22 21:13:32 +02:00
Joris Vink 63b0c0a903 Fix typo. 2015-06-14 17:21:16 +02:00
Joris Vink db198578c6 Allow Kore to function under DragonflyBSD.
From David Carlier
2015-06-14 16:54:44 +02:00
Joris Vink 9217fb0bd8 Fix typo. 2015-06-14 16:50:10 +02:00
Joris Vink 13795ead63 NetBSD fixes, from David Carlier. 2015-06-14 16:44:37 +02:00
Joris Vink 512e305e20 When building assets, skip empty files. 2015-06-11 19:33:30 +02:00
Joris Vink 81d119ff93 Let kore build pickup any environment CFLAGS. 2015-06-11 19:20:08 +02:00
Joris Vink 1d604643b5 Add task_threads configuration option.
Before Kore would spawn a task thread per task started
if none were available. This was an obvious bad idiom
but never really hit me hard until now.

Kore will now only spawn as many task threads as configured
by "task_threads" and queue up any newly started tasks ontop
of already running threads if the limit was hit.
2015-06-04 10:29:22 +02:00
Joris Vink 854b916597 Update usage text. 2015-05-28 22:20:43 +02:00
Geenz 0f5b39c977 Small tweak to kore's output when running a module 2015-05-27 09:34:47 -04:00
Geenz 817b916e1f Call it NOTLS instead.
Per @jorisvink's feedback.
2015-05-25 09:42:34 -04:00
Geenz c44de3f629 Rename BENCHMARK to reflect its actual function.
NO_SSL makes a bit more sense, especially for people who proxy their requests via nginx, apache, or similar.
2015-05-25 09:28:13 -04:00
Joris Vink 20a4cd80c5 Kill own definition of be64toh() for openbsd. 2015-05-21 11:01:50 +02:00
Joris Vink 02e06b8bb6 Stop client initiated TLS renegotiations completely. 2015-05-20 16:36:13 +02:00
Joris Vink ff2574899d small style fix. 2015-05-20 11:36:02 +02:00
Joris Vink cdefb66ed8 Spacing. 2015-05-20 11:34:57 +02:00
Thordur Bjornsson d8ccf3c7bf Gunk the default runas/chroot values.
Fatal in the config setup if running without skip_{chroot,runas} and
no values specified.
2015-05-20 11:08:51 +02:00
Thordur Bjornsson e47df37230 Make runas behave similarly to chroot.
Add new command line knob '-r', that disables runas similar to '-n',
it's implied as well for kore command runs.

Add default runas (nobody) user and chroot (/var/empty) path, if none
are specified, fallback to these.
2015-05-20 10:28:19 +02:00
Quentin PEREZ e2e5631b8c add noreturn attribute
fix false-positive warning
2015-05-19 09:45:04 +02:00
Joris Vink a97e18bbe9 Shuffle some HTTP_REQUEST_NO_CONTENT_LENGTH around 2015-05-19 09:13:29 +02:00
Joris Vink e33710b26a Wrap expression with some additional parenthesis. 2015-05-19 09:04:46 +02:00
Quentin Perez ff4faa98b7 fix-null-dereference
http.c:1214, req->method
http.c:1272, req->flags
2015-05-18 23:42:50 +02:00
Joris Vink 5228fe1cbc Fix typo in configuration option worker_accept_treshold.
There is no backwards comptabile option available.

Fixes #53
2015-05-18 12:20:28 +02:00
Joris Vink 875b3a46e6 SPDY stream changes.
Allow callers to set an onclose callback method for SPDY streams
so they can get notified when a stream is closed.

Also add SPDY_NO_CLOSE which tells the underlying Kore layer
to not send a FIN for a SPDY stream until a module does it itself.
2015-05-15 19:17:09 +02:00
Joris Vink 1dd7407a41 Close SPDY streams if len == 0 and SPDY_NO_CLOSE is not set. 2015-05-15 19:16:35 +02:00
Joris Vink cefeaf7992 HTTP layer improvements.
Add HTTP_REQUEST_NO_CONTENT_LENGTH which can be set by
a handler before calling http_response() to avoid Kore
from setting the content-length altogether.

If we are on a SPDY connection do not close the stream
if we do not pass data to http_response().
2015-05-15 19:12:18 +02:00
Joris Vink 0c4dbad2fb Kore timer improvements.
Introduces kore_timer_remove() and updates kore_timer_add()
to return the newly added timer as a struct kore_timer.

Also allow arguments to be passed to timers.
2015-05-15 19:11:10 +02:00
Joris Vink e2ce032b02 Do not treat EPOLLRDHUP as a connection error. 2015-05-15 19:10:23 +02:00
Joris Vink b648c108c2 Merge pull request #50 from thorduri/janitor
fix copy pasto.
2015-05-13 09:58:10 +02:00
Joris Vink 09ed61187b Unfuck content-length changes.
We want a content-length unless its 204 or status < 200.
2015-05-13 09:16:06 +02:00