From 658bd4e78688701e0bc23c5191820271eef2b5c8 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Thu, 7 Mar 2024 01:11:11 +1300 Subject: [PATCH] Use request ID --- htdocs/always.php | 2 +- inc/CalDAVRequest.php | 3 ++- inc/always.php.in | 11 +++++++---- testing/normalise_result | 4 ++++ testing/regression-conf.php.example | 2 ++ 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/always.php b/htdocs/always.php index c30772d2..c09c9691 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -162,7 +162,7 @@ $c->readonly_webdav_collections = true; // WebDAV access is readonly // Kind of private configuration values $c->total_query_time = 0; -// Any many times GetMoreInstances in inc/RRule.php should loop trying to +// How many times GetMoreInstances in inc/RRule.php should loop trying to // find more instances. $c->rrule_loop_limit = 100; diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 65ff35c7..02021e0e 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -87,7 +87,7 @@ class CalDAVRequest protected $exists; /** - * The value of any 'Destionation:' header, if present. + * The value of any 'Destination:' header, if present. */ var $destination; @@ -1239,6 +1239,7 @@ EOSQL; if ( !headers_sent() ) @header( sprintf("HTTP/1.1 %d %s", $status, getStatusMessage($status)) ); if ( !headers_sent() ) @header( sprintf("X-DAViCal-Version: DAViCal/%d.%d.%d; DB/%d.%d.%d", $c->code_major, $c->code_minor, $c->code_patch, $c->schema_major, $c->schema_minor, $c->schema_patch) ); if ( !headers_sent() ) header( "Content-type: ".$content_type ); + if ( !headers_sent() && $c->test_mode ) header( "Request-ID: " . request_id() ); if ( (isset($c->dbg['ALL']) && $c->dbg['ALL']) || (isset($c->dbg['response']) && $c->dbg['response']) || $status == 400 || $status == 402 || $status == 403 || $status > 404 ) { diff --git a/inc/always.php.in b/inc/always.php.in index c39c4134..a660f079 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -161,13 +161,16 @@ $c->template_usr = array( 'active' => true, $c->hide_TODO = true; // VTODO only visible to collection owner $c->readonly_webdav_collections = true; // WebDAV access is readonly -// Kind of private configuration values -$c->total_query_time = 0; - // Any many times GetMoreInstances in inc/RRule.php should loop trying to // find more instances. $c->rrule_loop_limit = 100; +// Kind of private configuration values +$c->total_query_time = 0; + +// Are we in test mode? +$c->test_mode = false; + $c->dbg = array(); @@ -299,7 +302,7 @@ if ( function_exists('awl_set_locale') ) { * */ $c->code_version = 0; -$c->want_awl_version = 0.64; +$c->want_awl_version = 0.65; $c->version_string = '0.9.9.4'; // The actual version # is replaced into that during the build /release process if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->version_string, $matches) ) { $c->code_major = $matches[1]; diff --git a/testing/normalise_result b/testing/normalise_result index 67b6460e..dec93bd9 100755 --- a/testing/normalise_result +++ b/testing/normalise_result @@ -62,5 +62,9 @@ while( ) { next; }; + /^Request-ID: / && do { + $_ = ""; + }; + print; } diff --git a/testing/regression-conf.php.example b/testing/regression-conf.php.example index 1334fbea..ec4de246 100644 --- a/testing/regression-conf.php.example +++ b/testing/regression-conf.php.example @@ -13,6 +13,8 @@ $c->get_includes_subcollections = true; // helps with 1036-REPORT-sync-initial-bound $c->hide_TODO = false; + // enable test mode + $c->test_mode = true; // for ischedule suite; also needs DKIM set up? $c->enable_scheduling = true;