iodine 0.4.19 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of iodine might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/CHANGELOG.md +22 -0
- data/LIMITS.md +19 -9
- data/README.md +92 -77
- data/SPEC-PubSub-Draft.md +113 -0
- data/SPEC-Websocket-Draft.md +127 -143
- data/bin/http-hello +0 -1
- data/bin/raw-rbhttp +1 -1
- data/bin/raw_broadcast +8 -10
- data/bin/updated api +2 -2
- data/bin/ws-broadcast +2 -4
- data/bin/ws-echo +2 -2
- data/examples/config.ru +13 -13
- data/examples/echo.ru +5 -6
- data/examples/hello.ru +2 -3
- data/examples/info.md +316 -0
- data/examples/pubsub_engine.ru +81 -0
- data/examples/redis.ru +9 -9
- data/examples/shootout.ru +45 -11
- data/ext/iodine/defer.c +194 -297
- data/ext/iodine/defer.h +61 -53
- data/ext/iodine/evio.c +0 -260
- data/ext/iodine/evio.h +50 -22
- data/ext/iodine/evio_callbacks.c +26 -0
- data/ext/iodine/evio_epoll.c +251 -0
- data/ext/iodine/evio_kqueue.c +193 -0
- data/ext/iodine/extconf.rb +1 -1
- data/ext/iodine/facil.c +1420 -542
- data/ext/iodine/facil.h +151 -64
- data/ext/iodine/fio_ary.h +418 -0
- data/ext/iodine/{base64.c → fio_base64.c} +33 -24
- data/ext/iodine/{base64.h → fio_base64.h} +6 -7
- data/ext/iodine/{fio_cli_helper.c → fio_cli.c} +77 -58
- data/ext/iodine/{fio_cli_helper.h → fio_cli.h} +9 -4
- data/ext/iodine/fio_hashmap.h +759 -0
- data/ext/iodine/fio_json_parser.h +651 -0
- data/ext/iodine/fio_llist.h +257 -0
- data/ext/iodine/fio_mem.c +672 -0
- data/ext/iodine/fio_mem.h +140 -0
- data/ext/iodine/fio_random.c +248 -0
- data/ext/iodine/{random.h → fio_random.h} +11 -14
- data/ext/iodine/{sha1.c → fio_sha1.c} +28 -24
- data/ext/iodine/{sha1.h → fio_sha1.h} +38 -16
- data/ext/iodine/{sha2.c → fio_sha2.c} +66 -49
- data/ext/iodine/{sha2.h → fio_sha2.h} +57 -26
- data/ext/iodine/{fiobj_internal.c → fio_siphash.c} +9 -90
- data/ext/iodine/fio_siphash.h +18 -0
- data/ext/iodine/fio_tmpfile.h +38 -0
- data/ext/iodine/fiobj.h +24 -7
- data/ext/iodine/fiobj4sock.h +23 -0
- data/ext/iodine/fiobj_ary.c +143 -226
- data/ext/iodine/fiobj_ary.h +17 -16
- data/ext/iodine/fiobj_data.c +1160 -0
- data/ext/iodine/fiobj_data.h +164 -0
- data/ext/iodine/fiobj_hash.c +298 -406
- data/ext/iodine/fiobj_hash.h +101 -54
- data/ext/iodine/fiobj_json.c +478 -601
- data/ext/iodine/fiobj_json.h +34 -9
- data/ext/iodine/fiobj_numbers.c +383 -51
- data/ext/iodine/fiobj_numbers.h +87 -11
- data/ext/iodine/fiobj_str.c +423 -184
- data/ext/iodine/fiobj_str.h +81 -32
- data/ext/iodine/fiobject.c +273 -522
- data/ext/iodine/fiobject.h +477 -112
- data/ext/iodine/http.c +2243 -83
- data/ext/iodine/http.h +842 -121
- data/ext/iodine/http1.c +810 -385
- data/ext/iodine/http1.h +16 -39
- data/ext/iodine/http1_parser.c +146 -74
- data/ext/iodine/http1_parser.h +15 -4
- data/ext/iodine/http_internal.c +1258 -0
- data/ext/iodine/http_internal.h +226 -0
- data/ext/iodine/http_mime_parser.h +341 -0
- data/ext/iodine/iodine.c +86 -68
- data/ext/iodine/iodine.h +26 -11
- data/ext/iodine/iodine_helpers.c +8 -7
- data/ext/iodine/iodine_http.c +487 -324
- data/ext/iodine/iodine_json.c +304 -0
- data/ext/iodine/iodine_json.h +6 -0
- data/ext/iodine/iodine_protocol.c +107 -45
- data/ext/iodine/iodine_pubsub.c +526 -225
- data/ext/iodine/iodine_pubsub.h +10 -0
- data/ext/iodine/iodine_websockets.c +268 -510
- data/ext/iodine/iodine_websockets.h +2 -4
- data/ext/iodine/pubsub.c +726 -432
- data/ext/iodine/pubsub.h +85 -103
- data/ext/iodine/rb-call.c +4 -4
- data/ext/iodine/rb-defer.c +46 -22
- data/ext/iodine/rb-fiobj2rb.h +117 -0
- data/ext/iodine/rb-rack-io.c +73 -238
- data/ext/iodine/rb-rack-io.h +2 -2
- data/ext/iodine/rb-registry.c +35 -93
- data/ext/iodine/rb-registry.h +1 -0
- data/ext/iodine/redis_engine.c +742 -304
- data/ext/iodine/redis_engine.h +42 -39
- data/ext/iodine/resp_parser.h +311 -0
- data/ext/iodine/sock.c +627 -490
- data/ext/iodine/sock.h +345 -297
- data/ext/iodine/spnlock.inc +15 -4
- data/ext/iodine/websocket_parser.h +16 -20
- data/ext/iodine/websockets.c +188 -257
- data/ext/iodine/websockets.h +24 -133
- data/lib/iodine.rb +52 -7
- data/lib/iodine/cli.rb +6 -24
- data/lib/iodine/json.rb +40 -0
- data/lib/iodine/version.rb +1 -1
- data/lib/iodine/websocket.rb +5 -3
- data/lib/rack/handler/iodine.rb +58 -13
- metadata +38 -48
- data/bin/ws-shootout +0 -107
- data/examples/broadcast.ru +0 -56
- data/ext/iodine/bscrypt-common.h +0 -116
- data/ext/iodine/bscrypt.h +0 -49
- data/ext/iodine/fio2resp.c +0 -60
- data/ext/iodine/fio2resp.h +0 -51
- data/ext/iodine/fio_dict.c +0 -446
- data/ext/iodine/fio_dict.h +0 -99
- data/ext/iodine/fio_hash_table.h +0 -370
- data/ext/iodine/fio_list.h +0 -111
- data/ext/iodine/fiobj_internal.h +0 -280
- data/ext/iodine/fiobj_primitives.c +0 -131
- data/ext/iodine/fiobj_primitives.h +0 -55
- data/ext/iodine/fiobj_sym.c +0 -135
- data/ext/iodine/fiobj_sym.h +0 -60
- data/ext/iodine/hex.c +0 -124
- data/ext/iodine/hex.h +0 -70
- data/ext/iodine/http1_request.c +0 -81
- data/ext/iodine/http1_request.h +0 -58
- data/ext/iodine/http1_response.c +0 -417
- data/ext/iodine/http1_response.h +0 -95
- data/ext/iodine/http_request.c +0 -111
- data/ext/iodine/http_request.h +0 -102
- data/ext/iodine/http_response.c +0 -1703
- data/ext/iodine/http_response.h +0 -250
- data/ext/iodine/misc.c +0 -182
- data/ext/iodine/misc.h +0 -74
- data/ext/iodine/random.c +0 -208
- data/ext/iodine/redis_connection.c +0 -278
- data/ext/iodine/redis_connection.h +0 -86
- data/ext/iodine/resp.c +0 -842
- data/ext/iodine/resp.h +0 -261
- data/ext/iodine/siphash.c +0 -154
- data/ext/iodine/siphash.h +0 -22
- data/ext/iodine/xor-crypt.c +0 -193
- data/ext/iodine/xor-crypt.h +0 -107
data/ext/iodine/xor-crypt.h
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright: Boaz segev, 2016-2017
|
3
|
-
License: MIT except for any non-public-domain algorithms (none that I'm aware
|
4
|
-
of), which might be subject to their own licenses.
|
5
|
-
|
6
|
-
Feel free to copy, use and enjoy in accordance with to the license(s).
|
7
|
-
*/
|
8
|
-
#ifndef bscrypt_XOR_CRYPT_H
|
9
|
-
#define bscrypt_XOR_CRYPT_H
|
10
|
-
#include "bscrypt-common.h"
|
11
|
-
/* *****************************************************************************
|
12
|
-
C++ extern
|
13
|
-
*/
|
14
|
-
#if defined(__cplusplus)
|
15
|
-
extern "C" {
|
16
|
-
#endif
|
17
|
-
|
18
|
-
/* ***************************************************************************
|
19
|
-
XOR encryption
|
20
|
-
*/
|
21
|
-
|
22
|
-
typedef struct xor_key_s xor_key_s;
|
23
|
-
/**
|
24
|
-
The `xor_key_s` type is a struct containing XOR key data. This will be used for
|
25
|
-
all the encryption/decription functions that use XOR key data, such as the
|
26
|
-
`bscrypt_xor_crypt` function.
|
27
|
-
*/
|
28
|
-
struct xor_key_s {
|
29
|
-
/** A pointer to a string containing the key. */
|
30
|
-
uint8_t *key;
|
31
|
-
/** The length of the key string */
|
32
|
-
size_t length;
|
33
|
-
/**
|
34
|
-
The vector / position from which to start the next encryption/decryption.
|
35
|
-
|
36
|
-
This value is automatically advanced when encrypting / decrypting data.
|
37
|
-
*/
|
38
|
-
size_t position;
|
39
|
-
/**
|
40
|
-
An optional callback to be called whenever the XOR key finished a cycle and
|
41
|
-
the `position` is being reset to 0.
|
42
|
-
|
43
|
-
The function should return 0 on sucess and -1 on failure. Failue will cause
|
44
|
-
endryption/decryption to fail.
|
45
|
-
*/
|
46
|
-
int (*on_cycle)(xor_key_s *key);
|
47
|
-
};
|
48
|
-
|
49
|
-
typedef struct xor_key_128bit_s xor_key_128bit_s;
|
50
|
-
/**
|
51
|
-
The `xor_key_128bit_s` type is a struct containing an XOR key data. This will be
|
52
|
-
used
|
53
|
-
for
|
54
|
-
all the encryption/decription functions that use XOR key data, such as the
|
55
|
-
`bscrypt.xor_crypt` function.
|
56
|
-
*/
|
57
|
-
struct xor_key_128bit_s {
|
58
|
-
/** A pointer to a string containing the key. */
|
59
|
-
uint64_t key[2];
|
60
|
-
/**
|
61
|
-
An optional callback to be called whenever the XOR key finished a cycle and
|
62
|
-
the `position` is being reset to 0.
|
63
|
-
|
64
|
-
The function should return 0 on sucess and -1 on failure. Failue will cause
|
65
|
-
endryption/decryption to fail.
|
66
|
-
*/
|
67
|
-
int (*on_cycle)(xor_key_128bit_s *key);
|
68
|
-
};
|
69
|
-
|
70
|
-
/**
|
71
|
-
Uses an XOR key `xor_key_s` to encrypt / decrypt the data provided.
|
72
|
-
|
73
|
-
Encryption/decryption can be destructive (the target and the source can point
|
74
|
-
to the same object).
|
75
|
-
|
76
|
-
The key's `on_cycle` callback option should be utilized to re-calculate the
|
77
|
-
key every cycle. Otherwise, XOR encryption should be avoided.
|
78
|
-
|
79
|
-
A more secure encryption would be easier to implement using seperate
|
80
|
-
`xor_key_s` objects for encryption and decription.
|
81
|
-
|
82
|
-
If `target` is NULL, the source will be used as the target (destructive mode).
|
83
|
-
|
84
|
-
Returns -1 on error and 0 on success.
|
85
|
-
*/
|
86
|
-
int bscrypt_xor_crypt(xor_key_s *key, void *target, const void *source,
|
87
|
-
size_t length);
|
88
|
-
|
89
|
-
/**
|
90
|
-
Similar to the bscrypt_xor_crypt except with a fixed key size of 128bits.
|
91
|
-
*/
|
92
|
-
int bscrypt_xor128_crypt(uint64_t *key, void *target, const void *source,
|
93
|
-
size_t length, int (*on_cycle)(uint64_t *key));
|
94
|
-
/**
|
95
|
-
Similar to the bscrypt_xor_crypt except with a fixed key size of 256bits.
|
96
|
-
*/
|
97
|
-
int bscrypt_xor256_crypt(uint64_t *key, void *target, const void *source,
|
98
|
-
size_t length, int (*on_cycle)(uint64_t *key));
|
99
|
-
|
100
|
-
/* *****************************************************************************
|
101
|
-
C++ extern finish
|
102
|
-
*/
|
103
|
-
#if defined(__cplusplus)
|
104
|
-
}
|
105
|
-
#endif
|
106
|
-
|
107
|
-
#endif
|