diff mbox series

[07/13] Improve comments in the channel_curl

Message ID 20231120154731.44988-8-stefano.babic@swupdate.org
State Accepted
Headers show
Series [01/13] configs: update after removing CONFIG_HANDLER_IN_LUA | expand

Commit Message

Stefano Babic Nov. 20, 2023, 3:47 p.m. UTC
Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 include/channel_curl.h | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/include/channel_curl.h b/include/channel_curl.h
index 25d3602d..b1fc65c2 100644
--- a/include/channel_curl.h
+++ b/include/channel_curl.h
@@ -12,11 +12,9 @@ 
 #include <stdbool.h>
 #include "swupdate_status.h"
 
-/* Curl Channel Implementation Private Header File.
+/** Curl Channel Implementation Header File.
  *
- * This is a "private" header for testability, i.e., the declarations and
- * definitions herein should be used by code employing the curl channel
- * (e.g. server_hawkbit.c) and unit tests only.
+ * This is the specific channel implementation using libcurl.
  */
 
 typedef enum {
@@ -27,6 +25,10 @@  typedef enum {
 	CHANNEL_DELETE,
 } channel_method_t;
 
+/*
+ * format for a response: the channel can just transfer
+ * or try to parse the answer with a specific format
+ */
 typedef enum {
 	CHANNEL_PARSE_NONE,
 	CHANNEL_PARSE_JSON,
@@ -35,13 +37,19 @@  typedef enum {
 
 #define USE_PROXY_ENV (char *)0x11
 
+/*
+ * Structure to configure the connection and to
+ * exchange data.
+ * This is passed to the channel methods (defined in channel.h)
+ * to set up the connection.
+ */
 typedef struct {
-	char *url;
-	char *unix_socket;
-	char *cached_file;
+	char *url;		/* URL for connection */
+	char *unix_socket;	/* if set, the UNIX Socket is taken for local connection */
+	char *cached_file;	/* Retrieve file from cached file before getting from network */ 
 	char *auth;
-	char *request_body;
-	char *iface;
+	char *request_body;	/* Buffer for the answer */
+	char *iface;		/* Set a specific interface */
 	json_object *json_reply;
 	char *raw_reply;
 	bool dry_run;