Mercurial > pidgin
comparison libpurple/protocols/yahoo/yahoo.c @ 27221:539f53b9ec37
Fix how we process certain data we get from the server.
In some cases, we seem to take into account that the server does send us
chunked data, but not always. Now that the core handles chunked data, we
can process the response data more correctly.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 30 Jun 2009 20:50:33 +0000 |
parents | a1603a9cda5e |
children | b2465d7fdeac |
comparison
equal
deleted
inserted
replaced
27220:716bd29bdc28 | 27221:539f53b9ec37 |
---|---|
1681 #if GLIB_CHECK_VERSION(2,6,0) | 1681 #if GLIB_CHECK_VERSION(2,6,0) |
1682 totalelements = g_strv_length(split_data); | 1682 totalelements = g_strv_length(split_data); |
1683 #else | 1683 #else |
1684 while (split_data[++totalelements] != NULL); | 1684 while (split_data[++totalelements] != NULL); |
1685 #endif | 1685 #endif |
1686 if (totalelements >= 5) { | 1686 if (totalelements >= 4) { |
1687 response_no = strtol(split_data[1], NULL, 10); | 1687 response_no = strtol(split_data[0], NULL, 10); |
1688 crumb = g_strdup(split_data[2] + strlen("crumb=")); | 1688 crumb = g_strdup(split_data[1] + strlen("crumb=")); |
1689 yd->cookie_y = g_strdup(split_data[3] + strlen("Y=")); | 1689 yd->cookie_y = g_strdup(split_data[2] + strlen("Y=")); |
1690 yd->cookie_t = g_strdup(split_data[4] + strlen("T=")); | 1690 yd->cookie_t = g_strdup(split_data[3] + strlen("T=")); |
1691 } | 1691 } |
1692 | 1692 |
1693 g_strfreev(split_data); | 1693 g_strfreev(split_data); |
1694 | 1694 |
1695 if(response_no != 0) { | 1695 if(response_no != 0) { |
1767 #if GLIB_CHECK_VERSION(2,6,0) | 1767 #if GLIB_CHECK_VERSION(2,6,0) |
1768 totalelements = g_strv_length(split_data); | 1768 totalelements = g_strv_length(split_data); |
1769 #else | 1769 #else |
1770 while (split_data[++totalelements] != NULL); | 1770 while (split_data[++totalelements] != NULL); |
1771 #endif | 1771 #endif |
1772 if(totalelements >= 5) { | 1772 if(totalelements >= 2) { |
1773 response_no = strtol(split_data[1], NULL, 10); | 1773 response_no = strtol(split_data[0], NULL, 10); |
1774 token = g_strdup(split_data[2] + strlen("ymsgr=")); | 1774 token = g_strdup(split_data[1] + strlen("ymsgr=")); |
1775 } | 1775 } |
1776 | 1776 |
1777 g_strfreev(split_data); | 1777 g_strfreev(split_data); |
1778 | 1778 |
1779 if(response_no != 0) { | 1779 if(response_no != 0) { |