add various options for curl connections / fix write_data() prototype