The final revision of the sync-collection report requires the token to be a URI.

We'll use a 'data' URI (like CalendarServer does) to jump through this
arbitrary hoop.
This commit is contained in:
Andrew McMillan 2011-10-03 16:29:11 +02:00
parent 31ed1a4188
commit 323e6a3011
8 changed files with 24 additions and 24 deletions

View File

@ -17,7 +17,7 @@ $responses = array();
$sync_tokens = $xmltree->GetPath('/DAV::sync-collection/DAV::sync-token');
$sync_token = $sync_tokens[0]->GetContent();
if ( !isset($sync_token) ) $sync_token = 0;
$sync_token = intval($sync_token);
$sync_token = intval(str_ireplace('data:,', '', $sync_token ));
dbg_error_log( 'sync', " sync-token: %s", $sync_token );
@ -59,7 +59,7 @@ $new_token = $row->new_sync_token;
if ( $sync_token == $new_token ) {
// No change, so we just re-send the old token.
$responses[] = new XMLElement( 'sync-token', $new_token );
$responses[] = new XMLElement( 'sync-token', 'data:,'.$new_token );
}
else {
if ( $sync_token == 0 ) {
@ -142,7 +142,7 @@ EOSQL;
$last_dav_name = $object->dav_name;
}
}
$responses[] = new XMLElement( 'sync-token', $new_token );
$responses[] = new XMLElement( 'sync-token', 'data:,'.$new_token );
}
else {
$request->DoResponse( 500, translate("Database error") );

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "53ade6e4324c9f7e2060a4e760bda6f5"
Content-Length: 2286
ETag: "f7758fc9ba3182e47aba690683524e55"
Content-Length: 2292
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -89,5 +89,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>5</sync-token>
<sync-token>data:,5</sync-token>
</multistatus>

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "c07ace186b168e6268fce37c17ae7896"
Content-Length: 942
ETag: "3446b8401735be64ec24b3e1af5362db"
Content-Length: 948
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -38,5 +38,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>6</sync-token>
<sync-token>data:,6</sync-token>
</multistatus>

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "246e590e6b688fd0a7b2397368de6b52"
Content-Length: 1788
ETag: "f0c7bfe2540087faa968b4a4321f8953"
Content-Length: 1794
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -71,5 +71,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>7</sync-token>
<sync-token>data:,7</sync-token>
</multistatus>

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "68077b6249044e2937b6d0119c0eb656"
Content-Length: 354
ETag: "428b3b0b0de29ffd0f827a6a9d36ab26"
Content-Length: 360
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -17,5 +17,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>1</sync-token>
<sync-token>data:,1</sync-token>
</multistatus>

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "745883b4e0a01c261f2ae80105258a14"
Content-Length: 4024
ETag: "4455c8df8e5a0572ba52dccb00843cfe"
Content-Length: 4030
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -152,5 +152,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>2</sync-token>
<sync-token>data:,2</sync-token>
</multistatus>

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "41c9017eda1f4a021c881f217b97407a"
Content-Length: 3780
ETag: "a4ec15e128c8e06e81c57af754448f81"
Content-Length: 3786
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -143,5 +143,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>3</sync-token>
<sync-token>data:,3</sync-token>
</multistatus>

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "f1d7fb1befbea4830cd1afc134974fc4"
Content-Length: 5873
ETag: "40e69ecd1e31ae458e1fa4505c1ee585"
Content-Length: 5879
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -192,5 +192,5 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>4</sync-token>
<sync-token>data:,4</sync-token>
</multistatus>