Skip Menu |
 

This queue is for tickets about the Net-Daemon CPAN distribution.

Report information
The Basics
Id: 65735
Status: resolved
Worked: 3 hours (180 min)
Priority: 0/
Queue: Net-Daemon

People
Owner: MNOONING [...] cpan.org
Requestors: gasparch [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: fixing problems with Net::Daemon:SSL and connection close
Date: Tue, 15 Feb 2011 13:04:27 +0400
To: bug-Net-Daemon [...] rt.cpan.org
From: Gaspar Chilingarov <gasparch [...] gmail.com>
Download (untitled) / with headers
text/plain 655b
Hi there! There are some little flaw in Net::Daemon, that prevents Net::Daemon::SSL to fail. In fork mode, in case of SSL you cannot just close the socket - you should pass additional parameters in parent to prevent SSL shutdown, you just need to close FD. And calling close() without arguments on IO::Socket::SSL causes shutdown, so additional arguments need to be passed. Here is a small patch, that allows override server close call in any child class. /Gaspar -- Gaspar Chilingarov tel +37493 419763 (mobile - leave voice mail message) icq 63174784 skype://gasparch e mailto:nm@web.am mailto:gasparch@gmail.com w http://gasparchilingarov.com/
Download patch.txt
text/plain 180b

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #65735] fixing problems with Net::Daemon:SSL and connection close
Date: Tue, 15 Feb 2011 09:40:36 -0500
To: bug-Net-Daemon [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
Thank you very much, Gaspar.

I will apply the patch in a few weeks or so.  It wll take me that long, in-between other tasks, to once again figure out how to do everything.

I am indeed the code maintainer, but I actually do not know the code.  I have always depended upon people such as yourself to suggest patches.  I will apply the patch and test it on Windows and Fedora, and if everything goes well, I will upload a new version.


On 2/15/2011 4:05 AM, Gaspar Chilingarov via RT wrote: Show quoted text
Tue Feb 15 04:05:10 2011: Request 65735 was acted upon.
Transaction: Ticket created by gasparch@gmail.com
       Queue: Net-Daemon
     Subject: fixing problems with Net::Daemon:SSL and connection close
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: gasparch@gmail.com
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65735 >


Hi there!

There are some little flaw in Net::Daemon, that prevents
Net::Daemon::SSL to fail.

In fork mode, in case of SSL you cannot just close the socket - you
should pass additional parameters in parent to prevent SSL shutdown,
you just need to close FD.
And calling close() without arguments on IO::Socket::SSL causes
shutdown, so additional arguments need to be passed.

Here is a small patch, that allows override server close call in any
child class.


/Gaspar



No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3443 - Release Date: 02/14/11

Subject: Re: [rt.cpan.org #65735] fixing problems with Net::Daemon:SSL and connection close
Date: Wed, 16 Feb 2011 14:57:33 -0500
To: bug-Net-Daemon [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
I am sorry Gaspar, but I cannot apply this patch.  The problem is that, for one, Net::Daemon does not use Net::Daemon::SSL.  The Net::Daemon::SSL module is not part of the Net::Daemon suite.  The Net::Daemon::SSL code, by the way, is maintained by Michael Kulakov.

There is also an issue in that the Net::Daemon::SSL module has a dependency upon Net::Daemon.

Within Daemon.pm, ,  changing the line "close($client);" to "$self->ServClose($client);" does not seem to make sense, as "$self" does not have a ServClose function.

Further, I cannot "use Net::Daemon::SSL" within Net::Daemon and try to rewrite the code because that would make for a circular dependency.  Again, Net::Daemon::SSL already depends upon Net::Daemon.

I do not know threads programming, or SSL.  Can you or anyone else comment further on this issue?



On 2/15/2011 9:40 AM, Malcolm Nooning via RT wrote: Show quoted text
       Queue: Net-Daemon
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=65735 >

 Thank you very much, Gaspar.

I will apply the patch in a few weeks or so. It wll take me that long,
in-between other tasks, to once again figure out how to do everything.

I am indeed the code maintainer, but I actually do not know the code. I have
always depended upon people such as yourself to suggest patches. I will apply
the patch and test it on Windows and Fedora, and if everything goes well, I
will upload a new version.


On 2/15/2011 4:05 AM, Gaspar Chilingarov via RT wrote:

  Tue Feb 15 04:05:10 2011: Request 65735 was acted upon.
  Transaction: Ticket created by   gasparch@gmail.com         Queue: Net-Daemon
       Subject: fixing problems with Net::Daemon:SSL and connection close
     Broken in: (no value)
      Severity: (no value)
         Owner: Nobody
    Requestors:   gasparch@gmail.com        Status: new
   Ticket <URL:   https://rt.cpan.org/Ticket/Display.html?id=65735   >
  
  
  Hi there!
  
  There are some little flaw in Net::Daemon, that prevents
  Net::Daemon::SSL to fail.
  
  In fork mode, in case of SSL you cannot just close the socket - you
  should pass additional parameters in parent to prevent SSL shutdown,
  you just need to close FD.
  And calling close() without arguments on IO::Socket::SSL causes
  shutdown, so additional arguments need to be passed.
  
  Here is a small patch, that allows override server close call in any
  child class.
  
  
  /Gaspar




  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 10.0.1204 / Virus Database: 1435/3443 - Release Date: 02/14/11



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3445 - Release Date: 02/15/11


Subject: Re: [rt.cpan.org #65735] fixing problems with Net::Daemon:SSL and connection close
Date: Thu, 17 Feb 2011 00:31:47 +0400
To: bug-Net-Daemon [...] rt.cpan.org
From: Gaspar Chilingarov <gasparch [...] gmail.com>
Download (untitled) / with headers
text/plain 3.8k
Hi Malcolm! 2011/2/16 Malcolm Nooning via RT <bug-Net-Daemon@rt.cpan.org>: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=65735 > > >  I am sorry Gaspar, but I cannot apply this patch. The problem is that, for > one, Net::Daemon does not use Net::Daemon::SSL. The Net::Daemon::SSL module is > not part of the Net::Daemon suite. The Net::Daemon::SSL code, by the way, is > maintained by Michael Kulakov.
I know, that Net::Daemon does not use the Net::Daemon:SSL. The patch to Net::Daemon is necessary to make further changes in Net::Daemon:SSL to make it work with sockets normally. Right now Net::Daemon:SSL has no ways to hook into Net::Daemon's server socket closing sequence. So this patch is only to make Net::Daemon framework more friendly to descendant modules. Show quoted text
> > There is also an issue in that the Net::Daemon::SSL module has a dependency > upon Net::Daemon. > > Within Daemon.pm, , changing the line "close($client);" to > "$self->ServClose($client);" does not seem to make sense, as "$self" does not > have a ServClose function.
check the patch again - ServClose function added by patch as well. this part of patch adds the method! sub ServClose { my $self = shift; my $socket = shift; $socket->close() if $socket; } Show quoted text
> > Further, I cannot "use Net::Daemon::SSL" within Net::Daemon and try to rewrite > the code because that would make for a circular dependency. Again, > Net::Daemon::SSL already depends upon Net::Daemon. >
Forget about Net::Daemon:SSL. :)))) It is just a patch to make server close overridable in child classes, nothing more. Show quoted text
> I do not know threads programming, or SSL. Can you or anyone else comment > further on this issue? > > > > On 2/15/2011 9:40 AM, Malcolm Nooning via RT wrote: > >         Queue: Net-Daemon >   Ticket <URL:   https://rt.cpan.org/Ticket/Display.html?id=65735   > > >   Thank you very much, Gaspar. > >  I will apply the patch in a few weeks or so. It wll take me that long, >  in-between other tasks, to once again figure out how to do everything. > >  I am indeed the code maintainer, but I actually do not know the code. I have >  always depended upon people such as yourself to suggest patches. I will apply >  the patch and test it on Windows and Fedora, and if everything goes well, I >  will upload a new version. > > >  On 2/15/2011 4:05 AM, Gaspar Chilingarov via RT wrote: > >    Tue Feb 15 04:05:10 2011: Request 65735 was acted upon. >    Transaction: Ticket created by     gasparch@gmail.com           Queue: Net-Daemon >         Subject: fixing problems with Net::Daemon:SSL and connection close >       Broken in: (no value) >        Severity: (no value) >           Owner: Nobody >      Requestors:     gasparch@gmail.com          Status: new >     Ticket <URL:     https://rt.cpan.org/Ticket/Display.html?id=65735     > > > >    Hi there! > >    There are some little flaw in Net::Daemon, that prevents >    Net::Daemon::SSL to fail. > >    In fork mode, in case of SSL you cannot just close the socket - you >    should pass additional parameters in parent to prevent SSL shutdown, >    you just need to close FD. >    And calling close() without arguments on IO::Socket::SSL causes >    shutdown, so additional arguments need to be passed. > >    Here is a small patch, that allows override server close call in any >    child class. > > >    /Gaspar > > > > >    No virus found in this message. >    Checked by AVG -   www.avg.com    Version: 10.0.1204 / Virus Database: 1435/3443 - Release Date: 02/14/11 > > > >  ----- >  No virus found in this message. >  Checked by AVG -   www.avg.com  Version: 10.0.1204 / Virus Database: 1435/3445 - Release Date: 02/15/11 > > > >
-- Gaspar Chilingarov tel +37493 419763 (mobile - leave voice mail message) icq 63174784 skype://gasparch e mailto:nm@web.am mailto:gasparch@gmail.com w http://gasparchilingarov.com/
Subject: Re: [rt.cpan.org #65735] fixing problems with Net::Daemon:SSL and connection close
Date: Thu, 17 Feb 2011 12:21:16 -0500
To: bug-Net-Daemon [...] rt.cpan.org
From: Malcolm Nooning <m.nooning [...] comcast.net>
Download (untitled) / with headers
text/plain 3.9k
Yes, you are right. I will get busy on it before too long. Thanks again for the patch. On 2/16/2011 3:37 PM, Gaspar Chilingarov via RT wrote: Show quoted text
> Queue: Net-Daemon > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=65735> > > Hi Malcolm! > > 2011/2/16 Malcolm Nooning via RT<bug-Net-Daemon@rt.cpan.org>:
>> <URL: http://rt.cpan.org/Ticket/Display.html?id=65735> >> >> I am sorry Gaspar, but I cannot apply this patch. The problem is that, for >> one, Net::Daemon does not use Net::Daemon::SSL. The Net::Daemon::SSL module is >> not part of the Net::Daemon suite. The Net::Daemon::SSL code, by the way, is >> maintained by Michael Kulakov.
> I know, that Net::Daemon does not use the Net::Daemon:SSL. > The patch to Net::Daemon is necessary to make further changes in > Net::Daemon:SSL to make it work with sockets normally. > Right now Net::Daemon:SSL has no ways to hook into Net::Daemon's > server socket closing sequence. > So this patch is only to make Net::Daemon framework more friendly to > descendant modules. > >
>> There is also an issue in that the Net::Daemon::SSL module has a dependency >> upon Net::Daemon. >> >> Within Daemon.pm, , changing the line "close($client);" to >> "$self->ServClose($client);" does not seem to make sense, as "$self" does not >> have a ServClose function.
> check the patch again - ServClose function added by patch as well. > > this part of patch adds the method! > sub ServClose { > my $self = shift; > my $socket = shift; > $socket->close() if $socket; > } > >
>> Further, I cannot "use Net::Daemon::SSL" within Net::Daemon and try to rewrite >> the code because that would make for a circular dependency. Again, >> Net::Daemon::SSL already depends upon Net::Daemon. >>
> Forget about Net::Daemon:SSL. :)))) It is just a patch to make server > close overridable in child classes, > nothing more. >
>> I do not know threads programming, or SSL. Can you or anyone else comment >> further on this issue? >> >> >> >> On 2/15/2011 9:40 AM, Malcolm Nooning via RT wrote: >> >> Queue: Net-Daemon >> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=65735> >> >> Thank you very much, Gaspar. >> >> I will apply the patch in a few weeks or so. It wll take me that long, >> in-between other tasks, to once again figure out how to do everything. >> >> I am indeed the code maintainer, but I actually do not know the code. I have >> always depended upon people such as yourself to suggest patches. I will apply >> the patch and test it on Windows and Fedora, and if everything goes well, I >> will upload a new version. >> >> >> On 2/15/2011 4:05 AM, Gaspar Chilingarov via RT wrote: >> >> Tue Feb 15 04:05:10 2011: Request 65735 was acted upon. >> Transaction: Ticket created by gasparch@gmail.com Queue: Net-Daemon >> Subject: fixing problems with Net::Daemon:SSL and connection close >> Broken in: (no value) >> Severity: (no value) >> Owner: Nobody >> Requestors: gasparch@gmail.com Status: new >> Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=65735> >> >> >> Hi there! >> >> There are some little flaw in Net::Daemon, that prevents >> Net::Daemon::SSL to fail. >> >> In fork mode, in case of SSL you cannot just close the socket - you >> should pass additional parameters in parent to prevent SSL shutdown, >> you just need to close FD. >> And calling close() without arguments on IO::Socket::SSL causes >> shutdown, so additional arguments need to be passed. >> >> Here is a small patch, that allows override server close call in any >> child class. >> >> >> /Gaspar >> >> >> >> >> No virus found in this message. >> Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3443 - Release Date: 02/14/11 >> >> >> >> ----- >> No virus found in this message. >> Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3445 - Release Date: 02/15/11 >> >> >> >>
> >
Subject: fixing problems with Net::Daemon and connection close
From: m.nooning [...] comcast.net
Download (untitled) / with headers
text/plain 424b
The patch by Gaspar Chilingarov works. So does the Daniel Macks and Joe McMahon work. Thank you so much, gentlemen. I combined the work of everyone, labeled it version 0.45, did a "make dist" to create Net-Daemon-0.45.tar.gz, tested it on Windows XP and Red Hat Fedora, then uploaded Net-Daemon-0.45.tar.gz to CPAN. It should show up on CPAN by tomorrow. Again, thank you very much for your suggestions and code.
Download (untitled) / with headers
text/plain 237b
Try Net-Daemon-0.46 I tried Net-Daemon-0.46 on Windows, Fedora Linux from a few months ago, then updated the Fedora and it still passes, so it looks like version 0.46 is a winner. Again, thank you very, very much for all of your help.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.