Bruce Yang
Bruce Yang

Reputation: 407

How many times the callback function would be called which is set in curl_easy_setopt()?

I wrote a callback function to write data into a string variable transferred by curl_easy_perform.

I've found that the callback function would be called several times (I don't know exactly how many ).

Will The string variable content be overwritten with the subsequent call? How to implement this?

P.S. I've found that link useful.

Upvotes: 1

Views: 427

Answers (1)

Some programmer dude
Some programmer dude

Reputation: 409356

The number of times the callback is called depends on how much data there is to read.

If you are using C++, then use std::string, and you won't have that trouble.

Upvotes: 1

Related Questions