cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Help: getting the current url

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 10 Apr 2008 13:30:30 -0700

On Thu, Apr 10, 2008 at 04:15:22PM -0400, Am Ro wrote:
> In my program, I need to be able to get the original url and compare it to the
> current url. I have tried this code, but it prints \270 to the screen:
>
> int connect(const char* aURL)
> {
> const char *currentUrl;
> CURL *urlHandler;
> curl_easy_setopt(urlHandle, CURLOPT_URL, aURL);
> curl_easy_perform(urlHandle);
>
>
> if (aUrl == currentUrl)
> {
> connect(aURL);
> }
> else
> {
> printf(currentURL);
> }
> }

currentUrl is never set to anything in this code snippet. Are you perhaps
looking for the CURLINFO_EFFECTIVE_URL curl_easy_getinfo option?

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-04-10