lafikl / yubico-yubiserve

Automatically exported from code.google.com/p/yubico-yubiserve
GNU General Public License v3.0
1 stars 0 forks source link

"while 1" at the end of yubiserve.py #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed the :
  while 1:
          time.sleep(1)
at the end of yubiserve.py.

I am not a python expert but that seems not very good.

If you remove :
  http_thread.setDaemon(True)
  ssl_thread.setDaemon(True)

you can remove the "while 1" block with no harm.

Regards

Original issue reported on code.google.com by maxime.d...@gmail.com on 12 Mar 2013 at 4:41

GoogleCodeExporter commented 9 years ago
I've just tried your changes.  The unit tests  pass, but, when I start 
yubiserve.py from the command line, crtl-c no longer works to stop it.

This link might offer some details:
http://www.regexprn.com/2010/05/killing-multithreaded-python-programs.html

I am not expert enough to solve this, and think that it does need to respond to 
ctrl-c.

If you can provide a patch that works, and keeps ctrl-c also working, I would 
be happy to accept it.

Original comment by glen.ogilvie@gmail.com on 12 Mar 2013 at 9:46

GoogleCodeExporter commented 9 years ago
Hello

Here is the patch ;-)

I also change call to "quit()"  to "sys.exit(0)" since :
"useful for the interactive interpreter shell and should not be used in 
programs."
from :
http://docs.python.org/2/library/constants.html#constants-added-by-the-site-modu
le

Regards

Original comment by maxime.d...@gmail.com on 13 Mar 2013 at 8:27

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Maxime, 
Thank you for the patch. I've applied it, as SVN Rev: 63.

If you are interested in working on the project more, then we may be able to 
give you commit access.

Original comment by glen.ogilvie@gmail.com on 17 Mar 2013 at 9:33

GoogleCodeExporter commented 9 years ago
> If you are interested in working on the project more, then we may be able to 
give you commit access.
Thanks a lot, but not for now.

Original comment by maxime.d...@gmail.com on 18 Mar 2013 at 7:10