• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

socketry / socketry / 108 / 1
93%
master: 93%

Build:
DEFAULT BRANCH: master
Ran 26 Nov 2016 08:40PM UTC
Files 21
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Nov 2016 08:34PM UTC coverage: 93.723% (+0.02%) from 93.705%
2.2.6

push

travis-ci

tarcieri
Fix Socketry::SSL::Socket#close

124a50a0 introduced a regression in the close behavior on Ruby 2.2.x
by adding the following line:

    @ssl_socket.sync_close = true

This closes the underlying TCP socket when the OpenSSL::SSL::SSLSocket wrapping
it is closed.

Unfortunately Socketry::SSL::Socket#close was calling "super" which invoked the
corresponding ::TCPSocket close methods, but at the *end* after closing the
OpenSSL::SSL::SSLSocket, which already took care of closing the ::TCPSocket
thanks to `#sync_close = true`

We still want to call super though, to ensure the instance variables associated
with the TCP socket are properly cleared.

Solution: call `super` *first* to close the TCP socket and clear the associated
instance variables, then close the OpenSSL::SSL::SSLSocket. This ensures both
are closed, their associated instance variables cleared, and won't error out if
the TCP socket is already closed.

This should ensure that all sockets are closed in all cases, even if someone
manages to obtain the raw OpenSSL::SSL::SSLSocket or its underlying ::TCPSocket.

657 of 701 relevant lines covered (93.72%)

6.05 hits per line

Source Files on job 108.1 (2.2.6)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 108
  • Travis Job 108.1
  • 2a5a6ab2 on github
  • Prev Job for 2.2.6 on master (#107.1)
  • Next Job for 2.2.6 on master (#109.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc