funnel_http 0.5.14 → 0.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f420aa8d07b1377acf3f6044635855c77e2e621a877e293ea38ead1cd758f81e
4
- data.tar.gz: b80faa1e6dc9315968ab3ecb3a6dd0ae3697cdf285f56e079ef587711f390300
3
+ metadata.gz: df00f14e6751da1f0fe37842b544e49176a90af2f006cdd64e84c3bd9d1cfed4
4
+ data.tar.gz: 359f884cd8adebad4951d9637df6224ffbc568d19185a60a316ecdc3303c20a2
5
5
  SHA512:
6
- metadata.gz: 7f8f2ebeee5e4490de289cad114f6b0d710614bb0c0542d44aaf7d6f685b24135e42e21ad1a3b72bcde466d128f73a3b5d148bec754d06892b9c4d2ae3ca33c8
7
- data.tar.gz: 005ed60afef68d5ed6fb9fc8d5e89d482aca67e4510c266f1fd25619a4c687d5f95110ce1ba56b0098719724b090652c5e94be367ec090c56b622a3da4132c4e
6
+ metadata.gz: aa86b0f85dc8f8299833e38de624a2f75a3c356e1ad952f4adc8d7d5f6d6c4a2c70ba9a33fd3b3b290bff6d4aec243ad5bf67a6dc92e26b76be0ddc0b6e71edd
7
+ data.tar.gz: 546d32453819bf0d834cf12d7d2c4b1bd46279fac0daedd6965861f85e9c83466f60fad39f96e5c0587cb65afb753972221ef8bff5fc464767e557d9f79a9d03
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
- [full changelog](http://github.com/sue445/funnel_http/compare/v0.5.14...main)
2
+ [full changelog](http://github.com/sue445/funnel_http/compare/v0.5.15...main)
3
+
4
+ ## [0.5.15](https://github.com/sue445/funnel_http/releases/tag/v0.5.15) - 2026-09-12
5
+ [full changelog](http://github.com/sue445/funnel_http/compare/v0.5.14...v0.5.15)
6
+
7
+ * Fix SEGV
8
+ * https://github.com/sue445/funnel_http/pull/214
9
+ * Update Go dependencies
3
10
 
4
11
  ## [0.5.14](https://github.com/sue445/funnel_http/releases/tag/v0.5.14) - 2026-09-12
5
12
  [full changelog](http://github.com/sue445/funnel_http/compare/v0.5.13...v0.5.14)
@@ -38,9 +38,10 @@ func rb_funnel_http_run_requests(self C.VALUE, rbAry C.VALUE) C.VALUE {
38
38
  ruby.RbRaise(rb_cFunnelHttpError, "%s", err.Error())
39
39
  }
40
40
 
41
- var rbHashSlice []ruby.VALUE
42
- for _, response := range responses {
41
+ rbHashSlice := make([]ruby.VALUE, len(responses))
42
+ for i, response := range responses {
43
43
  rbHash := ruby.RbHashNew()
44
+ ruby.RbGcRegisterAddress(&rbHash)
44
45
 
45
46
  ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("status_code")), ruby.INT2NUM(response.StatusCode))
46
47
  ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("body")), ruby.String2Value(string(response.Body)))
@@ -48,33 +49,45 @@ func rb_funnel_http_run_requests(self C.VALUE, rbAry C.VALUE) C.VALUE {
48
49
 
49
50
  rbHashHeader := ruby.RbHashNew()
50
51
  ruby.RbGcRegisterAddress(&rbHashHeader)
51
- defer ruby.RbGcUnregisterAddress(&rbHashHeader)
52
52
 
53
53
  for key, values := range response.Header {
54
- var headerValues []ruby.VALUE
55
- for _, value := range values {
56
- v := ruby.String2Value(value)
57
- ruby.RbGcRegisterAddress(&v)
58
- defer ruby.RbGcUnregisterAddress(&v)
59
-
60
- headerValues = append(headerValues, v)
54
+ headerValues := make([]ruby.VALUE, len(values))
55
+ for j, value := range values {
56
+ headerValues[j] = ruby.String2Value(value)
57
+ ruby.RbGcRegisterAddress(&headerValues[j])
61
58
  }
59
+
62
60
  k := ruby.String2Value(key)
63
61
  ruby.RbGcRegisterAddress(&k)
64
- defer ruby.RbGcUnregisterAddress(&k)
65
62
 
66
63
  v := ruby.Slice2rbAry(headerValues)
67
64
  ruby.RbGcRegisterAddress(&v)
68
- defer ruby.RbGcUnregisterAddress(&v)
69
65
 
70
66
  ruby.RbHashAset(rbHashHeader, k, v)
67
+
68
+ ruby.RbGcUnregisterAddress(&v)
69
+ ruby.RbGcUnregisterAddress(&k)
70
+
71
+ for j := range headerValues {
72
+ ruby.RbGcUnregisterAddress(&headerValues[j])
73
+ }
71
74
  }
75
+
72
76
  ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("header")), rbHashHeader)
77
+ ruby.RbGcUnregisterAddress(&rbHashHeader)
78
+
79
+ rbHashSlice[i] = rbHash
80
+ ruby.RbGcRegisterAddress(&rbHashSlice[i])
81
+ ruby.RbGcUnregisterAddress(&rbHash)
82
+ }
83
+
84
+ rbResponseAry := ruby.Slice2rbAry(rbHashSlice)
73
85
 
74
- rbHashSlice = append(rbHashSlice, rbHash)
86
+ for i := range rbHashSlice {
87
+ ruby.RbGcUnregisterAddress(&rbHashSlice[i])
75
88
  }
76
89
 
77
- return C.VALUE(ruby.Slice2rbAry(rbHashSlice))
90
+ return C.VALUE(rbResponseAry)
78
91
  }
79
92
 
80
93
  func getHttpClientFromInstanceVariable(self ruby.VALUE) http.Client {
@@ -92,8 +105,7 @@ func getHttpClientFromInstanceVariable(self ruby.VALUE) http.Client {
92
105
  data := ruby.GetGoStruct(obj)
93
106
 
94
107
  // Save FunnelHttp::Ext::GoData to instance variable of FunnelHttp::Ext::Client
95
- dataValue := (*ruby.VALUE)(data)
96
- ruby.RbIvarSet(self, id, *dataValue)
108
+ ruby.RbIvarSet(self, id, obj)
97
109
 
98
110
  return ((*goData)(data)).httpClient
99
111
  }
@@ -7,7 +7,7 @@ require (
7
7
  github.com/jarcoal/httpmock v1.4.2
8
8
  github.com/ruby-go-gem/go-gem-wrapper v0.11.0
9
9
  github.com/stretchr/testify v1.12.1
10
- golang.org/x/sync v0.22.0
10
+ golang.org/x/sync v0.23.0
11
11
  )
12
12
 
13
13
  require (
@@ -54,8 +54,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
54
54
  golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
55
55
  golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
56
56
  golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
57
- golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
58
- golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
57
+ golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
58
+ golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
59
59
  golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
60
60
  golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
61
61
  golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FunnelHttp
4
- VERSION = "0.5.14"
4
+ VERSION = "0.5.15"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funnel_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.14
4
+ version: 0.5.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-12 00:00:00.000000000 Z
11
+ date: 2026-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: go_gem