From: Greg Kroah-Hartman Date: Fri, 9 Jan 2009 22:26:15 +0000 (-0800) Subject: Works properly now with twitter due to december twitter server change X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/0960ff733875fd98f052a0e505c1a5e7e293491d?hp=9e97b74fbb6277e840598e91a3a0ea2ec90a4921 Works properly now with twitter due to december twitter server change Twitter stopped liking the: Expect: 100-continue header, so we need to override that with an empty "Expect" line in order to get it working again. --- diff --git a/bti.c b/bti.c index 941be79..feaab36 100644 --- a/bti.c +++ b/bti.c @@ -194,6 +194,7 @@ static int send_tweet(struct session *session) CURLcode res; struct curl_httppost *formpost = NULL; struct curl_httppost *lastptr = NULL; + struct curl_slist *slist = NULL; if (!session) return -EINVAL; @@ -220,6 +221,12 @@ static int send_tweet(struct session *session) switch (session->host) { case HOST_TWITTER: curl_easy_setopt(curl, CURLOPT_URL, twitter_url); + /* + * twitter doesn't like the "Expect: 100-continue" header + * anymore, so turn it off. + */ + slist = curl_slist_append(slist, "Expect:"); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist); break; case HOST_IDENTICA: curl_easy_setopt(curl, CURLOPT_URL, identica_url);