cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl cache?

From: Michael Smith <mikes_at_VERTIGO.NET>
Date: Tue, 29 Mar 2005 14:09:32 -0500

This may be a very silly question, but I'm still going to ask it.

Does the libcurl have its own cache similar to a web browser for instance?

In the following code purl->fGetBodyContent is set to FALSE and somehow I have been told that dwFileSize and lLastModified time remain the same eventhough the file has been updated on the webserver. Is this possible?

                curl_easy_setopt (curl, CURLOPT_URL, url);
                if (! purl->fGetBodyContent)
                {
                        curl_easy_setopt (curl, CURLOPT_NOBODY, TRUE);
                }
                else
                {
                        fp.fp = _tfopen (purl->lpszOutputFileName, _T("wb"));
                        if (fp.fp == NULL)
                        {
                                curl_easy_cleanup(curl);
                                return CURLE_WRITE_ERROR;
                        }
                        curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, writefile_curl_cb);
                        curl_easy_setopt (curl, CURLOPT_WRITEDATA, &fp);
                }
                curl_easy_setopt (curl, CURLOPT_FILETIME, TRUE);
                if (purl->lLastModified > 0)
                {
                        curl_easy_setopt (curl, CURLOPT_TIMECONDITION, TRUE);
                        curl_easy_setopt (curl, CURLOPT_TIMEVALUE, purl->lLastModified);
                }
                if (purl->fVerbose)
                        curl_easy_setopt (curl, CURLOPT_VERBOSE, TRUE);

                if (purl->fNoEPSV)
                        curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, FALSE);
                else
                        curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, TRUE);

                curlrc = curl_easy_perform (curl);
                curl_easy_getinfo (curl, CURLINFO_FILETIME, &lval);
                purl->lLastModified = lval;
                curl_easy_getinfo (curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &dval);
                purl->dwFileSize = (DWORD)dval;
                curl_easy_getinfo (curl, CURLINFO_CONTENT_TYPE, &p);
                if (p)
                        MultiByteToWideChar (CP_ACP, 0, p, strlen (p) + 1, purl->szContentType, 255);
                else
                        purl->szContentType[0] = NULL;

                if (fp.fp && purl->fGetBodyContent)
                        fclose (fp.fp);
Received on 2005-03-29