![](https://secure.gravatar.com/avatar/60f3cc97f94fa3690ba406f8c1a7fc4f.jpg?s=120&d=mm&r=g)
On 05/17/2018 09:03 PM, Taco Hoekwater wrote:
On 17 May 2018, at 10:31, Taco Hoekwater
wrote: Anyway, perhaps someone can answer me this? I tried the ffi/curl code, and the network stuff works, but only when I comment out the write callback:
lcurl.curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ffi.cast("callback",discard));
If I dont, I get an error message from ffi that is:
unable to convert argument 3 from cdata
to cdata<vararg> stack traceback: [C]: in function 'curl_easy_setopt' [ctxlua]:42: in function 'check_status' [ctxlua]:1: in main chunk And I have no idea what that actually means or how to fix it?
FYI: fixed by updating luatex.
Hi Taco, Actually you don't really need to set the WRITEFUNCTION callback of libcurl. I only set it to the "discard" function which simply return the number of bytes it got, such that libcurl doesn't print the header information to stdout. You could also plug a different function in there if you wanted to process the headers. I will soon post an annotated version of the code with more proper error-checking on the list. Cheers, Henri
Best wishes, Taco
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________