summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjake <jake@jakes-mail.top>2022-01-24 19:31:39 -0500
committerjake <jake@jakes-mail.top>2022-01-24 19:31:39 -0500
commit18f31663164a4a4e9c767be84a195d6736ee3326 (patch)
treee8bab3204345fe2d2ac78dded66517b9c0c1b737
parent41d92d896455673a1fad4b3192b337f02f6d06f3 (diff)
client will close, so ports do not clog up
-rwxr-xr-xgmi.pl15
1 files changed, 10 insertions, 5 deletions
diff --git a/gmi.pl b/gmi.pl
index 7ef0ca9..8516a3e 100755
--- a/gmi.pl
+++ b/gmi.pl
@@ -10,7 +10,7 @@ use utf8;
use feature qw(refaliasing);
no warnings qw(experimental::refaliasing);
-our $VERSION = 'v0.0.25';
+our $VERSION = 'v0.0.26';
# TODO:
# back() only works once; should fix this
@@ -101,8 +101,8 @@ my %commands = (
'd' => [sub { display() }, 'Alias of `display\'.' ],
'usepager' => [sub { toggle($use_pager) }, 'This toggles pager use. 1 = use pager, 0 = stdout.' ],
- 'pretty_links' => [sub { toggle($pretty_links) }, "0 = do nothing, 1 = pretty. Currently $pretty_links."],
- 'pretty_headers' => [sub { toggle($pretty_headers) }, "0 = do nothing, 1 = pretty. Currently $pretty_headers."],
+ 'pretty_links' => [sub { toggle($pretty_links) }, "0 = do nothing, 1 = pretty."],
+ 'pretty_headers' => [sub { toggle($pretty_headers) }, "0 = do nothing, 1 = pretty."],
'textwrap' => [sub { textwrap($_[0]) }, "Set textwrap length.\nGiving 'auto' will " .
"automatically determine the appropriate length."],
'pager' => [sub { pager($_[0]) }, "Set which pager to use. (currently $ENV{PAGER})"],
@@ -111,7 +111,8 @@ my %commands = (
'ver' => [sub {print $OUT "$VERSION\n"}, "Returns the version ($VERSION)"],
'exit' => [sub {exit 0;}, "This exits the program with a status code of 0."],
- 'autoredirection' => [sub { value_number($auto_redirect,$_[0],'autoredirect') }, "The amount of times this program is allowed to auto redirect. 0 = none."],
+ 'autoredirection' => [sub { value_number($auto_redirect,$_[0],'autoredirect') },
+ "The amount of times this program is allowed to auto redirect. 0 = none."],
'timeout' => [sub { value_number($timeout,$_[0],'timeout') },
"The client will time out when the server takes too long." ],
@@ -199,7 +200,9 @@ sub url {
PeerPort => "$url->{port}",
SSL_verify_mode => SSL_VERIFY_NONE,
+ SSL_verifycn_name => "$url->{host}",
SSL_version => '!SSLv2:!SSLv3:!TLSv1:!TLSv1_1',
+ SSL_fast_shutdown => 1,
Timeout => 2,
);
@@ -220,7 +223,8 @@ sub url {
print $cl "$current_url\r\n";
@doc = <$cl>;
- # ["absolute_url", "description"]
+
+ close($cl); # if this isnt here, the kernel will have to clean up unused ports
alarm 0;
};
@@ -233,6 +237,7 @@ sub url {
follow_status_code();
}
}
+
else {
print $OUT "error=$!, ssl_error=$SSL_ERROR\n";
}