static gboolean
gst_curl_http_sink_set_options_unlocked (GstCurlBaseSink * bcsink)
{
  GstCurlHttpSink *sink = GST_CURL_HTTP_SINK (bcsink);
  GstCurlTlsSinkClass *parent_class;

  /* proxy settings */
  if (sink->proxy != NULL && strlen (sink->proxy)) {
    if (!proxy_setup (bcsink)) {
      return FALSE;
    }
  }

  curl_easy_setopt (bcsink->curl, CURLOPT_POST, 1L);

  /* FIXME: check user & passwd */
  curl_easy_setopt (bcsink->curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

  parent_class = GST_CURL_TLS_SINK_GET_CLASS (sink);

  if (g_str_has_prefix (bcsink->url, "https://")) {
    return parent_class->set_options_unlocked (bcsink);
  }

  return TRUE;
}
static gboolean
gst_curl_http_sink_set_options_unlocked (GstCurlBaseSink * bcsink)
{
  GstCurlHttpSink *sink = GST_CURL_HTTP_SINK (bcsink);
  GstCurlTlsSinkClass *parent_class;
  CURLcode res;

  /* proxy settings */
  if (sink->proxy != NULL) {
    if (!proxy_setup (bcsink)) {
      return FALSE;
    }
  }

  res = curl_easy_setopt (bcsink->curl, CURLOPT_POST, 1L);
  if (res != CURLE_OK) {
    bcsink->error = g_strdup_printf ("failed to set HTTP POST: %s",
        curl_easy_strerror (res));
    return FALSE;
  }

  /* FIXME: check user & passwd */
  res = curl_easy_setopt (bcsink->curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  if (res != CURLE_OK) {
    bcsink->error =
        g_strdup_printf ("failed to set HTTP authentication methods: %s",
        curl_easy_strerror (res));
    return FALSE;
  }

  parent_class = GST_CURL_TLS_SINK_GET_CLASS (sink);

  if (g_str_has_prefix (bcsink->url, "https://")) {
    return parent_class->set_options_unlocked (bcsink);
  }

  return TRUE;
}