Hi developers!
In the scope of downloading the addressbook through a standard interface
for use within asterisk, I have noticed that the
groupdav.php/addressbook/*.vcf files are downloaded with the server
(eGroupware) assuming TCP-Keepalive connection (HTTP 1.1). Simple HTTP
1.0 clients (here: PHP) may not set the “Connection: close” header and a
connection-type of “Close” should be assumed.
I’m not aware you can influence that from PHP. I dont think that’s the
problem.
The below code can be used to visualize the resulting possible problem:
If the “Connection: Close” is not explicitly set in the headers, each
VCF file download leads to a 15 seconds TCP waiting for the TCP timeout,
while the related addressbook listing takes “0 seconds”.
This may be related to problems mentioned on the user’s list
with a slow sync progress and SOGo?
Maybe, you know where the difference between the TCP stream handling /
HTTP 1.0 detection between downloading the addressbook listing and the
single VCF file entries is?
The difference is, that GETs use a Content-Length header telling the
browser beforehand how long the request will be, while PROPFIND and
REPORT uses “chunked” transfer coding.
Maybe for some reason a to long content-length header is sent. That
would cause the client to wait for the “missing” content, 'til it times out.
Can you store a file from a GET and compare it’s length with the
Content-Length header.
Ralf
Best regards,
Hans-Jürgen
<?php
/* Vcards from the collection
* as displayed on the groupdav.php/addressbook
*/
$collections = array(
"http://localhost/egroupware/groupdav.php/addressbook/1.vcf",
"http://localhost/egroupware/groupdav.php/addressbook/2.vcf",
// "http://localhost/egroupware/groupdav.php/addressbook/5.vcf",
// "http://localhost/egroupware/groupdav.php/addressbook/6.vcf",
"http://localhost/egroupware/groupdav.php/addressbook/",
);
$username = "admin";
$password = "admin";
$ctx = array(
'http' => array(
'method' => 'GET',
'header' =>
"Accept: */*\r\n".
// "Connection: Close\r\n".
'Authorization: Basic '.
base64_encode("$username:$password")."\r\n",
'user_agent' => "khtml",
)
);
$context = stream_context_create($ctx);
foreach($collections as $collection) {
print('GET: '.$collection."\n");
$ref = time();
$data = file_get_contents($collection, false, $context);
print("Took: ".(time() - $ref)." seconds.\n");
print("=================\n");
}
?>
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment. Learn More!
http://p.sf.net/sfu/hpdev2dev-nov
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
Director Software Development
Stylite GmbH
[open style of IT]
Morschheimer Strasse 15
67292 Kirchheimbolanden
fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de
www.stylite.de
www.egroupware.org
Geschäftsführer Andre Keller,
Gudrun Müller, Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951
The Next 800 Companies to Lead America’s Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book “Blueprint to a
Billion” shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers