* @SOUP_MESSAGE_NEW_CONNECTION: The message should be sent on a
* newly-created connection, not reusing an existing persistent
* connection. Note that messages with non-idempotent
- * #SoupMessage:method<!-- -->s behave this way by default.
+ * #SoupMessage:method<!-- -->s behave this way by default,
+ * unless #SOUP_MESSAGE_IDEMPOTENT is set.
+ * @SOUP_MESSAGE_IDEMPOTENT: The message is considered idempotent,
+ * regardless its #SoupMessage:method, and allows reuse of existing
+ * idle connections, instead of always requiring a new one, unless
+ * #SOUP_MESSAGE_NEW_CONNECTION is set.
*
* Various flags that can be set on a #SoupMessage to alter its
* behavior.
#endif
SOUP_MESSAGE_CONTENT_DECODED = (1 << 4),
SOUP_MESSAGE_CERTIFICATE_TRUSTED = (1 << 5),
- SOUP_MESSAGE_NEW_CONNECTION = (1 << 6)
+ SOUP_MESSAGE_NEW_CONNECTION = (1 << 6),
+ SOUP_MESSAGE_IDEMPOTENT = (1 << 7)
} SoupMessageFlags;
void soup_message_set_flags (SoupMessage *msg,
need_new_connection =
(soup_message_get_flags (item->msg) & SOUP_MESSAGE_NEW_CONNECTION) ||
- !SOUP_METHOD_IS_IDEMPOTENT (item->msg->method);
+ (!(soup_message_get_flags (item->msg) & SOUP_MESSAGE_IDEMPOTENT) &&
+ !SOUP_METHOD_IS_IDEMPOTENT (item->msg->method));
g_mutex_lock (&priv->conn_lock);