Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#349 SecureSocketImpl shutdown/close problem

closed
Net (141)
5
2012-09-14
2010-03-10
No

The SecureSocketImpl has problem with order/meaning of reset/close/shutdown methods.

If one calls close() twice then shutdown will fail with error because one will try to "shutdown" already shutted down/closed socket.

This is because close() shut's down socket and destructor also calls close() (indirectly via reset) without any condition.

Refectoring is needed or shutdown shall check if shutdown is already sent (this is a patch contents).
It might be also feasible for shutdown to check if socket is not closed already ...
or reset() shall not close closed socket ...
Many alternatives possible.

Discussion

  • may
    may
    2010-05-19

    hi

    i have run into same issue as you after upgrading openssl from openssl-0.9.8l to openssl-0.9.8n in production and 1.0 in test lab

    i was getting after upgrade exception
    [Application][E] I/O error: Socket operation attempted on non-socket
    then it crashed

    it seems newer openssl libs make this problem more visible as older version worked w/o issue

    i spent few houres debugging and prepared similar patch
    then i found your ticket and tried your patch and it works good

    i guess more ppl will encounter this issue as they will be upgrading their instalations

    for record zbigx patch works good and tested it under load

    if someone can look into this and integrate into svn

    thx mayburn

     
  • I have integrated the patch into the 1.3.7 branch (rev. 1345).

     
  • may
    may
    2010-05-21

    i have sync to rev. 1345 and tested thoroughly and confirm now vanilla netssl works well

    thx Guenter for your time
    appreciated