version 1.228, 2004/08/10 22:55:31
|
version 1.229, 2004/08/16 10:54:19
|
Line 1872 sub token_auth_user_file_handler {
|
Line 1872 sub token_auth_user_file_handler {
|
} |
} |
|
|
®ister_handler("tokenauthuserfile", \&token_auth_user_file_handler, 0,1,0); |
®ister_handler("tokenauthuserfile", \&token_auth_user_file_handler, 0,1,0); |
|
|
|
|
|
# |
|
# Unsubscribe from a resource. |
|
# |
|
# Parameters: |
|
# $cmd - The command that got us here. |
|
# $tail - Tail of the command (remaining parameters). |
|
# $client - File descriptor connected to client. |
|
# Returns |
|
# 0 - Requested to exit, caller should shut down. |
|
# 1 - Continue processing. |
|
# |
|
sub unsubscribe_handler { |
|
my ($cmd, $tail, $client) = @_; |
|
|
|
my $userinput= "$cmd:$tail"; |
|
|
|
my ($fname) = split(/:/,$tail); # Split in case there's extrs. |
|
|
|
&Debug("Unsubscribing $fname"); |
|
if (-e $fname) { |
|
&Debug("Exists"); |
|
&Reply($client, &unsub($fname,$clientip), $userinput); |
|
} else { |
|
&Failure($client, "not_found\n", $userinput); |
|
} |
|
return 1; |
|
} |
|
®ister_handler("unsub", \&unsubscribe_handler, 0, 1, 0); |
|
|
#--------------------------------------------------------------- |
#--------------------------------------------------------------- |
# |
# |
# Getting, decoding and dispatching requests: |
# Getting, decoding and dispatching requests: |
Line 1987 sub process_request {
|
Line 2018 sub process_request {
|
|
|
|
|
|
|
# ----------------------------------------------------------------- unsubscribe |
|
if ($userinput =~ /^unsub/) { |
|
if(isClient) { |
|
my ($cmd,$fname)=split(/:/,$userinput); |
|
if (-e $fname) { |
|
print $client &unsub($fname,$clientip); |
|
} else { |
|
print $client "not_found\n"; |
|
} |
|
} else { |
|
Reply($client, "refused\n", $userinput); |
|
|
|
} |
|
# ------------------------------------------------------------------- subscribe |
# ------------------------------------------------------------------- subscribe |
} elsif ($userinput =~ /^sub/) { |
if ($userinput =~ /^sub/) { |
if(isClient) { |
if(isClient) { |
print $client &subscribe($userinput,$clientip); |
print $client &subscribe($userinput,$clientip); |
} else { |
} else { |