Homebrew Curl can't resolve hostname

IC_

GBAtemp's ???
OP
Member
Joined
Aug 24, 2017
Messages
1,571
Trophies
1
Location
The Forest
XP
5,503
Country
Antarctica
Hello, I'm trying to download files using CURL but it always just shows some weird errors about not being able to resolve hostnames and I wasn't really able to find anything about it
The internet settings on my 3DS are correct and everything
The errors:
Code:
* timeout on name lookup is not supported
* Curl_ipv4_resolve_r failed for [domain]
* Couldn't resolve host '[domain]'
* Closing connection 0
The code:
Code:
void http_init() {
    curl_global_init(CURL_GLOBAL_ALL);
}

void http_exit() {
    curl_global_cleanup();
}

static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) {
    size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
    return written;
}

unsigned char http_downloadfile(const char* url, const char* filename) {
    std::cout << url << ", " << filename << '\n';
    CURL *curl_handle;
    CURLcode cres;
    FILE *file;
    
    /* init the curl session */
    curl_handle = curl_easy_init();
    
    /* set URL to get here */
    curl_easy_setopt(curl_handle, CURLOPT_URL, url);
    
    /* Switch on full protocol/debug output while testing */
    curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L);
    
    /* disable progress meter, set to 0L to enable it */
    curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
    
    /* send all data to this function  */
    curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
    
    curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
    
    curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, 1L);
    
    curl_easy_setopt(curl_handle, CURLOPT_HTTP_VERSION, (long)CURL_HTTP_VERSION_2TLS);
    
    curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L);
    
    curl_easy_setopt(curl_handle, CURLOPT_STDERR, stdout);
    
    //Open file
    file = fopen(filename, "wb");
    if(file) {
        /* write the page body to this file handle */
        curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, file);
        
        /* get it! */
        cres = curl_easy_perform(curl_handle);
        
        /* close the header file */
        fclose(file);
    } else {
        //Unable to open file
        std::cout << "Unable to open file in http_downloadfile\n";
        return 255;
    }
    
    curl_easy_cleanup(curl_handle);
    
    if (cres != CURLE_OK) {
        return 128;
    }
    
    return 0;
}
 

IC_

GBAtemp's ???
OP
Member
Joined
Aug 24, 2017
Messages
1,571
Trophies
1
Location
The Forest
XP
5,503
Country
Antarctica

IC_

GBAtemp's ???
OP
Member
Joined
Aug 24, 2017
Messages
1,571
Trophies
1
Location
The Forest
XP
5,503
Country
Antarctica
This looks weird, are you adding the https://www part?
I'm adding http:// or https:// but not www because the website doesn't require it and IP addresses don't have that, I just tried with www though and it's the same error
And also when I use an IP address it just says
Code:
* timeout on name lookup is not supported
* Closing connection 0
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Pick up my door dash meat me in the allyway
    +1
  • BigOnYa @ BigOnYa:
    Wifey is busy, so ill send my buddy @AncientBoi , in his gimp outfit. "who ordered the 6" sausage?""
  • K3Nv2 @ K3Nv2:
    Like subway it's false advertising
    +1
  • BigOnYa @ BigOnYa:
    Ok "who ordered the Vienna sausage?"
  • K3Nv2 @ K3Nv2:
    Uremum
    +1
  • BigOnYa @ BigOnYa:
    My buddy convince me to download and play poker game with him yesterday, called Four Kings Casino, its pretty fun actually, you create a avatar and walk around in a virtual casino, and play any table, or slots with others online.There's even a dance club and bowling alley.
  • SylverReZ @ SylverReZ:
    They should bring advertisements like this back LOL.
  • BakerMan @ BakerMan:
    or that german ninja turtle commercial
    +1
  • K3Nv2 @ K3Nv2:
    Forgot to buy BBQ sauce at the store so made my own ffs
  • RedColoredStars @ RedColoredStars:
    Blues Hog BBQ sauces are pretty good.
  • K3Nv2 @ K3Nv2:
    My insurance has a thing where if I do a virtual visit they'll just send me a $100 gift card to Walmart I'm about to sell a company my medical history for $100 lol
  • BigOnYa @ BigOnYa:
    My insurance has a thing called, " Nope, we aren't paying for that." that they like to use on us all the time. Then we play the "Ok we will go to some other insurance company." then they miraculously say ok we will pay for that.
  • The_Dizzy_Vizzy @ The_Dizzy_Vizzy:
    Well look at what the cat dragged in!!!
  • BigOnYa @ BigOnYa:
    Hey, do you feel any older?
  • K3Nv2 @ K3Nv2:
    No I don't
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, not right now
    +1
  • BigOnYa @ BigOnYa:
    @K3Nv2 That's my phrase, stop it
    +1
  • K3Nv2 @ K3Nv2:
    Your phrase is I'm not drunk
    +1
  • Xdqwerty @ Xdqwerty:
    I feel a discomfort in my throat
  • SylverReZ @ SylverReZ:
    BigOnYa after a long day.
  • AlbertJulian @ AlbertJulian:
    I got scammed last year by some internet fraudsters who made away with my crypto worth $210,000.I almost lost my life because i was so frustrated and was depressed..5 months ago a friend introduced me to {Assets lab} a crypto recovery company.At first i was very scared because then i was afraid because of the bad experience i had ..Three months ago i decided to contact {Assets lab} and I made my complain to them and they took some information and assured me that they will assist me recover my crypto .. They helped me throughout the process and so far so good they have recovered 95 % of the money that was stolen from me..Today am a happy woman and i will continue to spread the good news.. Contact {Assets lab} for any of your funds lost to scams.. They are the best..Below is their contact informaation Name : ASSETS LAB RECOVERYEmail: [email protected] / Whatsapp: +17126004729Telegram: @Assets_labWebsite: https://lab-assets.tech/
    AlbertJulian @ AlbertJulian: I got scammed last year by some internet fraudsters who made away with my crypto worth...