Commit Graph

635 Commits

Author SHA1 Message Date
Joris Vink 160eb791f7 Merge pull request #37 from Geenz/master
Allow modules to use C++.
2015-04-02 13:20:01 +02:00
Geenz 6bd0da171d Always enable C++ support.
Per @jorisvink's suggestion.
2015-04-02 05:43:07 -04:00
Geenz 93fe8e6b42 Update Readmes 2015-04-01 21:39:40 -04:00
Geenz eab769af6b Add support for selecting C++ dialect and lib.
Otherwise, assume libstdc++ and the compiler's default dialect.
2015-04-01 20:05:09 -04:00
Geenz ba031d15de Sleep deprived typos are the best typos. 2015-04-01 19:28:26 -04:00
Geenz 5af3411513 Code style cleanup in C++ example. 2015-04-01 09:35:05 -04:00
Geenz 4c07491db6 Add license headers to C++ example. 2015-04-01 08:37:02 -04:00
Geenz 97ec644a9a Explicitly link libstdc++. 2015-04-01 08:32:24 -04:00
Geenz 86daf3f1b0 Add support for setting the C++ compiler.
Also make args a bit bigger.
2015-04-01 08:09:09 -04:00
Geenz 0da755a9fb Add C++ example. 2015-04-01 07:59:32 -04:00
Geenz 3a904cdde3 Add __cplusplus macros to headers. 2015-04-01 07:25:10 -04:00
Geenz 6b7f79f733 Wrap C++ support with KORE_CPP_SUPPORT 2015-04-01 07:02:53 -04:00
Geenz 45e9d26f48 Separate C and C++ files into their own lists. 2015-04-01 03:28:03 -04:00
Geenz faa1cf60c4 Add a few useful C++ specific warnings. 2015-03-31 23:09:09 -04:00
Geenz 6e52c31d59 Include .cpp files when building.
This probably isn't an ideal way to add support for also compiling C++ in a project, but for now it works for my needs.
2015-03-31 03:17:33 -04:00
Joris Vink b234b7ed65 Add HTTP_REQUEST_RETAIN_EXTRA flag to http_request
Signals Kore to not free any pointer set in req->hdlr_extra.
Useful in certain scenarios where you have data per request
bound to something in memory but do not want to lose it when
the request is freed by Kore.

Set this flag before your handler returns.
2015-03-27 23:23:21 +01:00
Joris Vink eb235b3e01 shmat() returns (void *)-1 upon error. 2015-03-25 19:42:24 +01:00
Joris Vink dbad4e7160 move towards 1.2.2-rc1 2015-03-17 09:34:33 +01:00
Joris Vink a4a86494b8 Bring net_recv_expand() in line with others. 2015-03-16 16:52:40 +01:00
Joris Vink a4298206a7 Fix lies in fatal message. 2015-03-16 16:50:33 +01:00
Joris Vink ad5d662556 Use net_recv_reset() if more body bytes are coming.
Unbreaks clients that send the headers first and the
actual HTTP body after X amount of time.
2015-03-16 16:45:13 +01:00
Joris Vink f8a9ece9a6 Set the x509 callback when initializing the SSL_CTX.
While here, fix a format string error.
2015-02-20 10:49:14 +01:00
Joris Vink f975453565 Set X509 verification callback and log errors.
When using client certificates Kore now calls
domain_x509_verify() and logs any certificate
verification errors that might occur.

