diff --git a/Sources/cURL.swift b/Sources/cURL.swift index fe7e5a9..c76ae5c 100644 --- a/Sources/cURL.swift +++ b/Sources/cURL.swift @@ -113,7 +113,12 @@ public class CURL { } let _ = setOption(CURLOPT_WRITEFUNCTION, f: writeFunc) - let _ = setOption(CURLOPT_READFUNCTION, f: { fread($0, $1, $2, unsafeBitCast($3, to: UnsafeMutablePointer.self)) }) + let _ = setOption(CURLOPT_READFUNCTION, f: { _,_,_,_ in + // it is dangerous to set the curl default fread function without READDATA + // so the best option is to leave it blank + // fread($0, $1, $2, unsafeBitCast($3, to: UnsafeMutablePointer.self)) + return 0 + }) }