polyphony 0.81 → 0.81.1

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: aef5f8ee7585e1ae6a6632099329ba35b7dc6959dba5041f4cdcbaf92caded72
4
- data.tar.gz: b168b56f080029e4167e2528e66b83186a635ea4bda8dc74882dfe70639421fc
3
+ metadata.gz: f4584f87975e018fe58887f4c6786bfe8c631a7d2fed3717e6822d72741fcc92
4
+ data.tar.gz: 9353ed759d256a035619d0b18dc53569fba6fdbb0709d79defb585fbf5f63f5a
5
5
  SHA512:
6
- metadata.gz: aa7bd86706d5879c884b4f5bdc7a10556cbe28e6737ff89e5107589e1630028098dd815424ef357e51879a7e689cd5127ea30105eb1c36a174da7385b8f6f433
7
- data.tar.gz: 3c4b35eed6900d55c5295c366803b944a6e423775ca5278f4b2600a309cb547cda12a2167ae40a4ef8e0001a1b6a8b8ea936129246f24d87b0eec59c9d31a3b4
6
+ metadata.gz: c4d2d6e7457e49b4803b44e2125b54465a1104635b3d0a1d127538335401eeca6612095a2dcde9b6e149d939d15c6de2a1cbdf892a114535a5f0bd00ea1936e8
7
+ data.tar.gz: 5f4eb0a66dec6614d542d2c89cad791e2eb7e27ab9ae74f6bf60c8d4bd9831a098f531be6a619d4f13662631e86f1ac6ddc7bf5bf5f005b8926a4dfc3c7e43ef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.81.1 2022-03-03
2
+
3
+ - Fix `Backend_recv` regression
4
+
1
5
  ## 0.81 2022-03-03
2
6
 
3
7
  - Restore public visibility for `Polyphony::Process.kill_process`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polyphony (0.81)
4
+ polyphony (0.81.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'polyphony'
5
+
6
+ puts '* pre'
7
+ Polyphony.backend_test(STDOUT, "Hello, world!\n")
8
+ puts '* post'
@@ -10,6 +10,7 @@ writer = Zlib::GzipWriter.new(w)
10
10
  writer << 'chunk'
11
11
  writer.flush
12
12
  p pos: writer.pos
13
- w.close
13
+ # w.close
14
+ writer.close
14
15
 
15
16
  p r.read
@@ -9,7 +9,6 @@
9
9
  #include "ruby.h"
10
10
  #include "ruby/io.h"
11
11
  #include "runqueue.h"
12
- #include "polyphony.h"
13
12
 
14
13
  struct backend_stats {
15
14
  unsigned int runqueue_size;
@@ -396,7 +396,7 @@ VALUE Backend_read(VALUE self, VALUE io, VALUE str, VALUE length, VALUE to_eof,
396
396
  int result;
397
397
  int completed;
398
398
 
399
- io_uring_prep_read(sqe, fptr->fd, buffer.base, buffer.size - total, -1);
399
+ io_uring_prep_read(sqe, fptr->fd, buffer.base, buffer.size, -1);
400
400
 
401
401
  result = io_uring_backend_defer_submit_and_await(backend, sqe, ctx, &resume_value);
402
402
  completed = context_store_release(&backend->store, ctx);
@@ -415,15 +415,15 @@ VALUE Backend_read(VALUE self, VALUE io, VALUE str, VALUE length, VALUE to_eof,
415
415
  total += result;
416
416
  if (!read_to_eof) break;
417
417
 
418
- if (total == buffer.size) {
418
+ if (result == buffer.size) {
419
419
  if (!expandable_buffer) break;
420
420
 
421
- // resize buffer
421
+ // resize buffer to double its capacity
422
422
  rb_str_resize(str, total + buf_pos);
423
- rb_str_modify_expand(str, buffer.size);
423
+ rb_str_modify_expand(str, rb_str_capacity(str));
424
424
  shrinkable_string = 0;
425
425
  buffer.base = RSTRING_PTR(str) + total + buf_pos;
426
- buffer.size = buffer.size;
426
+ buffer.size = rb_str_capacity(str) - total - buf_pos;
427
427
  }
428
428
  else {
429
429
  buffer.base += result;
@@ -440,7 +440,7 @@ VALUE Backend_read(VALUE self, VALUE io, VALUE str, VALUE length, VALUE to_eof,
440
440
 
441
441
  if (!total) return Qnil;
442
442
 
443
- return str;
443
+ return buffer.raw ? INT2FIX(total) : str;
444
444
  }
445
445
 
446
446
  VALUE Backend_read_loop(VALUE self, VALUE io, VALUE maxlen) {
@@ -585,6 +585,7 @@ VALUE Backend_write(VALUE self, VALUE io, VALUE str) {
585
585
  rb_syserr_fail(-result, strerror(-result));
586
586
  else {
587
587
  buffer.base += result;
588
+ buffer.size -= result;
588
589
  left -= result;
589
590
  }
590
591
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polyphony
4
- VERSION = '0.81'
4
+ VERSION = '0.81.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyphony
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.81'
4
+ version: 0.81.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
@@ -232,6 +232,7 @@ files:
232
232
  - examples/core/nested.rb
233
233
  - examples/core/pingpong.rb
234
234
  - examples/core/queue.rb
235
+ - examples/core/raw_buffer_test.rb
235
236
  - examples/core/recurrent-timer.rb
236
237
  - examples/core/resource_delegate.rb
237
238
  - examples/core/ring.rb