CRL validity errors are ignored.
2015-02-20 10:43:31 +01:00
Joris Vink 0288902a1b Set crlfile to NULL when initializing. 2015-02-20 10:11:15 +01:00
Joris Vink 91c44af6f0 Always include includeSubDomains for HSTS. 2015-02-10 17:14:07 +01:00
Joris Vink 1507f88ec7 Respect keepalive when throwing HTTP errors.
Report from github issue #34
2015-02-06 10:59:15 +01:00
Joris Vink 6d90291405 Set rootdir earlier in cli_create(). 2015-02-06 09:02:52 +01:00
Joris Vink be96a93f9e Add missing ssl_dhparam to all example configs. 2015-02-06 09:02:29 +01:00
Joris Vink 12c07b79e6 Kill a warning when building with BENCHMARK 2015-02-04 19:40:49 +01:00
Joris Vink 6eec8166c6 "request" auth blocks should set their own response. 2015-02-04 12:04:07 +01:00
Joris Vink 2049bc72dc By default Kore now uses ECDH/DHE for TLS key exchanges.
This commit disables RSA key exchanges for TLS completely, while
introducing the requirement for always having DH parameters (ssl_dhparam).

Judging from ciphersuites most modern browsers now prefer this
change should be more than ok.
2015-02-03 13:17:59 +01:00
Joris Vink b1e5a806a6 No need to assign ret when failing here. 2015-01-19 15:32:52 +01:00
Joris Vink 67efb9b04a better brackets around some if statements. 2015-01-19 15:31:36 +01:00
Joris Vink 2ee72657e1 Brackets would be great here. 2015-01-19 15:26:53 +01:00
Joris Vink aaf00e92f8 add version correctly 2014-12-12 19:48:31 +01:00
Joris Vink bb7cfbf08c Add 1.2.1-release to README 2014-12-12 19:47:51 +01:00
Joris Vink b6658ef117 Bump to 1.2.1-develop 2014-12-12 19:36:56 +01:00
Joris Vink 6005c95ee6 Fix compiling under openbsd 2014-12-12 19:09:44 +01:00
Joris Vink d9e2eb7a65 Bump to 1.2.1-release 2014-12-12 18:59:08 +01:00
Joris Vink dbe301e58c Add a patch level to our version number. 2014-12-12 13:06:41 +01:00
Joris Vink 182126080e Merge pull request #25 from apfohl/prefix
Added ability to set path prefix during make.
2014-12-12 12:40:44 +01:00
Andreas Pfohl 24e1d3928d Added ability to set path prefix during make. 2014-12-12 10:15:30 +01:00
Joris Vink c494126720 Make worker_clients available everywhere. 2014-12-03 20:40:44 +01:00
Joris Vink 7b286f2f70 Set correct timeout start for websockets 2014-11-25 20:00:33 +01:00
Joris Vink 8fe16c193a Link with -lcrypto even for BENCHMARK 2014-11-24 11:31:50 +01:00
Joris Vink ffe3fdc49d Add websocket mention 2014-11-24 11:11:01 +01:00
Joris Vink 1a680d8d09 Remove lingering diff file 2014-11-24 11:09:19 +01:00
Joris Vink f867882f43 Add websocket support to Kore.
Introduces a few new api functions:

- kore_websocket_handshake(struct http_request *):
	Performs the handshake on an HTTP request (coming from page handler)

- kore_websocket_send(struct connection *, u_int8_t, void *, size_t):
	Sends data to a websocket connection.

- kore_websocket_broadcast(struct connection *, u_int8_t, void *, size_t, int):
	Broadcast the given websocket op and data to all connected
	websocket clients on the worker. Note that as of right now
	the WEBSOCKET_BROADCAST_GLOBAL scope option does not work
	yet and messages broadcasted will be restricted to workers
	only.

- kore_worker_websocket_broadcast(struct connection *, void *, void *):
	Backend function used by kore_websocket_broadcast().
	Could prove useful for developers to have access to.

A simple example is given under examples/websocket.

Known issues:
	Kore does not support PING or CONT frames just yet.
2014-11-24 11:08:34 +01:00
Joris Vink ac4222e929 Proper use of kore_strtonum64(). 2014-11-24 10:39:38 +01:00
Joris Vink a1e6588085 Repopulate now when we are doing idle timer checks.
Otherwise in a weird scenario the idle timer could
be started with a more recent time then the time we
test against causing a connection to disconnect
before its idle timer was over.
2014-11-21 16:38:23 +01:00