From 2f9d089ec33dd606824c11a508dbc06a0cf8dfaa Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 12 May 2017 20:04:50 +0100 Subject: [PATCH] fix AsyncMsg.pm + clusteraddr issues --- perl/AsyncMsg.pm | 14 +++++++------- perl/cluster.pl | 14 +++++++++++--- perl/console.pl | 5 ++++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/perl/AsyncMsg.pm b/perl/AsyncMsg.pm index c2eeaadc..e6ae80c6 100644 --- a/perl/AsyncMsg.pm +++ b/perl/AsyncMsg.pm @@ -181,20 +181,20 @@ sub _getpost $r = $conn->connect($host, $port); if ($r) { - dbg("Sending '$sort $path HTTP/1.0'") if isdbg('async'); - $conn->send_later("$sort $path HTTP/1.0\n"); + dbg("Sending '$sort $path HTTP/1.1'") if isdbg('async'); + $conn->send_later("$sort $path HTTP/1.1\r\n"); my $h = delete $args{Host} || $host; my $u = delete $args{'User-Agent'} || "DxSpider;$main::version;$main::build;$^O;$main::mycall"; my $d = delete $args{data}; - $conn->send_later("Host: $h\n"); - $conn->send_later("User-Agent: $u\n"); + $conn->send_later("Host: $h\r\n"); + $conn->send_later("User-Agent: $u\r\n"); while (my ($k,$v) = each %args) { - $conn->send_later("$k: $v\n"); + $conn->send_later("$k: $v\r\n"); } - $conn->send_later("\n$d") if defined $d; - $conn->send_later("\n"); + $conn->send_later("\r\n$d") if defined $d; + $conn->send_later("\r\n"); } return $r ? $conn : undef; diff --git a/perl/cluster.pl b/perl/cluster.pl index 0db8e0bc..b9031719 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -15,7 +15,15 @@ require 5.004; package main; # set default paths, these should be overwritten by DXVars.pm -use vars qw($data $system $cmd $localcmd $userfn); +use vars qw($data $system $cmd $localcmd $userfn $clusteraddr $clusterport $yes $no $user_interval $lang); + +$lang = 'en'; # default language +$clusteraddr = '127.0.0.1'; # cluster tcp host address - used for things like console.pl +$clusterport = 27754; # cluster tcp port +$yes = 'Yes'; # visual representation of yes +$no = 'No'; # ditto for no +$user_interval = 11*60; # the interval between unsolicited prompts if no traffic + # make sure that modules are searched in the order local then perl BEGIN { @@ -128,8 +136,8 @@ package main; use strict; use vars qw(@inqueue $systime $starttime $lockfn @outstanding_connects - $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr - $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting + $zombies $root @listeners $lang $myalias @debug $userfn + $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart $can_encode $maxconnect_user $maxconnect_node ); diff --git a/perl/console.pl b/perl/console.pl index f85e235d..2c8c456b 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -16,7 +16,10 @@ require 5.004; package main; -use vars qw($data); +use vars qw($data $clusteraddr $clusterport); + +$clusteraddr = '127.0.0.1'; # cluster tcp host address - used for things like console.pl +$clusterport = 27754; # cluster tcp port # search local then perl directories BEGIN { -- 2.43.0