diff ui/downloader_win.cpp @ 27:62cd56cea09b

Start on polarssl Downloader. This breaks the windows build for now
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 12 Mar 2014 16:15:52 +0100
parents 7d07d261b003
children 17e1c8f37d72
line wrap: on
line diff
--- a/ui/downloader_win.cpp	Tue Mar 11 19:00:35 2014 +0100
+++ b/ui/downloader_win.cpp	Wed Mar 12 16:15:52 2014 +0100
@@ -27,6 +27,44 @@
 
 #define MAX_SW_SIZE 10485760
 #define MAX_LIST_SIZE 1048576
+/** @brief Download a file from the Internet
+ *
+ * @param[in] HSession the session to work in.
+ * @param[in] HConnect the connection to use.
+ * @param[in] resource the resource to download.
+ * @param[in] filename where the file should be saved.
+ * @param[in] maxSize maximum amount of bytes to download
+ *
+ * @returns True if the download was successful.
+ */
+bool downloadFile(HINTERNET hSession, HINTERNET hConnect,
+        LPCWSTR resource, const QString &filename, DWORD maxSize);
+
+/** @brief get the last modified header of a resource.
+ *
+ * On error call getLastError to get extended error information.
+ * This function still does not do any networking but only initializes
+ * it.
+ *
+ * @param[in] HSession the session to work in.
+ * @param[in] HConnect the connection to use.
+ * @param[in] resource the resource to check the last-modified date on
+ *
+ * @returns the last modified date or a null datetime in case of errors
+ */
+QDateTime getLastModifiedHeader(HINTERNET hSession,
+    HINTERNET hConnect, LPCWSTR resource);
+
+/** @brief verify that the certificate of the request matches
+ *
+ * Validates the certificate against the member variable certificate
+ *
+ * @param[in] hRequest: The request from which to get the certificate
+ *
+ * @returns True if the certificate exactly matches the one in hRequest
+ */
+
+bool verifyCertificate(HINTERNET hRequest);
 
 
 #define LIST_RESOURCE "/incoming/aheinecke/test"

http://wald.intevation.org/projects/trustbridge/