[libgovirt] Revert bogus commits



commit ebfb0f5a48e36a6532a3ca12d606f2893084f929
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Wed Dec 11 15:44:35 2013 +0100

    Revert bogus commits
    
    This commit reverts
    982c779 Add parsing test program
    c58b751 Revert "i18n"
    cc05701 i18n
    which were never meant to be pushed

 govirt/ovirt-action-rest-call.c |   11 +-----
 govirt/ovirt-proxy-private.h    |    1 -
 govirt/ovirt-proxy.c            |   41 ----------------------
 govirt/ovirt-rest-call.c        |   15 +--------
 tests/test-vm-parser.c          |   71 ---------------------------------------
 5 files changed, 2 insertions(+), 137 deletions(-)
---
diff --git a/govirt/ovirt-action-rest-call.c b/govirt/ovirt-action-rest-call.c
index afd623d..a4bf7c4 100644
--- a/govirt/ovirt-action-rest-call.c
+++ b/govirt/ovirt-action-rest-call.c
@@ -87,25 +87,16 @@ OvirtActionRestCall *ovirt_action_rest_call_new(RestProxy *proxy)
 {
     OvirtActionRestCall *call;
     gboolean admin;
-    char *session_id;
 
     g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
     call = OVIRT_ACTION_REST_CALL(g_object_new(OVIRT_TYPE_ACTION_REST_CALL, "proxy", proxy, NULL));
     g_return_val_if_fail(call != NULL, NULL);
-    g_object_get(G_OBJECT(proxy), "admin", &admin, "session-id", &session_id, NULL);
+    g_object_get(G_OBJECT(proxy), "admin", &admin, NULL);
     if (admin) {
         rest_proxy_call_add_header(REST_PROXY_CALL(call), "Filter", "false");
     } else {
         rest_proxy_call_add_header(REST_PROXY_CALL(call), "Filter", "true");
     }
-    rest_proxy_call_add_header(REST_PROXY_CALL(call), "Prefer", "persistent-auth");
-    if (session_id != NULL) {
-        char *header;
-        header = g_strdup_printf("JSESSIONID=%s", session_id);
-        rest_proxy_call_add_header(REST_PROXY_CALL(call), "Cookie", header);
-        g_free(header);
-        g_free(session_id);
-    }
 
     return call;
 }
diff --git a/govirt/ovirt-proxy-private.h b/govirt/ovirt-proxy-private.h
index a45e7fe..1053ce8 100644
--- a/govirt/ovirt-proxy-private.h
+++ b/govirt/ovirt-proxy-private.h
@@ -34,7 +34,6 @@ struct _OvirtProxyPrivate {
     char *tmp_ca_file;
     gboolean admin_mode;
     OvirtApi *api;
-    char *jsessionid;
 
     gulong ssl_ca_file_changed_id;
 };
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 7a6c667..b4ee32f 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -46,7 +46,6 @@ enum {
     PROP_0,
     PROP_CA_CERT,
     PROP_ADMIN,
-    PROP_SESSION_ID
 };
 
 #define CA_CERT_FILENAME "ca.crt"
@@ -163,29 +162,6 @@ RestXmlNode *ovirt_proxy_get_collection_xml(OvirtProxy *proxy,
         return NULL;
     }
 
-#if 0
-    GHashTable *headers_hash;
-    headers_hash = rest_proxy_call_get_response_headers(call);
-    if (headers_hash != NULL) {
-        GList *headers;
-        GList *it;
-        headers = g_hash_table_get_keys(headers_hash);
-        for (it = headers; it != NULL; it = it->next) {
-            g_warning("HEADER: %s -- %s", it->data,
-                    g_hash_table_lookup(headers_hash, it->data));
-        }
-        g_list_free(headers);
-        g_hash_table_unref(headers_hash);
-    }
-#endif
-
-    gchar *session_id;
-    session_id = rest_proxy_call_lookup_response_header(call, "JSESSIONID");
-    if ((session_id != NULL) && (g_strcmp0(session_id, proxy->priv->jsessionid) != 0)) {
-        g_object_set(G_OBJECT(proxy), "session-id", session_id);
-    }
-    g_warning("COOKIE: %s", rest_proxy_call_lookup_response_header(call, "Set-Cookie"));
-    g_warning("JSESSIONID: %s", rest_proxy_call_lookup_response_header(call, "JSESSIONID"));
     root = ovirt_rest_xml_node_from_call(call);
     g_object_unref(G_OBJECT(call));
 
@@ -714,9 +690,6 @@ static void ovirt_proxy_get_property(GObject *object,
     case PROP_ADMIN:
         g_value_set_boolean(value, proxy->priv->admin_mode);
         break;
-    case PROP_SESSION_ID:
-        g_value_set_string(value, proxy->priv->jsessionid);
-        break;
 
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
@@ -742,11 +715,6 @@ static void ovirt_proxy_set_property(GObject *object,
         proxy->priv->admin_mode = g_value_get_boolean(value);
         break;
 
-    case PROP_SESSION_ID:
-        g_free(proxy->priv->jsessionid);
-        proxy->priv->jsessionid = g_value_dup_string(value);
-        break;
-
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
     }
@@ -771,7 +739,6 @@ ovirt_proxy_finalize(GObject *obj)
     OvirtProxy *proxy = OVIRT_PROXY(obj);
 
     ovirt_proxy_set_tmp_ca_file(proxy, NULL);
-    g_free(proxy->priv->jsessionid);
 
     G_OBJECT_CLASS(ovirt_proxy_parent_class)->finalize(obj);
 }
@@ -803,14 +770,6 @@ ovirt_proxy_class_init(OvirtProxyClass *klass)
                                                          FALSE,
                                                          G_PARAM_READWRITE |
                                                          G_PARAM_STATIC_STRINGS));
-    g_object_class_install_property(oclass,
-                                    PROP_SESSION_ID,
-                                    g_param_spec_string("session-id",
-                                                        "session-id",
-                                                        "oVirt/RHEV JSESSIONID",
-                                                        NULL,
-                                                        G_PARAM_READWRITE |
-                                                        G_PARAM_STATIC_STRINGS));
 
     g_type_class_add_private(klass, sizeof(OvirtProxyPrivate));
 }
diff --git a/govirt/ovirt-rest-call.c b/govirt/ovirt-rest-call.c
index 076c849..42c6a51 100644
--- a/govirt/ovirt-rest-call.c
+++ b/govirt/ovirt-rest-call.c
@@ -118,31 +118,18 @@ static void ovirt_rest_call_finalize(GObject *object)
 static void ovirt_rest_call_constructed(GObject *object)
 {
     OvirtProxy *proxy;
-    OvirtRestCall *call = OVIRT_REST_CALL(object);
 
     G_OBJECT_CLASS(ovirt_rest_call_parent_class)->constructed(object);
 
     g_object_get(object, "proxy", &proxy, NULL);
     if (proxy != NULL) {
         gboolean admin;
-        char *session_id;
-        g_object_get(G_OBJECT(proxy),
-                     "admin", &admin,
-                     "session-id", &session_id,
-                     NULL);
+        g_object_get(G_OBJECT(proxy), "admin", &admin, NULL);
         if (admin) {
             rest_proxy_call_add_header(REST_PROXY_CALL(object), "Filter", "false");
         } else {
             rest_proxy_call_add_header(REST_PROXY_CALL(object), "Filter", "true");
         }
-        rest_proxy_call_add_header(REST_PROXY_CALL(call), "Prefer", "persistent-auth");
-        if (session_id != NULL) {
-            char *header;
-            header = g_strdup_printf("JSESSIONID=%s", session_id);
-            rest_proxy_call_add_header(REST_PROXY_CALL(call), "Cookie", header);
-            g_free(header);
-            g_free(session_id);
-        }
         g_object_unref(proxy);
     }
 }


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