diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-15 15:29:24 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-15 15:29:24 +0100 |
commit | 2cf0d770b66b6c6ce50af2767f575db552cd784c (patch) | |
tree | 56ba70257c94add690ddaa8b0ec961c6964a146e /lib/utils/abrt_xmlrpc.cpp | |
parent | 2169959c6ba2d77512b8b39366a4d3e476931b4a (diff) | |
download | abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.tar.gz abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.tar.xz abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.zip |
move inc/ and lib/ to src/. No code changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/utils/abrt_xmlrpc.cpp')
-rw-r--r-- | lib/utils/abrt_xmlrpc.cpp | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/lib/utils/abrt_xmlrpc.cpp b/lib/utils/abrt_xmlrpc.cpp deleted file mode 100644 index bf74f05b..00000000 --- a/lib/utils/abrt_xmlrpc.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright (C) 2010 ABRT team - Copyright (C) 2010 RedHat Inc - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "abrtlib.h" -#include "abrt_xmlrpc.h" -#include "abrt_exception.h" - -void throw_xml_fault(xmlrpc_env *env) -{ - std::string errmsg = ssprintf("XML-RPC Fault(%d): %s", env->fault_code, env->fault_string); - xmlrpc_env_clean(env); // this is needed ONLY if fault_occurred - xmlrpc_env_init(env); // just in case user catches ex and _continues_ to use env - error_msg("%s", errmsg.c_str()); // show error in daemon log - throw CABRTException(EXCEP_PLUGIN, errmsg.c_str()); -} - -void throw_if_xml_fault_occurred(xmlrpc_env *env) -{ - if (env->fault_occurred) - { - throw_xml_fault(env); - } -} - -void abrt_xmlrpc_conn::new_xmlrpc_client(const char* url, bool ssl_verify) -{ - m_pClient = NULL; - m_pServer_info = NULL; - - xmlrpc_env env; - xmlrpc_env_init(&env); - - /* This should be done at program startup, once. - * We do it in abrtd's main */ - /* xmlrpc_client_setup_global_const(&env); */ - - struct xmlrpc_curl_xportparms curlParms; - memset(&curlParms, 0, sizeof(curlParms)); - /* curlParms.network_interface = NULL; - done by memset */ - curlParms.no_ssl_verifypeer = !ssl_verify; - curlParms.no_ssl_verifyhost = !ssl_verify; -#ifdef VERSION - curlParms.user_agent = PACKAGE_NAME"/"VERSION; -#else - curlParms.user_agent = "abrt"; -#endif - - struct xmlrpc_clientparms clientParms; - memset(&clientParms, 0, sizeof(clientParms)); - clientParms.transport = "curl"; - clientParms.transportparmsP = &curlParms; - clientParms.transportparm_size = XMLRPC_CXPSIZE(user_agent); - - xmlrpc_client_create(&env, XMLRPC_CLIENT_NO_FLAGS, - PACKAGE_NAME, VERSION, - &clientParms, XMLRPC_CPSIZE(transportparm_size), - &m_pClient); - if (env.fault_occurred) - throw_xml_fault(&env); - - m_pServer_info = xmlrpc_server_info_new(&env, url); - if (env.fault_occurred) - { - xmlrpc_client_destroy(m_pClient); - m_pClient = NULL; - throw_xml_fault(&env); - } -} - -void abrt_xmlrpc_conn::destroy_xmlrpc_client() -{ - if (m_pServer_info) - { - xmlrpc_server_info_free(m_pServer_info); - m_pServer_info = NULL; - } - if (m_pClient) - { - xmlrpc_client_destroy(m_pClient); - m_pClient = NULL; - } -} |