[PATCH 09/10] ch: move curl_data and curl_callback definitions

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

 



Move the definitions of curl_data and curl_callback to be used
within virCHMonitorPutNoContent.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@xxxxxxxxx>
---
 src/ch/ch_monitor.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index c9b08b0f75..88df9d4a03 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -671,6 +671,28 @@ virCHMonitorCurlPerform(CURL *handle)
     return responseCode;
 }
 
+struct curl_data {
+    char *content;
+    size_t size;
+};
+
+static size_t
+curl_callback(void *contents, size_t size, size_t nmemb, void *userp)
+{
+    size_t content_size = size * nmemb;
+    struct curl_data *data = userp;
+
+    if (content_size == 0)
+        return content_size;
+
+    data->content = g_realloc(data->content, data->size + content_size);
+
+    memcpy(&(data->content[data->size]), contents, content_size);
+    data->size += content_size;
+
+    return content_size;
+}
+
 int
 virCHMonitorPutNoContent(virCHMonitor *mon, const char *endpoint)
 {
@@ -698,28 +720,6 @@ virCHMonitorPutNoContent(virCHMonitor *mon, const char *endpoint)
     return ret;
 }
 
-struct curl_data {
-    char *content;
-    size_t size;
-};
-
-static size_t
-curl_callback(void *contents, size_t size, size_t nmemb, void *userp)
-{
-    size_t content_size = size * nmemb;
-    struct curl_data *data = userp;
-
-    if (content_size == 0)
-        return content_size;
-
-    data->content = g_realloc(data->content, data->size + content_size);
-
-    memcpy(&(data->content[data->size]), contents, content_size);
-    data->size += content_size;
-
-    return content_size;
-}
-
 static int
 virCHMonitorGet(virCHMonitor *mon, const char *endpoint, virJSONValue **response)
 {
-- 
2.47.0



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux