[evolution-ews] Make use of SOUP_MESSAGE_IDEMPOTENT SoupMessage flag, if available
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Make use of SOUP_MESSAGE_IDEMPOTENT SoupMessage flag, if available
- Date: Mon, 20 Aug 2012 12:15:11 +0000 (UTC)
commit 5ce8972b2f634d549038e4909e0f143642b8ce22
Author: Milan Crha <mcrha redhat com>
Date: Mon Aug 20 14:12:00 2012 +0200
Make use of SOUP_MESSAGE_IDEMPOTENT SoupMessage flag, if available
This is used to indicate that the message might be considered
idempotent, regardless the method being used. The thing is that
POST is not idempotent, thus each request means disconnect from
the server and reconnect. This flag allows EWS to not reconnect
that often.
configure.ac | 14 ++++++++++++++
src/server/e-soap-message.c | 8 ++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8d7a645..b4851df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,20 @@ dnl ****************************
EVO_KRB5_SUPPORT
dnl ****************************
+dnl Check for libsoup's SOUP_MESSAGE_IDEMPOTENT SoupMessage flag
+dnl ****************************
+AC_MSG_CHECKING([libsoup SOUP_MESSAGE_IDEMPOTENT flag])
+save_cflags=$CFLAGS; CFLAGS=$SOUP_CFLAGS
+save_libs=$LIBS; LIBS="$SOUP_LIBS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[#include <libsoup/soup.h>]],
+ [[SoupMessageFlags flag; flag = SOUP_MESSAGE_IDEMPOTENT]])],
+ [AC_DEFINE(HAVE_SOUP_MESSAGE_IDEMPOTENT_FLAG, 1, [libsoup provides SOUP_MESSAGE_IDEMPOTENT flag]) ac_cv_have_smi=yes],[ac_cv_have_smi=no])
+CFLAGS=$save_cflags
+LIBS=$save_libs
+AC_MSG_RESULT([$ac_cv_have_smi])
+
+dnl ****************************
dnl Expose version information
dnl ****************************
API_VERSION=1.2
diff --git a/src/server/e-soap-message.c b/src/server/e-soap-message.c
index c2a900a..f43adc5 100644
--- a/src/server/e-soap-message.c
+++ b/src/server/e-soap-message.c
@@ -3,6 +3,10 @@
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <libedataserver/eds-version.h>
#include <string.h>
@@ -103,6 +107,10 @@ e_soap_message_init (ESoapMessage *msg)
msg->priv->doc->standalone = FALSE;
msg->priv->doc->encoding = xmlCharStrdup ("UTF-8");
msg->priv->steal_fd = -1;
+
+#ifdef HAVE_SOUP_MESSAGE_IDEMPOTENT_FLAG
+ soup_message_set_flags (SOUP_MESSAGE (msg), SOUP_MESSAGE_IDEMPOTENT);
+#endif
}
static xmlNsPtr
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]