… | |
… | |
457 | $reply->(0, $_[0]); |
457 | $reply->(0, $_[0]); |
458 | $ns->flush; # does not ensure that the data reaches the client - TODO |
458 | $ns->flush; # does not ensure that the data reaches the client - TODO |
459 | # need to do this in another thread, as this one gets canceled |
459 | # need to do this in another thread, as this one gets canceled |
460 | Coro::async_pool { |
460 | Coro::async_pool { |
461 | Coro::AnyEvent::sleep 0.1; # TODO, see above, extra hack |
461 | Coro::AnyEvent::sleep 0.1; # TODO, see above, extra hack |
462 | $ns->destroy; |
462 | $ns->destroy if $ns->valid; |
463 | }; |
463 | }; |
464 | Coro::schedule; # do the destroy, should not return |
464 | Coro::schedule; # do the destroy, should not return |
465 | }; |
465 | }; |
466 | |
466 | |
467 | $user =~ $VALID_LOGIN |
467 | $user =~ $VALID_LOGIN |
… | |
… | |
491 | $reply->(0, $_[0]); |
491 | $reply->(0, $_[0]); |
492 | $ns->flush; # does not ensure that the data reaches the client - TODO |
492 | $ns->flush; # does not ensure that the data reaches the client - TODO |
493 | # need to do this in another thread, as this one gets canceled |
493 | # need to do this in another thread, as this one gets canceled |
494 | Coro::async_pool { |
494 | Coro::async_pool { |
495 | Coro::AnyEvent::sleep 0.1; # TODO, see above, extra hack |
495 | Coro::AnyEvent::sleep 0.1; # TODO, see above, extra hack |
496 | $ns->destroy; |
496 | $ns->destroy if $ns->valid; |
497 | }; |
497 | }; |
498 | Coro::schedule; # do the destroy, should not return |
498 | Coro::schedule; # do the destroy, should not return |
499 | }; |
499 | }; |
500 | |
500 | |
501 | # try to read the user file and check the password |
501 | # try to read the user file and check the password |