Works properly now with twitter due to december twitter server change
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Jan 2009 22:26:15 +0000 (14:26 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Jan 2009 22:26:15 +0000 (14:26 -0800)
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.

bti.c

diff --git a/bti.c b/bti.c
index 941be79..feaab36 100644 (file)
--- 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;
        CURLcode res;
        struct curl_httppost *formpost = NULL;
        struct curl_httppost *lastptr = NULL;
+       struct curl_slist *slist = NULL;
 
        if (!session)
                return -EINVAL;
 
        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);
        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);
                break;
        case HOST_IDENTICA:
                curl_easy_setopt(curl, CURLOPT_URL, identica_url);