Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't leave eval via next #17

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/DJabberd.pm
Expand Up @@ -461,12 +461,12 @@ sub _load_config_ref {
my $meth = "set_config_$key";
if ($inv->can($meth)) {
$inv->$meth($val);
next;
return;
}
$meth = "set_config__option";
if ($inv->can($meth)) {
$inv->$meth($key, $val);
next;
return;
}

die "Unknown option '$pkey'\n";
Expand All @@ -475,15 +475,15 @@ sub _load_config_ref {
die "Can't configure a vhost in a vhost\n" if $vhost;
$vhost = DJabberd::VHost->new(server_name => $1);
$vhost->set_server($self);
next;
return;
}
if ($line =~ m!</VHost>!i) {
die "Can't end a not-open vhost\n" unless $vhost;
die "Can't end a vhost with an open plugin\n" if $plugin;
die "Can't end a vhost with an open subdomain\n" if @vhost_stack;
$self->add_vhost($vhost);
$vhost = undef;
next;
return;
}
if ($line =~ /<Subdomain\s+(\S+?)>/i) {
die "Subdomain blocks can only inside VHost\n" unless $vhost;
Expand All @@ -505,13 +505,13 @@ sub _load_config_ref {
$old_vhost->add_plugin($ld1);
$vhost->add_plugin($ld2);

next;
return;
}
if ($line =~ m!</Subdomain>!i) {
die "Extraneous subdomain end\n" unless @vhost_stack;
$self->add_vhost($vhost);
$vhost = pop @vhost_stack;
next;
return;
}
my $close_plugin = sub {
die "Can't end a not-open plugin\n" unless $plugin;
Expand All @@ -530,11 +530,11 @@ sub _load_config_ref {
die "Failed to load plugin $class: $@" if $@;
$plugin = $class->new;
$close_plugin->() if $immediate_close;
next;
return;
}
if ($line =~ m!</Plugin>!i) {
$close_plugin->();
next;
return;
}

die "Syntax error: '$line'\n";
Expand Down