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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64ac0b2791f462e844e87fc8ac734eadfe63fc0e
4
- data.tar.gz: 98cf990b7b2583ac858d701af47c7d06646c1187
3
+ metadata.gz: c4de811f5a2734382cc86765e77dcecf4b997fc6
4
+ data.tar.gz: 55422a643eab1c3cc0b3b18048521dc0aeac463b
5
5
  SHA512:
6
- metadata.gz: d7a2d254f85b61feff50144af508cb03e26164277698042e82b69d7dfb02c2c9b750f73d9a95dd1fcb09bb82a18f8a850b792d7b7e698d7cc066f715347ef513
7
- data.tar.gz: d1f6642043e29fe7f61727531e120ad7b4027711bf7be2f8fc9d9fe7f39b0ec03ca8fbe1bb664869c85bb27dbd911d98b0f86fcce8d7226b8a224db431875e87
6
+ metadata.gz: 59195e229155fc2ae56e240767a2707d6936758d4a3cfb999343856a753ffcd93ad2c82922a245f13ef95f32c968edaf49af504b64cc5b3152b6fa94bde4f1f5
7
+ data.tar.gz: a875bc77077fcfd0c1ca8d6d4d5fd6c9e53ff5759d578461f343af6ab226b3b26b1b5228765e4c156a37516338f802c1f3207040ac286e775d69b24758af92d2
@@ -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
@@ -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)
@@ -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;
@@ -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);
@@ -1,3 +1,9 @@
1
+ /*
2
+ Copyright: Boaz Segev, 2016-2017
3
+ License: MIT
4
+
5
+ Feel free to copy, use and enjoy according to the license provided.
6
+ */
1
7
  #include "spnlock.inc"
2
8
 
3
9
  #include "http1_response.h"
@@ -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
  /* *****************************************************************************
@@ -1,3 +1,9 @@
1
+ /*
2
+ Copyright: Boaz Segev, 2016-2017
3
+ License: MIT
4
+
5
+ Feel free to copy, use and enjoy according to the license provided.
6
+ */
1
7
  #include "base64.h"
2
8
  #include "http.h"
3
9
  #include "http1_response.h"
@@ -1,6 +1,11 @@
1
1
  #ifndef H_HTTP_RESPONSE_H
2
2
  #define H_HTTP_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 "http_request.h"
5
10
  #include <stdio.h>
6
11
  #include <time.h>
@@ -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
- Returns the number of bytes allocated. On error,
48
- returns 0 and sets the
49
- container pointer to NULL.
44
+ !!!: Remember to call `free` when done.
50
45
 
51
- This function has some Unix specific properties that
52
- resolve links and user
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);
@@ -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! */
@@ -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, ":\n--- bscrypt SHA-2 Test FAILED!\ntype: "
818
- "%s (%d)\nstring %s\nexpected:\n",
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);
@@ -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,
@@ -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
  ***************************************************************************** */
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.3.3'.freeze
2
+ VERSION = '0.3.4'.freeze
3
3
  end
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.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-27 00:00:00.000000000 Z
11
+ date: 2017-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack