[libgovirt] Revert "OvirtProxy: Add additional-header API"



commit e1228727eabe56de51e7da9e3fcad1c32ddde05f
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Wed Apr 8 17:42:17 2015 +0200

    Revert "OvirtProxy: Add additional-header API"
    
    This reverts commit 674e2583e7fec1613bd2541456a18be635d1260b.
    
    This additional API will most likely not be needed in the end. Better
    not to expose it in the external API for now.

 govirt/govirt.sym            |    5 ---
 govirt/ovirt-proxy-private.h |    1 -
 govirt/ovirt-proxy.c         |   72 ------------------------------------------
 govirt/ovirt-proxy.h         |    3 --
 4 files changed, 0 insertions(+), 81 deletions(-)
---
diff --git a/govirt/govirt.sym b/govirt/govirt.sym
index bbe9d53..178ab07 100644
--- a/govirt/govirt.sym
+++ b/govirt/govirt.sym
@@ -107,9 +107,4 @@ GOVIRT_0.3.2 {
         ovirt_resource_delete_finish;
 } GOVIRT_0.3.1;
 
-GOVIRT_0.3.3 {
-        ovirt_proxy_add_header;
-        ovirt_proxy_add_headers;
-        ovirt_proxy_add_headers_from_valist;
-} GOVIRT_0.3.2;
 # .... define new API here using predicted next version number ....
diff --git a/govirt/ovirt-proxy-private.h b/govirt/ovirt-proxy-private.h
index 18ef6e9..b9cc153 100644
--- a/govirt/ovirt-proxy-private.h
+++ b/govirt/ovirt-proxy-private.h
@@ -38,7 +38,6 @@ struct _OvirtProxyPrivate {
     OvirtApi *api;
     char *jsessionid;
     SoupCookieJar *cookie_jar;
-    GHashTable *additional_headers;
 
     gulong ssl_ca_file_changed_id;
 };
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 9274048..d2c1d47 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -774,9 +774,6 @@ ovirt_proxy_dispose(GObject *obj)
         proxy->priv->cookie_jar = NULL;
     }
 
-    g_warn_if_fail(proxy->priv->additional_headers != NULL);
-    g_hash_table_unref(proxy->priv->additional_headers);
-
     G_OBJECT_CLASS(ovirt_proxy_parent_class)->dispose(obj);
 }
 
@@ -865,10 +862,6 @@ ovirt_proxy_init(OvirtProxy *self)
     self->priv->cookie_jar = soup_cookie_jar_new();
     rest_proxy_add_soup_feature(REST_PROXY(self),
                                 SOUP_SESSION_FEATURE(self->priv->cookie_jar));
-    self->priv->additional_headers = g_hash_table_new_full(g_str_hash,
-                                                           g_str_equal,
-                                                           g_free,
-                                                           g_free);
 }
 
 /* FIXME : "uri" should just be a base domain, foo.example.com/some/path
@@ -933,71 +926,6 @@ OvirtProxy *ovirt_proxy_new(const char *hostname)
 }
 
 
-/**
- * ovirt_proxy_add_header:
- * @proxy: a #OvirtProxy
- * @header: name of the header to add to each request
- * @value: value of the header to add to each request
- *
- * Add a http header called @header with the value @value to each oVirt REST
- * API call. If a header with this name already exists, the new value will
- * replace the old.
- */
-void ovirt_proxy_add_header(OvirtProxy *proxy, const char *header, const char *value)
-{
-    g_return_if_fail(OVIRT_IS_PROXY(proxy));
-
-    g_hash_table_replace(proxy->priv->additional_headers,
-                         (char *)g_strdup(header),
-                         (char *)g_strdup(value));
-}
-
-
-/**
- * ovirt_proxy_add_headers:
- * @proxy: a #OvirtProxy
- * @...: header name and value pairs, followed by %NULL
- *
- * Add the specified http header and value pairs to @proxy. These headers will
- * be sent with each oVirt REST API call. If a header already exists, the new
- * value will replace the old.
- */
-void ovirt_proxy_add_headers(OvirtProxy *proxy, ...)
-{
-    va_list headers;
-
-    g_return_if_fail(OVIRT_IS_PROXY(proxy));
-
-    va_start(headers, proxy);
-    ovirt_proxy_add_headers_from_valist(proxy, headers);
-    va_end(headers);
-}
-
-
-/**
- * ovirt_proxy_add_headers_from_valist:
- * @proxy: a #OvirtProxy
- * @headers: header name and value pairs
- *
- * Add the specified http header and value pairs to @proxy. These headers will
- * be sent with each oVirt REST API call. If a header already exists, the new
- * value will replace the old.
- */
-void ovirt_proxy_add_headers_from_valist(OvirtProxy *proxy, va_list headers)
-{
-    const char *header = NULL;
-    const char *value;
-
-    g_return_if_fail(OVIRT_IS_PROXY(proxy));
-
-    header = va_arg(headers, const char *);
-    while (header != NULL) {
-        value = va_arg(headers, const char *);
-        ovirt_proxy_add_header(proxy, header, value);
-        header = va_arg(headers, const char *);
-    }
-}
-
 static void ovirt_proxy_set_api_from_xml(OvirtProxy *proxy,
                                          RestXmlNode *node,
                                          GError **error)
diff --git a/govirt/ovirt-proxy.h b/govirt/ovirt-proxy.h
index 71fa4e0..d011209 100644
--- a/govirt/ovirt-proxy.h
+++ b/govirt/ovirt-proxy.h
@@ -66,9 +66,6 @@ struct _OvirtProxyClass {
 GType ovirt_proxy_get_type(void);
 
 OvirtProxy *ovirt_proxy_new(const char *host);
-void ovirt_proxy_add_header(OvirtProxy *proxy, const char *header, const char *value);
-void ovirt_proxy_add_headers(OvirtProxy *proxy, ...);
-void ovirt_proxy_add_headers_from_valist(OvirtProxy *proxy, va_list headers);
 
 G_DEPRECATED_FOR(ovirt_collection_lookup_resource)
 OvirtVm *ovirt_proxy_lookup_vm(OvirtProxy *proxy, const char *vm_name);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]