Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6241531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:47:03+00:00 2026-05-24T11:47:03+00:00

I have this code for curl: size_t write_to_string(void * ptr,size_t size,size_t nmeb,ResponseStruct * res_struct){

  • 0

I have this code for curl:

size_t write_to_string(void * ptr,size_t size,size_t nmeb,ResponseStruct * res_struct){
    size_t bytes = size*nmeb;
    res_struct->length += bytes;
    res_struct->response = realloc(res_struct->response, res_struct->length);
    strncat(res_struct->response,ptr,bytes);
    return bytes;
}

char * get_url_data(char * url){
    CURLcode res;
    curl_easy_reset(curl);
    if(curl){
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,write_to_string);
        ResponseStruct result;
        result.response = malloc(sizeof(char));
        result.response[0] = '\0';
        result.length = 1;
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result);
        res = curl_easy_perform(curl);
        if (res) {
            return NULL;
        }
        return result.response;
    }
    return NULL;
}

DateData * get_prices(DateData * prior_prices){
    char * response = get_url_data("https://mtgox.com/api/0/data/getTrades.php");
    char * orig = response;
    if (response) {
        //Stuff here just calculates price data
        errno = 1;
        return new_prices;
    }
    errno = 0;
    return prior_prices;
}

The get_prices function will constantly timeout while “http://mtgox.com/api/0/data/getTrades.php” is fine in a web browser.

What is the problem?

Thank you!

Edit dtruss output (Note that connect gives an error…):

SYSCALL(args)        = return
__sysctl(0x7FFF5FBFE060, 0x6, 0x0)       = 0 0
__sysctl(0x7FFF5FBFE060, 0x6, 0x10084D400)       = 0 0
kqueue(0x7FFF5FBFE280, 0x0, 0x50)        = 4 0
kevent(0x4, 0x7FFF5FBFE280, 0x1)         = 0 0
socket(0x1, 0x1, 0x0)        = 5 0
setsockopt(0x5, 0xFFFF, 0x1022)      = 0 0
connect_nocancel(0x5, 0x7FFF5FBFE050, 0x6A)      = 0 0
sendto_nocancel(0x5, 0x10013D5F0, 0x1C)      = 28 0
recvfrom_nocancel(0x5, 0x7FFF5FBFE09C, 0x4)      = 4 0
socketpair(0x1, 0x1, 0x0)        = 0 0
sendto_nocancel(0x5, 0x100141C80, 0x33)      = 51 0
sendmsg_nocancel(0x5, 0x7FFF5FBFDFB0, 0x0)       = 1 0
close_nocancel(0x7)      = 0 0
recvfrom_nocancel(0x6, 0x7FFF5FBFDFFC, 0x4)      = 4 0
close_nocancel(0x6)      = 0 0
socketpair(0x1, 0x1, 0x0)        = 0 0
sendto_nocancel(0x5, 0x100141C80, 0x33)      = 51 0
sendmsg_nocancel(0x5, 0x7FFF5FBFDFB0, 0x0)       = 1 0
close_nocancel(0x7)      = 0 0
recvfrom_nocancel(0x6, 0x7FFF5FBFDFFC, 0x4)      = 4 0
close_nocancel(0x6)      = 0 0
kevent(0x4, 0x7FFF5FBFE280, 0x1)         = 0 0
kevent(0x4, 0x0, 0x0)        = 1 0
kevent(0x4, 0x0, 0x0)        = 1 0
recvfrom_nocancel(0x5, 0x7FFF5FBFE0B0, 0x1C)         = 28 0
recvfrom_nocancel(0x5, 0x100141D30, 0x21)        = 33 0
select_nocancel(0x6, 0x7FFF5FBFE030, 0x0)        = 0 0
kevent(0x4, 0x7FFF5FBFDAE0, 0x1)         = 0 0
kevent(0x4, 0x0, 0x0)        = 1 0
kevent(0x4, 0x0, 0x0)        = 0 0
kevent(0x4, 0x0, 0x0)        = 1 0
kevent(0x4, 0x0, 0x0)        = 1 0
recvfrom_nocancel(0x5, 0x7FFF5FBFE0B0, 0x1C)         = 28 0
recvfrom_nocancel(0x5, 0x100141D30, 0x25)        = 37 0
select_nocancel(0x6, 0x7FFF5FBFE030, 0x0)        = 0 0
kevent(0x4, 0x7FFF5FBFDAE0, 0x1)         = 0 0
sendto_nocancel(0x5, 0x100141C90, 0x1C)      = 28 0
sendto_nocancel(0x5, 0x100141C90, 0x1C)      = 28 0
close_nocancel(0x4)      = 0 0
sigaction(0xE, 0x7FFF5FBFE940, 0x0)      = 0 0
setitimer(0x0, 0x7FFF5FBFE940, 0x7FFF5FBFE920)       = 0 0
socket(0x2, 0x1, 0x6)        = 4 0
setsockopt(0x4, 0xFFFF, 0x1022)      = 0 0
fcntl(0x4, 0x3, 0x0)         = 2 0
fcntl(0x4, 0x4, 0x6)         = 0 0
connect(0x4, 0x7FFF5FBFEC20, 0x10)       = -1 Err#36
select(0x5, 0x7FFF5FBFE9C0, 0x7FFF5FBFE940, 0x7FFF5FBFE8C0, 0x7FFF5FBFEA60)  = 1 0
getsockopt(0x4, 0xFFFF, 0x1007)      = 0 0
stat64("/dev/urandom\0", 0x7FFF5FBFE780, 0x0)        = 0 0
open_nocancel("/dev/urandom\0", 0x0, 0x1B6)      = 6 0
read_nocancel(0x6, "\"\247\326\354\001-\250\263\346\377%Kn\222_X\307^3\372Z\370\233\357[\372\376\247\241\022\336\340K\240\211\027S\335qY\255L\320G\205h\"\f^\266\355\336\345sG\315\337>\367\213&Y\264\371\310\357\017\274\367\370ek7\341]\226\322-\004\330\022\325\304%\212`\307\364e\316M\262\367\020LEM\r{\206\335\257\354%\f\307\242\002#\303\307\360\271\357\226\337\351\0", 0x400)      = 1024 0
close_nocancel(0x6)      = 0 0
open("/dev/urandom\0", 0x20004, 0x7FFF5FBFE978)      = 6 0
fstat64(0x6, 0x7FFF5FBFE970, 0x0)        = 0 0
select(0x7, 0x7FFF5FBFEB20, 0x0, 0x0, 0x7FFF5FBFEBA0)        = 1 0
read(0x6, "M\004\343\370\204\020\373\243\351\316X\240o\351!c\306\342\210\345}wcB\220\005{\205\177\016\005c\0", 0x20)         = 32 0
close(0x6)       = 0 0
getuid(0x0, 0x1, 0x0)        = 501 0
write(0x4, "\026\003\001\0", 0x73)       = 115 0
dtrace: error on enabled probe ID 1770 (ID 18656: syscall::read:return): out of scratch space in action #12 at DIF offset 44
select(0x5, 0x7FFF5FBFEBA0, 0x7FFF5FBFEB20, 0x7FFF5FBFEAA0, 0x7FFF5FBFEC40)  = 1 0
read(0x4, "\026\003\001\025'\002\0", 0x7)        = 7 0
read(0x4, "\0", 0x1525)      = 1353 0
dtrace: error on enabled probe ID 1770 (ID 18656: syscall::read:return): out of scratch space in action #12 at DIF offset 44
select(0x5, 0x7FFF5FBFEBA0, 0x7FFF5FBFEB20, 0x7FFF5FBFEAA0, 0x7FFF5FBFEC40)  = 1 0
read(0x4, "crl0\201\216\006\b+\006\001\005\005\a\001\001\004\201\2010\17709\006\b+\006\001\005\005\a0\001\206-http://ocsp.startssl.com/sub/class2/server/ca0B\006\b+\006\001\005\005\a0\002\2066http://aia.startssl.com/certs/sub.class2.server.ca.crt0#\006\003U\035\022\004\0340\032\206\030http://www.startssl.com/0\r\006\t*\206H\206\367\r\001\001\005\005\0", 0xFDC)       = 1360 0
dtrace: error on enabled probe ID 1770 (ID 18656: syscall::read:return): out of scratch space in action #12 at DIF offset 44
select(0x5, 0x7FFF5FBFEBA0, 0x7FFF5FBFEB20, 0x7FFF5FBFEAA0, 0x7FFF5FBFEC40)  = 1 0
read(0x4, "http://crl.startssl.com/sfsca.crl0\201\200\006\003U\035 \004y0w0u\006\v+\006\001\004\001\201\2657\001\002\0010f0.\006\b+\006\001\005\005\a\002\001\026\"http://www.startssl.com/policy.pdf04\006\b+\006\001\005\005\a\002\001\026(http://www.startssl.com/intermediate.pdf0\r\006\t*\206H\206\367\r\001\001\005\005\0", 0xA8C)        = 1360 0
dtrace: error on enabled probe ID 1770 (ID 18656: syscall::read:return): out of scratch space in action #12 at DIF offset 44
select(0x5, 0x7FFF5FBFEBA0, 0x7FFF5FBFEB20, 0x7FFF5FBFEAA0, 0x7FFF5FBFEC40)  = 1 0
read(0x4, "nB\343?\336!>{\341\rp\373c\252\250l\032T\264\\%z\311\242\311\213\026\246\273,~\027^\005MXn\022\035\001\356\022\020\r\3062\177\030\377\374\364\372\315n\221\3506I\276\032Hi\213\302\226M\032\022\262i\027\301\n\220\326\372y\"H\277\272{i\370p\307\372z7\330\330\r\322vOW\377\220\267\343\221\322\335\357\302`\267g:\335\376\252\234\360\324\213\177r\"\316\306\237\227\266\370\257\212\240\020\250\331\373\030\306\266\265\\R<\211\266\031*s\001\n\017\003\263\022`\362z/\201\333\243n\377&0\227\365\213\335\211W\266\255=\263\257+\305\267v\002\360\245\326+\232\206\024*r\366\3433\214]\tK\023\337\273\214t\023RK\002\003\001\0", 0x53C)        = 1340 0
sigaction(0xD, 0x7FFF5FBFEF10, 0x7FFF5FBFEF40)       = 0 0
sigprocmask(0x1, 0x0, 0x7FFF5FBFE950)        = 0x0 0
sigaltstack(0x0, 0x7FFF5FBFE940, 0x0)        = 0 0
sigaction(0xE, 0x0, 0x7FFF5FBFE9C0)      = 0 0
sigaction(0xE, 0x7FFF5FBFE940, 0x0)      = 0 0
setitimer(0x0, 0x7FFF5FBFE940, 0x7FFF5FBFE920)       = 0 0
socket(0x1E, 0x2, 0x0)       = 4 0
close(0x4)       = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
write(0x4, "\026\003\001\001\006\020\0", 0x136)      = 310 0
dtrace: error on enabled probe ID 1770 (ID 18656: syscall::read:return): out of scratch space in action #12 at DIF offset 44
select(0x5, 0x7FFF5FBFEBA0, 0x7FFF5FBFEB20, 0x7FFF5FBFEAA0, 0x7FFF5FBFEC40)  = 1 0
read(0x4, "\024\003\001\0", 0x5)         = 5 0
read(0x4, "\001\0", 0x1)         = 1 0
read(0x4, "\026\003\001\0", 0x5)         = 5 0
read(0x4, "\177\226\217\004\0339\n\233D\216G\257s\240\332x[i\021\247\333f^\325\225=\345.\350XN/\0", 0x20)        = 32 0
write(0x4, "\027\003\001\0", 0x5D)       = 93 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
select(0x5, 0x7FFF5FBFEEA0, 0x7FFF5FBFEE20, 0x7FFF5FBFEDA0, 0x7FFF5FBFEF40)  = 0 0
select(0x5, 0x7FFF5FBFEE00, 0x7FFF5FBFED80, 0x7FFF5FBFED00, 0x7FFF5FBFEEA0)  = 0 0
write(0x4, "\025\003\001\0", 0x17)       = 23 0
close(0x4)       = 0 0
sigaction(0xD, 0x7FFF5FBFEF10, 0x7FFF5FBFEF40)       = 0 0
write_nocancel(0x1, "CURL FAILED WITH ERROR CODE 28\n\0", 0x1F)      = 31 0
write_nocancel(0x1, "ERROR: There has been an error with retrieving the price data. Check connection.\n\0", 0x51)        = 81 0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:47:04+00:00Added an answer on May 24, 2026 at 11:47 am

    Decided to use tradehill’s API instead because it works.

    https://api.tradehill.com/APIv1/USD/Trades

    Thanks to omrib and nos.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a curl class, called Curl. Let's presume i have this code: $url
I have this code if(ereg(^(https),$url)) curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false); // execute, and log the result to curl_put.log
I currently have this code #include <iostream> #include <curl.h> #include <windows.h> #include boost\timer.hpp int
I have this code in jQuery, that I want to reimplement with the prototype
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
I have this code that performs an ajax call and loads the results into
I have this code #include <iostream> using namespace std; int main(int argc,char **argv) {
I have this code: CCalcArchive::CCalcArchive() : m_calcMap() { } m_calcMap is defined as this:
I have this code: myVariable which I want to change into trace(myVariable: + myVariable);
I have this code while($row = mysql_fetch_row($result)) { echo '<tr>'; $pk = $row[0]['ARTICLE_NO']; foreach($row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.