News for hackers. Stuff that matters.
Re:Backblaze acknowledges using curl, becomes the new larges... by brianwski on Wednesday January 15, 2020 @02:22AM (#22052305)
Backblaze CTO here....

> I found libcurl difficult to use in 'C'

Umm.... it is literally the most simple API that could possibly exist? Here are the four lines in 'C' to fetch a URL:

curl_global_init(CURL_GLOBAL_SSL); // do this once inside of "main()"

CURL ch = curl_easy_init();

curl_easy_setopt(ch, CURLOPT_URL, "http://www.google.com");

int res = curl_easy_perform(ch);

I'm not sure how you could fetch a URL without initializing the library or specifying the URL?? It is like profoundly the most simple API that could possibly exist, I challenge you to specify any imagined API that is shorter or more simple or more straight-forward??!

The nice thing about the libcurl API is the above works and is the "base" concept, but if you want to specify something like a "network throttle" to be polite to other things on the network, you just start adding one extra line at a time to the above code:

curl_easy_setopt(ch, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) (256 * 1024)); // 256 kbits/sec

Re:Backblaze acknowledges using curl, becomes the new larges... by rlonn on Wednesday January 15, 2020 @03:33AM (#22052592)
I founded an online load testing company called Load Impact, and we have also used libcurl since way back. I agree the API is very simple, and libcurl is a very reliable and performant piece of software. Daniel is also extremely helpful while not charging a penny for all the time he puts in.

It's a great idea, this "paying back" accumulated moral debt (or whatever you'd like to call it) to open source developers whose software you've built a successful business on. Applauds to you, and to Backblaze!

I am not running Load Impact anymore, but will see if we can follow Backblaze's lead here and do something similar.