ConnectionStatus.Username = ConnectionData.Username;
ConnectionStatus.Prefix = ConnectionData.Prefix;
ConnectionStatus.UseSSL = ConnectionData.UseSSL;
+ ConnectionStatus.Timeout = ConnectionData.Timeout;
return ConnectionStatus;
curl_easy_setopt(ConnectionHandle, CURLOPT_USERPWD, ServerUserPass.c_str());
curl_easy_setopt(ConnectionHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_easy_setopt(ConnectionHandle, CURLOPT_FAILONERROR, 1L);
+ curl_easy_setopt(ConnectionHandle, CURLOPT_TIMEOUT, ConnectionData.Timeout);
curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEFUNCTION, CalDAVOutput);
curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEDATA, &ServerData);
curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEHEADER, &ServerHeader);
// (*nix version) Setup an inital connection on a server where
// a timeout occurs.
+ ConnTimeout.Timeout = 5;
+
CalDAV CalDAVTimeout;
CalDAVTimeout.SetupConnectionData(&ConnTimeout);
ASSERT_EQ(CalDAVTimeoutStatus.Username, ConnTimeout.Username);
ASSERT_EQ(CalDAVTimeoutStatus.Port, ConnTimeout.Port);
ASSERT_EQ(CalDAVTimeoutStatus.Prefix, ConnTimeout.Prefix);
+ ASSERT_EQ(CalDAVTimeoutStatus.Timeout, ConnTimeout.Timeout);
ASSERT_EQ(CalDAVTimeoutStatus.UseSSL, ConnTimeout.UseSSL);
// Verify that the connection had timed out.