Commit 689de108 authored by Leigh Stoller's avatar Leigh Stoller

Patch in Kevin's delaythresh changes, which warns users when trying

to use a delay value that is too low.
parent adabb1b4
......@@ -1370,6 +1370,7 @@ done
#
......@@ -1432,6 +1433,7 @@ FRISEBEEMCASTADDR="234.5.6"
FRISEBEEMCASTPORT=3564
MIN_UNIX_UID=10000
MIN_UNIX_GID=6000
DELAYTHRESH=2
#
# Okay, I know this is improper usage of --with. Too bad.
......@@ -1933,17 +1935,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1937: checking for $ac_hdr" >&5
echo "configure:1939: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1942 "configure"
#line 1944 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -1982,17 +1984,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1986: checking for $ac_hdr" >&5
echo "configure:1988: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1991 "configure"
#line 1993 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2025,7 +2027,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2029: checking for $ac_word" >&5
echo "configure:2031: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2104,7 +2106,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2108: checking for a BSD compatible install" >&5
echo "configure:2110: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2165,7 +2167,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2169: checking for $ac_word" >&5
echo "configure:2171: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2621,6 +2623,7 @@ s%@CVSSUPPORT@%$CVSSUPPORT%g
s%@CHATSUPPORT@%$CHATSUPPORT%g
s%@MIN_UNIX_UID@%$MIN_UNIX_UID%g
s%@MIN_UNIX_GID@%$MIN_UNIX_GID%g
s%@DELAYTHRESH@%$DELAYTHRESH%g
s%@TBOPSEMAIL@%$TBOPSEMAIL%g
s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g
s%@TBLOGSEMAIL@%$TBLOGSEMAIL%g
......
......@@ -152,6 +152,7 @@ AC_SUBST(CVSSUPPORT)
AC_SUBST(CHATSUPPORT)
AC_SUBST(MIN_UNIX_UID)
AC_SUBST(MIN_UNIX_GID)
AC_SUBST(DELAYTHRESH)
#
# Offer both versions of the email addresses that have the @ escaped
......@@ -213,6 +214,7 @@ FRISEBEEMCASTADDR="234.5.6"
FRISEBEEMCASTPORT=3564
MIN_UNIX_UID=10000
MIN_UNIX_GID=6000
DELAYTHRESH=2
#
# Okay, I know this is improper usage of --with. Too bad.
......
......@@ -119,7 +119,7 @@ use libtblog;
#
# Maximum delay in ms above which a delay node is needed.
# (Note that the DB represents delays as floating point numbers)
my $delaythresh = 2;
my $delaythresh = @DELAYTHRESH@;
# Maximum number of times we run assign.
my $maxrun = 3;
......
......@@ -523,14 +523,19 @@ proc parse_delay {dspec} {
set unit s
}
switch $unit {
s {return [expr int($delay*1000)]}
ms {return [expr int($delay)]}
ns {return [expr int($delay/1000)]}
s {set val [expr $delay*1000]}
ms {set val $delay}
ns {set val [expr $delay/1000]}
default {
perror "Unknown delay unit $unit."
return 0
}
}
if {$val != 0 && $val < @DELAYTHRESH@} {
perror "The delay of ${val}ms is invalid, it must be either 0 or at least @DELAYTHRESH@ms."
return 0
}
return [expr int($val)]
}
# We now have all our infrastructure in place. We are ready to load
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment