Skip to content

Commit

Permalink
setting READFUNCTION to empty by default
Browse files Browse the repository at this point in the history
  • Loading branch information
RockfordWei authored Jan 3, 2017
1 parent 2c89af6 commit dc9fd81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/cURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<FILE>.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<FILE>.self))
return 0
})

}

Expand Down

0 comments on commit dc9fd81

Please sign in to comment.