evolution-jescs r245 - in trunk: . lib
- From: jedywang svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-jescs r245 - in trunk: . lib
- Date: Thu, 31 Jan 2008 08:34:00 +0000 (GMT)
Author: jedywang
Date: Thu Jan 31 08:34:00 2008
New Revision: 245
URL: http://svn.gnome.org/viewvc/evolution-jescs?rev=245&view=rev
Log:
2008-01-31 Wang Xin <jedy wang sun com>
Bump to 2.21.90 and massive updates for libsoup-2.3.
* configure.in:
* lib/sunone-connection.c:
* lib/sunone-connection.h:
* lib/sunone-message.c:
* lib/sunone-message.h:
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/lib/sunone-connection.c
trunk/lib/sunone-connection.h
trunk/lib/sunone-message.c
trunk/lib/sunone-message.h
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Thu Jan 31 08:34:00 2008
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
-AC_INIT(evolution-jescs, 2.21.1, http://bugzilla.gnome.org/enter_bug.cgi?product=evolution-jescs)
+AC_INIT(evolution-jescs, 2.21.90, http://bugzilla.gnome.org/enter_bug.cgi?product=evolution-jescs)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
@@ -17,7 +17,7 @@
DATASERVER_VERSION=1.6
AC_SUBST(DATASERVER_VERSION)
-SOUP_VERSION=2.2
+SOUP_VERSION=2.4
AC_ARG_WITH(sunone-debug, [ --with-sunone-debug Allow debugging])
case $withval in
Modified: trunk/lib/sunone-connection.c
==============================================================================
--- trunk/lib/sunone-connection.c (original)
+++ trunk/lib/sunone-connection.c Thu Jan 31 08:34:00 2008
@@ -28,8 +28,7 @@
#define IS_CONNECTED(connection,return_value) {if (!connection->priv->wcap_session_id) return return_value;}
#define NEW_URI(uri) {uri = soup_uri_new (connection->priv->server_uri); \
if (uri && uri->path) {g_free (uri->path); uri->path = NULL;} \
- if (uri && uri->query) {g_free (uri->query); uri->query = NULL;}} \
- if (uri) uri->broken_encoding = TRUE;
+ if (uri && uri->query) {g_free (uri->query); uri->query = NULL;}}
#define IS_CNC_WCAP_2_0(connection) ( !strncmp (connection->priv->wcap_version, "2.0", 3) )
struct _SunOneConnectionPrivate {
@@ -88,7 +87,7 @@
}
static void
-append_to_query (SoupUri *uri, const char *param, const char *value)
+append_to_query (SoupURI *uri, const char *param, const char *value)
{
char *tmp, *enc;
@@ -104,7 +103,7 @@
}
static void
-append_to_query_int (SoupUri *uri, const char *param, int value)
+append_to_query_int (SoupURI *uri, const char *param, int value)
{
char *tmp;
@@ -136,7 +135,7 @@
static void
-append_to_query_stringv (SoupUri *uri, const char *param, const char **stringv)
+append_to_query_stringv (SoupURI *uri, const char *param, const char **stringv)
{
char *string;
@@ -151,7 +150,7 @@
}
static void
-append_to_query_text (SoupUri *uri, const char *param, ECalComponentText *text)
+append_to_query_text (SoupURI *uri, const char *param, ECalComponentText *text)
{
if (text->value)
append_to_query (uri, param, text->value);
@@ -160,7 +159,7 @@
}
static void
-append_to_query_text_list (SoupUri *uri, const char *param, GSList *text_list)
+append_to_query_text_list (SoupURI *uri, const char *param, GSList *text_list)
{
GSList *l;
char *string;
@@ -185,7 +184,7 @@
}
static void
-append_to_query_datetime (SoupUri *uri, const char *param, ECalComponentDateTime *dt, gboolean zero)
+append_to_query_datetime (SoupURI *uri, const char *param, ECalComponentDateTime *dt, gboolean zero)
{
const char *string;
@@ -201,7 +200,7 @@
}
static void
-append_to_query_attendees (SoupUri *uri, const char *param, GSList *attendee_list, SunOneConnection *connection, const char *calid, const char *email)
+append_to_query_attendees (SoupURI *uri, const char *param, GSList *attendee_list, SunOneConnection *connection, const char *calid, const char *email)
{
GSList *l;
GString *string;
@@ -331,7 +330,7 @@
}
static void
-append_to_query_exdate_list (SoupUri *uri, const char *param, GSList *dt_list)
+append_to_query_exdate_list (SoupURI *uri, const char *param, GSList *dt_list)
{
GSList *l;
char *string;
@@ -358,7 +357,7 @@
}
static void
-append_to_query_recur_list (SoupUri *uri, const char *param, GSList *r_list)
+append_to_query_recur_list (SoupURI *uri, const char *param, GSList *r_list)
{
GSList *l;
char *string;
@@ -384,7 +383,7 @@
}
static void
-append_to_query_classification (SoupUri *uri, const char *param, ECalComponentClassification class)
+append_to_query_classification (SoupURI *uri, const char *param, ECalComponentClassification class)
{
switch (class) {
case E_CAL_COMPONENT_CLASS_PUBLIC:
@@ -403,7 +402,7 @@
static void
-append_to_query_status (SoupUri *uri, const char *param, icalproperty_status status)
+append_to_query_status (SoupURI *uri, const char *param, icalproperty_status status)
{
switch (status) {
case ICAL_STATUS_CONFIRMED:
@@ -436,7 +435,7 @@
}
static void
-append_to_query_compstate (SoupUri *uri, const char *param, SunOneCompState state)
+append_to_query_compstate (SoupURI *uri, const char *param, SunOneCompState state)
{
const char *statev[7];
int i;
@@ -471,7 +470,7 @@
}
static void
-append_to_query_geo (SoupUri *uri, const char *param, struct icalgeotype *geo)
+append_to_query_geo (SoupURI *uri, const char *param, struct icalgeotype *geo)
{
char *tmp;
@@ -484,7 +483,7 @@
}
static void
-append_to_query_alarms (SoupUri *uri, SunOneConnection *connection, ECalComponent *comp)
+append_to_query_alarms (SoupURI *uri, SunOneConnection *connection, ECalComponent *comp)
{
GList *auids, *l;
ECalComponentAlarm *alarm;
@@ -632,7 +631,7 @@
g_return_val_if_fail (msg != NULL, FALSE);
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!icalcomp)
return FALSE;
@@ -668,7 +667,7 @@
sunone_login (SunOneConnection *connection, gboolean refresh)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *login_uri;
+ SoupURI *login_uri;
SoupMessage *msg;
icalcomponent *icalcomp;
guint error_code = SOUP_STATUS_CANT_CONNECT;
@@ -708,7 +707,7 @@
}
}
/* parse the returned data */
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
g_object_unref (msg);
soup_uri_free (login_uri);
if (icalcomp) {
@@ -743,7 +742,7 @@
sunone_logout (SunOneConnection *connection)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *logout_uri;
+ SoupURI *logout_uri;
SoupMessage *msg;
guint error_code;
@@ -881,7 +880,7 @@
{
SunOneConnection *connection;
SunOneConnectionPrivate *priv;
- SoupUri *suri;
+ SoupURI *suri;
connection = g_object_new (SUNONE_CONNECTION_TYPE, NULL);
priv = connection->priv;
@@ -1094,7 +1093,7 @@
sunone_connection_get_preferences (SunOneConnection *connection)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *get_uri;
+ SoupURI *get_uri;
SoupMessage *msg;
guint ret;
icalcomponent *icalcomp;
@@ -1133,7 +1132,7 @@
}
/* parse the returned data */
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
g_object_unref (msg);
if (!icalcomp) {
g_static_mutex_unlock (&mutex);
@@ -1257,7 +1256,7 @@
sunone_connection_set_preferences (SunOneConnection *connection, SunOneConnectionPreferences *prefs)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *set_uri;
+ SoupURI *set_uri;
SoupMessage *msg;
gchar *s, *s1 = NULL;
guint retval;
@@ -1385,7 +1384,7 @@
sunone_connection_createcalendar (SunOneConnection *connection, const gchar *calid, gchar **real_calid)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *suri;
+ SoupURI *suri;
SoupMessage *msg;
guint retval;
GList *acls = NULL;
@@ -1426,7 +1425,7 @@
icalcomponent *icalcomp;
/* parse the response to get the calid as generated in the server */
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (icalcomp) {
icalproperty *icalprop;
@@ -1491,7 +1490,7 @@
sunone_connection_deletecalendar (SunOneConnection *connection, const gchar *calid)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *suri;
+ SoupURI *suri;
SoupMessage *msg;
guint retval;
SunOneConnectionPreferences *prefs;
@@ -1639,7 +1638,7 @@
SunOneConnectionPrivate *priv = connection->priv;
gchar *calid_hash = NULL;
SunOneCalendarProperties *calprops = NULL;
- SoupUri *get_uri;
+ SoupURI *get_uri;
SoupMessage *msg;
icalcomponent *icalcomp;
SunOneCalendarProperties *clone;
@@ -1674,7 +1673,7 @@
}
/* parse the returned data */
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
g_object_unref (msg);
if (!icalcomp) {
g_static_mutex_unlock (&mutex);
@@ -1762,7 +1761,7 @@
SunOneCalendarProperties *calprops)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *set_uri;
+ SoupURI *set_uri;
SoupMessage *msg;
guint retval;
gchar *s;
@@ -1820,7 +1819,7 @@
sunone_connection_list_calids (SunOneConnection *connection)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *get_uri;
+ SoupURI *get_uri;
SoupMessage *msg;
icalcomponent *icalcomp, *subcomp;
SunOneCalendarProperties *calprops;
@@ -1843,7 +1842,7 @@
soup_uri_free (get_uri);
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (icalcomp) {
subcomp = icalcomponent_get_first_component (icalcomp, ICAL_VCALENDAR_COMPONENT);
while (subcomp) {
@@ -1869,7 +1868,7 @@
sunone_connection_search_calids (SunOneConnection *connection, SunOneSearchField field, SunOneSearchBy by, const char *search_str)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *get_uri;
+ SoupURI *get_uri;
SoupMessage *msg;
icalcomponent *icalcomp, *subcomp;
SunOneCalendarProperties *calprops;
@@ -1909,7 +1908,7 @@
char *tmp_str;
char *vcal_str;
- tmp_str = g_strndup (msg->response.body, msg->response.length);
+ tmp_str = g_strndup (msg->response_body->data, msg->response_body->length);
if (tmp_str) {
vcal_str = g_strdup_printf ("BEGIN:VCALENDAR\n%s\nEND:VCALENDAR\n", tmp_str);
g_free (tmp_str);
@@ -1970,7 +1969,7 @@
icalcomponent **icalcomp)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
@@ -1991,7 +1990,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2011,7 +2010,7 @@
SunOneModType mod)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
@@ -2047,7 +2046,7 @@
SunOneModType mod)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
@@ -2122,7 +2121,7 @@
time_t *server_time)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
@@ -2150,14 +2149,14 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
if (server_time) {
const char *date;
- date = soup_message_get_header (msg->response_headers, "Date");
+ date = soup_message_headers_get (msg->response_headers, "Date");
*server_time = parse_http_date (date);
if (*server_time < 0)
*server_time = 0;
@@ -2179,7 +2178,7 @@
icalcomponent **icalcomp)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
@@ -2206,7 +2205,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2225,7 +2224,7 @@
icalcomponent **icalcomp)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
@@ -2248,7 +2247,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2275,7 +2274,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2292,7 +2291,7 @@
sunone_connection_import (SunOneConnection *connection, const char *calid, icalcomponent *icalcomp)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *uri;
+ SoupURI *uri;
SoupMessage *msg;
guint retval;
char *ical_string, *import_msg, *content_type, *err;
@@ -2319,7 +2318,7 @@
import_msg = g_strdup_printf ("-----------------------------33111928916708\r\nContent-Disposition: form-data; name=\"Upload\"; filename=\"ical1.ics\"\r\n\r\n%s-----------------------------33111928916708--", ical_string);
content_type = "multipart/form-data;boundary=---------------------------33111928916708";
- msg = sunone_message_new_full_from_uri (uri, SOUP_METHOD_POST, content_type, SOUP_BUFFER_SYSTEM_OWNED,
+ msg = sunone_message_new_full_from_uri (uri, SOUP_METHOD_POST, content_type, SOUP_MEMORY_TAKE,
import_msg, strlen (import_msg));
/* send the request to the server */
@@ -2329,13 +2328,13 @@
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
retval = msg->status_code;
- if (msg->response.body) {
+ if (msg->response_body->data) {
if (IS_CNC_WCAP_2_0 (connection)) {
- err = strstr (msg->response.body, "var errno=");
+ err = strstr (msg->response_body->data, "var errno=");
err += 10;
}
else {
- err = strstr (msg->response.body, "X-NSCP-WCAP-ERRNO:");
+ err = strstr (msg->response_body->data, "X-NSCP-WCAP-ERRNO:");
err += 18;
}
@@ -2381,7 +2380,7 @@
{
SunOneConnectionPrivate *priv = connection->priv;
ECalComponent *comp;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
icalcomponent *real_icalcomp;
@@ -2575,7 +2574,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code) && return_icalcomp) {
- *return_icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *return_icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*return_icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2617,7 +2616,7 @@
{
SunOneConnectionPrivate *priv = connection->priv;
ECalComponent *comp;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
icalcomponent *real_icalcomp;
@@ -2811,7 +2810,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code) && return_icalcomp) {
- *return_icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *return_icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*return_icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2833,7 +2832,7 @@
icalcomponent **icalcomp)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
char *post_string, *content_type;
guint retval;
@@ -2859,14 +2858,14 @@
content_type = "application/x-www-form-urlencoded";
/* send the request to the server */
- msg = sunone_message_new_full_from_uri (fetch_uri, SOUP_METHOD_POST, content_type, SOUP_BUFFER_SYSTEM_OWNED,
+ msg = sunone_message_new_full_from_uri (fetch_uri, SOUP_METHOD_POST, content_type, SOUP_MEMORY_TAKE,
post_string, strlen (post_string));
sunone_message_send (connection, msg);
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2886,7 +2885,7 @@
icalcomponent **icalcomp)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
char *post_string, *content_type;
guint retval;
@@ -2911,14 +2910,14 @@
content_type = "application/x-www-form-urlencoded";
/* send the request to the server */
- msg = sunone_message_new_full_from_uri (fetch_uri, SOUP_METHOD_POST, content_type, SOUP_BUFFER_SYSTEM_OWNED,
+ msg = sunone_message_new_full_from_uri (fetch_uri, SOUP_METHOD_POST, content_type, SOUP_MEMORY_TAKE,
post_string, strlen (post_string));
sunone_message_send (connection, msg);
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- *icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ *icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!*icalcomp)
retval = SOUP_STATUS_MALFORMED;
}
@@ -2953,7 +2952,7 @@
sunone_connection_version (SunOneConnection *connection)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupUri *fetch_uri;
+ SoupURI *fetch_uri;
SoupMessage *msg;
guint retval;
icalcomponent *icalcomp;
@@ -2975,7 +2974,7 @@
retval = msg->status_code;
if (SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (!icalcomp)
retval = SOUP_STATUS_MALFORMED;
else {
@@ -3002,21 +3001,21 @@
return retval;
}
-SoupStatusClass
+guint
sunone_message_send (SunOneConnection *connection, SoupMessage *msg)
{
SunOneConnectionPrivate *priv = connection->priv;
- SoupStatusClass status_class;
+ guint status;
setup_message (msg);
- status_class = soup_session_send_message (priv->soup_session, msg);
- if (status_class != SOUP_STATUS_CLASS_TRANSPORT_ERROR)
- parse_server_response (msg, &status_class);
+ status = soup_session_send_message (priv->soup_session, msg);
+ if (!SOUP_STATUS_IS_TRANSPORT_ERROR(status))
+ parse_server_response (msg, &status);
- return status_class;
+ return status;
}
-SoupStatusClass
+guint
sunone_message_send_no_parse (SunOneConnection *connection, SoupMessage *msg)
{
SunOneConnectionPrivate *priv = connection->priv;
Modified: trunk/lib/sunone-connection.h
==============================================================================
--- trunk/lib/sunone-connection.h (original)
+++ trunk/lib/sunone-connection.h Thu Jan 31 08:34:00 2008
@@ -249,8 +249,8 @@
const char *sunone_connection_get_wcap_version (SunOneConnection *connection);
void sunone_connection_set_wcap_version (SunOneConnection *connection, const char *wcap_version);
-SoupStatusClass sunone_message_send (SunOneConnection *cnc, SoupMessage *msg);
-SoupStatusClass sunone_message_send_no_parse (SunOneConnection *cnc, SoupMessage *msg);
+guint sunone_message_send (SunOneConnection *cnc, SoupMessage *msg);
+guint sunone_message_send_no_parse (SunOneConnection *cnc, SoupMessage *msg);
G_END_DECLS
Modified: trunk/lib/sunone-message.c
==============================================================================
--- trunk/lib/sunone-message.c (original)
+++ trunk/lib/sunone-message.c Thu Jan 31 08:34:00 2008
@@ -34,7 +34,7 @@
}
SoupMessage *
-sunone_message_new_from_uri (SoupUri *suri, const char *method)
+sunone_message_new_from_uri (SoupURI *suri, const char *method)
{
SoupMessage *msg;
@@ -46,9 +46,9 @@
}
SoupMessage *
-sunone_message_new_full_from_uri (SoupUri *suri, const char *method,
+sunone_message_new_full_from_uri (SoupURI *suri, const char *method,
const char *content_type,
- SoupOwnership owner, char *body,
+ SoupMemoryUse req_use, char *body,
gulong length)
{
SoupMessage *msg;
@@ -56,16 +56,16 @@
g_return_val_if_fail (suri != NULL, NULL);
msg = soup_message_new_from_uri (method, suri);
- soup_message_set_request (msg, content_type, owner, body, length);
+ soup_message_set_request (msg, content_type, req_use, body, length);
return msg;
}
#ifdef SUNONE_DEBUG
static void
-print_header (gpointer name, gpointer value, gpointer data)
+print_header (const char *name, const char *value, gpointer data)
{
- printf ("%s: %s\n", (char *) name, (char *) value);
+ printf ("%s: %s\n", name, value);
}
static void
@@ -74,20 +74,20 @@
if (jescs_verbose_debug) {
printf ("%d %s (%p @ %lu)\n", msg->status_code, msg->reason_phrase,
msg, time (0));
- soup_message_foreach_header (msg->response_headers,
+ soup_message_headers_foreach (msg->response_headers,
print_header, NULL);
- if (msg->response.length &&
+ if (msg->response_body->length &&
SUNONE_ERROR_IS_SUCCESSFUL (msg->status_code)) {
if (jescs_long_debug) {
- printf ("\n%.*s\n", (int) msg->response.length,
- msg->response.body);
+ printf ("\n%.*s\n", (int) msg->response_body->length,
+ msg->response_body->data);
} else {
- if (msg->response.length < RESPONSE_MAX_LENGTH)
- printf ("\n%.*s\n", (int) msg->response.length,
- msg->response.body);
+ if (msg->response_body->length < RESPONSE_MAX_LENGTH)
+ printf ("\n%.*s\n", (int) msg->response_body->length,
+ msg->response_body->data);
else
printf ("\n%.*s\n", RESPONSE_MAX_LENGTH,
- msg->response.body);
+ msg->response_body->data);
}
}
printf ("\n");
@@ -98,43 +98,43 @@
void
setup_message (SoupMessage *msg)
{
- soup_message_add_header (msg->request_headers, "User-Agent",
+ soup_message_headers_append (msg->request_headers, "User-Agent",
"Evolution/" EVOLUTION_VERSION);
#ifdef SUNONE_DEBUG
if (jescs_verbose_debug)
{
- const SoupUri *uri = soup_message_get_uri (msg);
+ const SoupURI *uri = soup_message_get_uri (msg);
printf ("%s %s%s%s HTTP/1.1 (%p @ %lu)\n",
msg->method, uri->path,
uri->query ? "?" : "",
uri->query ? uri->query : "",
msg, (unsigned long)time (0));
- soup_message_foreach_header (msg->request_headers,
+ soup_message_headers_foreach (msg->request_headers,
print_header, NULL);
- if (msg->request.length) {
- printf ("\n%.*s\n", (int)msg->request.length,
- msg->request.body);
+ if (msg->request_body->length) {
+ printf ("\n%.*s\n", (int)msg->request_body->length,
+ msg->request_body->data);
}
printf ("\n");
- soup_message_add_handler (msg, SOUP_HANDLER_POST_BODY,
- sunone_debug_handler, NULL);
+ g_signal_connect (msg, "got-headers",
+ G_CALLBACK (sunone_debug_handler), NULL);
}
#endif
}
void
-parse_server_response (SoupMessage *msg, SoupStatusClass *error_class)
+parse_server_response (SoupMessage *msg, guint *status)
{
icalcomponent *icalcomp;
icalproperty *icalprop;
- if (!msg->response.body)
+ if (!msg->response_body->data)
return;
- icalcomp = sunone_util_icalparser_parse_string (msg->response.body, msg->response.length);
+ icalcomp = sunone_util_icalparser_parse_string (msg->response_body->data, msg->response_body->length);
if (icalcomp) {
icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
while (icalprop) {
Modified: trunk/lib/sunone-message.h
==============================================================================
--- trunk/lib/sunone-message.h (original)
+++ trunk/lib/sunone-message.h Thu Jan 31 08:34:00 2008
@@ -20,9 +20,9 @@
G_BEGIN_DECLS
void sunone_message_init (void);
-SoupMessage *sunone_message_new_from_uri (SoupUri *suri, const char *method);
-SoupMessage *sunone_message_new_full_from_uri (SoupUri *suri, const char *method, const char *content_type, SoupOwnership owner, char *body, gulong length);
-void parse_server_response (SoupMessage *msg, SoupStatusClass *error_class);
+SoupMessage *sunone_message_new_from_uri (SoupURI *suri, const char *method);
+SoupMessage *sunone_message_new_full_from_uri (SoupURI *suri, const char *method, const char *content_type, SoupMemoryUse req_use, char *body, gulong length);
+void parse_server_response (SoupMessage *msg, guint *status);
void setup_message (SoupMessage *msg);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]