iodine 0.3.3 → 0.3.4
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/CHANGELOG.md +6 -0
- data/ext/iodine/bscrypt-common.h +7 -0
- data/ext/iodine/defer.c +3 -0
- data/ext/iodine/facil.c +1 -1
- data/ext/iodine/http1_response.c +6 -0
- data/ext/iodine/http1_response.h +5 -0
- data/ext/iodine/http_response.c +6 -0
- data/ext/iodine/http_response.h +5 -0
- data/ext/iodine/misc.h +7 -9
- data/ext/iodine/sha1.c +1 -1
- data/ext/iodine/sha2.c +4 -3
- data/ext/iodine/sock.c +2 -2
- data/ext/iodine/spnlock.inc +6 -0
- data/lib/iodine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4de811f5a2734382cc86765e77dcecf4b997fc6
|
4
|
+
data.tar.gz: 55422a643eab1c3cc0b3b18048521dc0aeac463b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59195e229155fc2ae56e240767a2707d6936758d4a3cfb999343856a753ffcd93ad2c82922a245f13ef95f32c968edaf49af504b64cc5b3152b6fa94bde4f1f5
|
7
|
+
data.tar.gz: a875bc77077fcfd0c1ca8d6d4d5fd6c9e53ff5759d578461f343af6ab226b3b26b1b5228765e4c156a37516338f802c1f3207040ac286e775d69b24758af92d2
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,12 @@ Please notice that this change log contains changes for upcoming releases as wel
|
|
8
8
|
|
9
9
|
***
|
10
10
|
|
11
|
+
#### Change log v.0.3.4
|
12
|
+
|
13
|
+
**Fix**: (`sock`, `facil`, bscrypt) Add missing `static` keywords to prevent state collisions with other libraries.
|
14
|
+
|
15
|
+
***
|
16
|
+
|
11
17
|
#### Change log v.0.3.3
|
12
18
|
|
13
19
|
**Update**: Now using `facil.io` v.0.4.1
|
data/ext/iodine/bscrypt-common.h
CHANGED
@@ -27,8 +27,10 @@ Environment - you can safely ignore this part... probably.
|
|
27
27
|
|
28
28
|
/* check for unix support */
|
29
29
|
#if __has_include(<unistd.h>) && __has_include(<pthread.h>)
|
30
|
+
#ifndef HAS_UNIX_FEATURES
|
30
31
|
#define HAS_UNIX_FEATURES
|
31
32
|
#endif
|
33
|
+
#endif
|
32
34
|
|
33
35
|
/* include intrinsics if supported */
|
34
36
|
#if __has_include(<x86intrin.h>)
|
@@ -40,8 +42,13 @@ and: https://software.intel.com/sites/landingpage/IntrinsicsGuide/
|
|
40
42
|
*/
|
41
43
|
#endif /* __has_include(<x86intrin.h>) */
|
42
44
|
|
45
|
+
#elif defined(__unix__) || defined(__linux__) || defined(__APPLE__)
|
46
|
+
#ifndef HAS_UNIX_FEATURES
|
47
|
+
#define HAS_UNIX_FEATURES
|
43
48
|
#endif
|
44
49
|
|
50
|
+
#endif /* __has_include */
|
51
|
+
|
45
52
|
// clang-format off
|
46
53
|
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
47
54
|
# if defined(__has_include)
|
data/ext/iodine/defer.c
CHANGED
@@ -273,6 +273,9 @@ inline static void reap_children(void) {
|
|
273
273
|
*/
|
274
274
|
int defer_perform_in_fork(unsigned int process_count,
|
275
275
|
unsigned int thread_count) {
|
276
|
+
if (forked_pool)
|
277
|
+
return -1; /* we're already running inside an active `fork` */
|
278
|
+
|
276
279
|
struct sigaction act, old, old_term, old_pipe;
|
277
280
|
pid_t *pids = NULL;
|
278
281
|
int ret = 0;
|
data/ext/iodine/facil.c
CHANGED
@@ -469,7 +469,7 @@ typedef struct {
|
|
469
469
|
|
470
470
|
#define prot2timer(protocol) (*((timer_protocol_s *)(protocol)))
|
471
471
|
|
472
|
-
const char *timer_protocol_name = "timer protocol __facil_internal__";
|
472
|
+
static const char *timer_protocol_name = "timer protocol __facil_internal__";
|
473
473
|
|
474
474
|
static void timer_on_data(intptr_t uuid, protocol_s *protocol) {
|
475
475
|
prot2timer(protocol).task(prot2timer(protocol).arg);
|
data/ext/iodine/http1_response.c
CHANGED
data/ext/iodine/http1_response.h
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#ifndef H_HTTP1_RESPONSE_H
|
2
2
|
#define H_HTTP1_RESPONSE_H
|
3
|
+
/*
|
4
|
+
Copyright: Boaz Segev, 2016-2017
|
5
|
+
License: MIT
|
3
6
|
|
7
|
+
Feel free to copy, use and enjoy according to the license provided.
|
8
|
+
*/
|
4
9
|
#include "http1.h"
|
5
10
|
|
6
11
|
/* *****************************************************************************
|
data/ext/iodine/http_response.c
CHANGED
data/ext/iodine/http_response.h
CHANGED
data/ext/iodine/misc.h
CHANGED
@@ -39,17 +39,15 @@ typedef struct {
|
|
39
39
|
} fdump_s;
|
40
40
|
|
41
41
|
/**
|
42
|
-
Allocates memory and dumps the whole file into the
|
43
|
-
memory allocated.
|
44
|
-
Remember
|
45
|
-
to call `free` when done.
|
42
|
+
Allocates memory and dumps the whole file into the memory allocated.
|
46
43
|
|
47
|
-
|
48
|
-
returns 0 and sets the
|
49
|
-
container pointer to NULL.
|
44
|
+
!!!: Remember to call `free` when done.
|
50
45
|
|
51
|
-
|
52
|
-
|
46
|
+
Returns the number of bytes allocated.
|
47
|
+
|
48
|
+
On error, returns 0 and sets the container pointer to NULL.
|
49
|
+
|
50
|
+
This function has some Unix specific properties that resolve links and user
|
53
51
|
folder referencing.
|
54
52
|
*/
|
55
53
|
fdump_s *bscrypt_fdump(const char *file_path, size_t size_limit);
|
data/ext/iodine/sha1.c
CHANGED
@@ -51,7 +51,7 @@ Useful Macros - Not all of them are used here, but it's a copy-paste convenience
|
|
51
51
|
(((i)&0xFF00000000000000ULL) >> 56); \
|
52
52
|
} while (0);
|
53
53
|
|
54
|
-
const uint8_t sha1_padding[64] = {0x80, 0};
|
54
|
+
static const uint8_t sha1_padding[64] = {0x80, 0};
|
55
55
|
|
56
56
|
#ifdef __BIG_ENDIAN__
|
57
57
|
/** Converts a 4 byte string to a uint32_t word. careful with alignment! */
|
data/ext/iodine/sha2.c
CHANGED
@@ -81,7 +81,7 @@ Useful Macros
|
|
81
81
|
SHA-2 hashing
|
82
82
|
*/
|
83
83
|
|
84
|
-
const uint8_t sha2_padding[128] = {0x80, 0};
|
84
|
+
static const uint8_t sha2_padding[128] = {0x80, 0};
|
85
85
|
|
86
86
|
/* SHA-224 and SHA-256 constants */
|
87
87
|
static uint32_t sha2_256_words[] = {
|
@@ -814,8 +814,9 @@ void bscrypt_test_sha2(void) {
|
|
814
814
|
return;
|
815
815
|
goto error;
|
816
816
|
error:
|
817
|
-
fprintf(stderr,
|
818
|
-
|
817
|
+
fprintf(stderr,
|
818
|
+
":\n--- bscrypt SHA-2 Test FAILED!\ntype: "
|
819
|
+
"%s (%d)\nstring %s\nexpected:\n",
|
819
820
|
sha2_variant_names[s.type], s.type, str);
|
820
821
|
while (*expect)
|
821
822
|
fprintf(stderr, "%02x", *(expect++) & 0xFF);
|
data/ext/iodine/sock.c
CHANGED
@@ -102,7 +102,7 @@ typedef struct packet_s {
|
|
102
102
|
sock_buffer_s buffer;
|
103
103
|
} packet_s;
|
104
104
|
|
105
|
-
struct {
|
105
|
+
static struct {
|
106
106
|
packet_s *next;
|
107
107
|
spn_lock_i lock;
|
108
108
|
uint8_t init;
|
@@ -200,7 +200,7 @@ static ssize_t sock_default_hooks_flush(intptr_t uuid) {
|
|
200
200
|
return (((void)(uuid)), 0);
|
201
201
|
}
|
202
202
|
|
203
|
-
sock_rw_hook_s sock_default_hooks = {
|
203
|
+
static sock_rw_hook_s sock_default_hooks = {
|
204
204
|
.read = sock_default_hooks_read,
|
205
205
|
.write = sock_default_hooks_write,
|
206
206
|
.flush = sock_default_hooks_flush,
|
data/ext/iodine/spnlock.inc
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
#ifndef H_SPNLOCK_H
|
2
2
|
#define H_SPNLOCK_H
|
3
|
+
/*
|
4
|
+
Copyright: Boaz Segev, 2016-2017
|
5
|
+
License: MIT
|
6
|
+
|
7
|
+
Feel free to copy, use and enjoy according to the license provided.
|
8
|
+
*/
|
3
9
|
/* *****************************************************************************
|
4
10
|
spinlock / sync for tasks
|
5
11
|
***************************************************************************** */
|
data/lib/iodine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iodine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|