httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1707969 - /httpd/test/framework/trunk/t/modules/session.t
Date Sun, 11 Oct 2015 12:34:10 GMT
Author: rjung
Date: Sun Oct 11 12:34:10 2015
New Revision: 1707969

URL: http://svn.apache.org/viewvc?rev=1707969&view=rev
Log:
Fix problem in mod_session test when using
big numbers and 32 Bit perl.

Handle the numbers as strings instead.

Modified:
    httpd/test/framework/trunk/t/modules/session.t

Modified: httpd/test/framework/trunk/t/modules/session.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/session.t?rev=1707969&r1=1707968&r2=1707969&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/session.t (original)
+++ httpd/test/framework/trunk/t/modules/session.t Sun Oct 11 12:34:10 2015
@@ -46,7 +46,9 @@ sub check_result
     my $sessionData = $gotSession;
 
     if ($gotSession =~ /^(?:(.+)&)?expiry=([0-9]+)(?:&(.*))?$/i) {
-        my $gotExpiry = $2 / APR_TIME_PER_SEC;
+        # Don't use math ops, $2 is too big for 32 Bit Perl
+        # Use stripping of trailing "0"s instead
+        my $gotExpiry = substr($2, 0, -1 * (length(APR_TIME_PER_SEC) - 1));
         t_debug "expiry of $gotExpiry ($name)";
         ok $expiry && time() < $gotExpiry;
 
@@ -147,7 +149,9 @@ check_custom 'SessionHeader', GET("/sess
     "$session&another=5&last=7", 1;
 
 # SessionMaxAge directive
-my $future_expiry = (time() + 100) * APR_TIME_PER_SEC;
+# Don't use math ops, the result is too big for 32 Bit Perl
+# Use adding of trailing "0"s instead
+my $future_expiry = (time() + 100) . "0" x (length(APR_TIME_PER_SEC) - 1);
 
 check_get 'SessionMaxAge adds expiry', "/on/expire?$session", $session, 0, 1;
 check_get 'Discard expired session', "/on/expire?$session&expiry=1", '', 0, 1;



Mime
View raw message