microget 1.1.1 → 1.1.2
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 +4 -4
- data/lib/microget.rb +9 -3
- data/microget.gemspec +3 -3
- 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: 631b5532bb2722b44a6e74512c6de077cbd35a01
|
4
|
+
data.tar.gz: 85d5b26d3c68d3360d94703d67b70d427b93d280
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4445a448dbde63debda28ff7df665a584edfc85cb0ecdb6b4a0251f90a4587096ffbc781370f87a1fc7038f96c9d330ef3a2685e31ef7c7088c96a6189ce2496
|
7
|
+
data.tar.gz: 18b9ddb4c03a9fea12e8726d4595852c500c3ce9131cb94ba320e57b5927338954d6a4e7bfd49cabfce41fd754226f2020564350fea64194d10f5e65e92c04d0
|
data/lib/microget.rb
CHANGED
@@ -5,7 +5,7 @@ require 'socket'
|
|
5
5
|
module Microget
|
6
6
|
autoload :ServerRunner, File.dirname(__FILE__) + '/microget/server_runner'
|
7
7
|
|
8
|
-
VERSION = '1.1.
|
8
|
+
VERSION = '1.1.2'
|
9
9
|
|
10
10
|
extend self
|
11
11
|
|
@@ -75,12 +75,18 @@ module Microget
|
|
75
75
|
# starts to arrive
|
76
76
|
return body_bytes_received unless yield(status_code, header_hash, '')
|
77
77
|
|
78
|
+
# We are using read_nonblock, and it allows a buffer to be passed in.
|
79
|
+
# The advantage of passing a buffer is that the same Ruby string is
|
80
|
+
# reused for all the reads, and only the string contents gets reallocated.
|
81
|
+
# We can reduce GC pressure this way.
|
82
|
+
body_buf = ''
|
83
|
+
|
78
84
|
# ...and then just read the body, without any buffering, using a non-blocking read
|
79
85
|
while !socket.eof?
|
80
86
|
begin
|
81
|
-
data = socket.read_nonblock(chunk_size)
|
87
|
+
data = socket.read_nonblock(chunk_size, body_buf)
|
82
88
|
body_bytes_received += data.bytesize
|
83
|
-
continue_reading = yield(status_code, header_hash,
|
89
|
+
continue_reading = yield(status_code, header_hash, body_buf)
|
84
90
|
return body_bytes_received unless continue_reading
|
85
91
|
rescue IO::WaitReadable
|
86
92
|
IO.select([socket], [], SOCKET_TIMEOUT)
|
data/microget.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: microget 1.1.
|
5
|
+
# stub: microget 1.1.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "microget"
|
9
|
-
s.version = "1.1.
|
9
|
+
s.version = "1.1.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Julik Tarkhanov"]
|
14
|
-
s.date = "2016-
|
14
|
+
s.date = "2016-02-28"
|
15
15
|
s.description = "Pedal-to-the-metal HTTP client for GET requests"
|
16
16
|
s.email = "me@julik.nl"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: microget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puma
|