5

Is there an easy way to cancel a curl_easy_perform from another thread?

ST3
  • 8,826
  • 3
  • 68
  • 92
Lodle
  • 31,277
  • 19
  • 64
  • 91

1 Answers1

8

You have to use the callback functions (write/read/progress) to perform the cancel. The other thread needs to set a flag and the callback function checks the flag and returns the proper value to cancel the operation.

robottobor
  • 11,595
  • 11
  • 39
  • 37
  • When I return from curl_progress_callback non-zero value, it stop sending request, bit also program is crashed. Is it mention to be? Can you advise method for cancelling without crashing? – Alecs Sep 12 '11 at 15:13