summaryrefslogtreecommitdiffstats
path: root/lib/Utils/abrt_xmlrpc.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Utils/abrt_xmlrpc.h')
-rw-r--r--lib/Utils/abrt_xmlrpc.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Utils/abrt_xmlrpc.h b/lib/Utils/abrt_xmlrpc.h
new file mode 100644
index 00000000..e67ab19a
--- /dev/null
+++ b/lib/Utils/abrt_xmlrpc.h
@@ -0,0 +1,27 @@
+#ifndef ABRT_XMLRPC_H_
+#define ABRT_XMLRPC_H_ 1
+
+#include <xmlrpc-c/base.h>
+#include <xmlrpc-c/client.h>
+
+/*
+ * Simple class holding XMLRPC connection data.
+ * Used mainly to ensure we always destroy xmlrpc client and server_info
+ * on return or throw.
+ */
+
+struct abrt_xmlrpc_conn {
+ xmlrpc_client* m_pClient;
+ xmlrpc_server_info* m_pServer_info;
+
+ abrt_xmlrpc_conn(const char* url, bool no_ssl_verify) { new_xmlrpc_client(url, no_ssl_verify); }
+ ~abrt_xmlrpc_conn() { destroy_xmlrpc_client(); }
+
+ void new_xmlrpc_client(const char* url, bool no_ssl_verify);
+ void destroy_xmlrpc_client();
+};
+
+/* Utility function */
+void throw_if_xml_fault_occurred(xmlrpc_env *env);
+
+#endif