manticore 0.5.1-java → 0.5.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a487a9db6a178f6e1975c732cc070cd2dd1b705e
4
- data.tar.gz: 33ff881b373187b4beb1102f43cf6c3189b9d9be
3
+ metadata.gz: cad5f48dc039ab74b4f2b3fa2b89dd89d191e698
4
+ data.tar.gz: 073c3ffc96fd07f1f890dbd92941402499e78231
5
5
  SHA512:
6
- metadata.gz: bd3195a6f8c6cc138bdc83c71f69ca38d17129020f4c813afeb57fa831c129d4695584148c810b17c3e282a0befcb53fe03056e6037800408ab3574bb838dc27
7
- data.tar.gz: b9c6099ef28db4ee0336ed15347786ed070a9f3524fbb72a2750c4d7f7402b2cc88bdb3ae49e8f5446533bb3b09bbf0a451755503877cfe4a2bcbf161c6732aa
6
+ metadata.gz: 51eb9d51f07dbed5c006ced4e136790c1332aef91ed4ba0fe2325c30434b9390576ff32e7810dd21e7e809da2d97a02b644a4d2f586999e61265088f4e87b467
7
+ data.tar.gz: fce752a1928db522306e13b93e673cf5c6f67fd51ff83b7345ba5a3a8562992cd6274b1c383200ef304f7fa913964d4b13969f9e329490fd5d616a37ea540acc
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,8 +1,10 @@
1
1
  ## v0.5
2
2
 
3
- ### v0.5.1 (pending)
3
+ ### v0.5.2 (pending)
4
4
 
5
- ### v0.5.0
5
+ * Added Client#close to shut down the connection pool.
6
+
7
+ ### v0.5.1
6
8
 
7
9
  * Upgrade to HTTPClient and HTTPCore 4.5
8
10
  * BREAKING CHANGE: Background request usage has changed. See [this commit](https://github.com/cheald/manticore/commit/174e2004d1865c201daf77494d50ab66527c12aa) for details.
data/lib/manticore.rb CHANGED
@@ -27,6 +27,9 @@ module Manticore
27
27
  # Is something flat out malformed (bad port number?)
28
28
  class InvalidArgumentException < ManticoreException; end
29
29
 
30
+ # The client has been closed so it's no longer usable
31
+ class ClientStoppedException < ManticoreException; end
32
+
30
33
  # Socket breaks, etc
31
34
  class SocketException < ManticoreException; end
32
35
 
@@ -327,6 +327,11 @@ module Manticore
327
327
  end
328
328
  end
329
329
 
330
+ # Free resources associated with the CloseableHttpClient
331
+ def close
332
+ @client.close if @client
333
+ end
334
+
330
335
  # Get at the underlying ExecutorService used to invoke asynchronous calls.
331
336
  def executor
332
337
  create_executor_if_needed
@@ -590,7 +595,7 @@ module Manticore
590
595
  KEY_EXTRACTION_REGEXP = /(?:^-----BEGIN(.* )PRIVATE KEY-----\n)(.*?)(?:-----END\1PRIVATE KEY.*$)/m
591
596
  def setup_key_store(ssl_options, context)
592
597
  key_store = get_store(:keystore, ssl_options) if ssl_options.key?(:keystore)
593
- keystore_password = ssl_options.fetch(:keystore_password, "").to_java.toCharArray
598
+ keystore_password = (ssl_options[:keystore_password] || "").to_java.toCharArray
594
599
 
595
600
  # Support OpenSSL-style bare X.509 certs with an RSA key
596
601
  # This is really dumb - we have to b64-decode the key ourselves, and we can only support PKCS8
@@ -61,6 +61,12 @@ module Manticore
61
61
  ex = Manticore::ResolutionFailure
62
62
  rescue Java::JavaLang::IllegalArgumentException => e
63
63
  ex = Manticore::InvalidArgumentException
64
+ rescue Java::JavaLang::IllegalStateException => e
65
+ if e.message.match(/Connection pool shut down/)
66
+ ex = Manticore::ClientStoppedException
67
+ else
68
+ @exception = e
69
+ end
64
70
  rescue Java::JavaLang::Exception => e # Handle anything we may have missed from java
65
71
  ex = Manticore::UnknownException
66
72
  rescue StandardError => e
@@ -1,3 +1,3 @@
1
1
  module Manticore
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -602,6 +602,14 @@ describe Manticore::Client do
602
602
  end
603
603
  end
604
604
 
605
+ describe "#close" do
606
+ it "makes the client unusable" do
607
+ client.close
608
+ response = client.head(local_server)
609
+ expect { response.body }.to raise_error(Manticore::ClientStoppedException)
610
+ end
611
+ end
612
+
605
613
  describe "keepalive" do
606
614
  let(:url) { "http://www.facebook.com/" }
607
615
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manticore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: java
6
6
  authors:
7
7
  - Chris Heald
@@ -30,7 +30,7 @@ cert_chain:
30
30
  cnyabLOcGIKZNxvnSfwOuCBnjgoSOyJi/n48n1s+OPB/OmPJoWmhKu2DO4sUb4+K
31
31
  /3Mhp5UWSl9SmDR1
32
32
  -----END CERTIFICATE-----
33
- date: 2015-10-07 00:00:00.000000000 Z
33
+ date: 2015-12-02 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file