Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

resolve most problems when executing with plackup

  • Loading branch information...
commit 768b13144760f31d6313c520d494e18f1842505f 1 parent 9bec34c
@lstein lstein authored
View
7 cgi-bin/gbrowse_img
@@ -98,11 +98,7 @@ sub run {
# work around PSGI signal munging
local *SIG = *CORE::SIG;
- local $SIG{CHLD} = sub {
- while ((my $kid = waitpid(-1,WNOHANG))>0) {
- 1;
- }
- };
+ local $SIG{CHLD} = sub {while ((my $kid = waitpid(-1,POSIX::WNOHANG))>0) {1}};
my $render = $self->render;
$render->set_details_multiplier(1);
@@ -145,6 +141,7 @@ sub run {
}
$self->render_image();
+ $self->session->unlock();
return;
}
View
2  lib/Bio/Graphics/Browser2.pm
@@ -140,6 +140,8 @@ sub gbrowse_base {
my $url = CGI::url();
my $source = $self->get_source_from_cgi;
$source = CGI::escape($source);
+ # work around PSGI inconsistencies in CGI emulation
+ $url =~ s!/$source/?!!;
$url =~ s!/[^/]*$!!;
return ($url,$source);
}
View
3  lib/Bio/Graphics/Browser2/Action.pm
@@ -88,7 +88,8 @@ sub handle_legacy_calls {
# redirect to the imagelink
if (my $format = $q->param('make_image')) {
- return (302,undef,$render->image_link($render->state,$format));
+ my $link = $render->image_link($render->state,$format);
+ return (302,undef,$link);
}
if ($q->param('clear_dsn') || $q->param('reset_dsn')) {
View
5 lib/Bio/Graphics/Browser2/Render.pm
@@ -239,6 +239,7 @@ sub run {
url(-path=>1),' ',
query_string() if $debug || TRACE_RUN;
warn "[$$] session id = ",$self->session->id if $debug;
+ $self->set_source && return;
my $session = $self->session;
my $source = $self->data_source;
@@ -322,13 +323,13 @@ sub set_source {
my $request = CGI::unescape(CGI::request_uri());
my $source_str = CGI::unescape("/$source/");
- if ($request !~ /$source_str/) {
+ if ($request !~ /$source_str($|\?)/) {
my $args = CGI::query_string();
my $url = CGI::url(-absolute=>1,-path_info=>0);
$url =~ s!(gbrowse[^/]*)(?\!.*gbrowse)/.+$!$1!; # fix CGI/Apache bug
$url .= "/$source/";
+ $url =~ s!//!/!g;
$url .= "?$args" if $args && $args !~ /^source=/;
- warn "redirect to $url";
print CGI::redirect($url);
return 1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.