From patchwork Thu Sep 2 12:19:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sava Jakovljev X-Patchwork-Id: 1523691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=cpVC38UC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::337; helo=mail-wm1-x337.google.com; envelope-from=swupdate+bncbaabbdmdyoeqmgqe6fela2i@googlegroups.com; receiver=) Received: from mail-wm1-x337.google.com (mail-wm1-x337.google.com [IPv6:2a00:1450:4864:20::337]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H0g4L3v7Lz9tD5 for ; Thu, 2 Sep 2021 22:20:33 +1000 (AEST) Received: by mail-wm1-x337.google.com with SMTP id h1-20020a05600c350100b002e751bf6733sf617199wmq.8 for ; Thu, 02 Sep 2021 05:20:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1630585230; cv=pass; d=google.com; s=arc-20160816; b=cILjl6SeWOPPXggOp2rptupUORydYoPOs/hKSP7+EyU4l2h9lWSkQEbsC7qffSYYoL q715dHJHssAbpy7hXZ+f1G8tznCEQn8JF+QmBpycB5u5A4fLvS/a4+A+RDBCptRregYn nWTO0ggWcwRRir8/trIFfXuwqv3Ar+kaF24QTdcEnsvL4/ZdLnbB50euHGCgVSTU+5BK jDqL7RQS8kYMZ0ELMY/9GoUl33EvuEpzlTZlCvKuzCBeKTk9WAl0Mu04Df6gcANAZaYZ 9QGmovhFV6V3CerEbgAqEZ1ZnspXeJU9Bbtsrx4KLXLYMTlEOdgYEdXSoEHv6TIiAtTT Co/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=tRiEtBb2qecgJsWTdNJsZZZMnn8rlHGxqslD9SpZl+c=; b=Q+UwD2tr9aZ2fEGLi7rysEyjFBCO3yDxmvU65/S4HbcQ9poM163kJPRz73v9IQYQGm oOw2hopq2ceiK3TVZgpffVAvvzBX4na7vd2WtWJyTN9O3hof/og4yXJV+g85m14sv74N 72nzVrcR3xj2f6Z5CzZ4Lr6SNtzQQOJw/wiZy+LQuX8xyyNAG4gwPpCsn4TPF+p3PQJd oQdD9fiTnI8ICDwpkdUhQE7Ev6F/j1PUmi5zTPBadVWgckZhkY37lt8WXU7QkJoEDB2O uIz/2ltwlfvt2Tz6MrxsY6hs1tJjjTZdG3xcOgwPlS1StijQAypRjnVF4r3DlsFVvcuZ D0RA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@teufel.de header.s=hse1 header.b="NAQ/HYcm"; spf=pass (google.com: domain of sava.jakovljev@teufel.de designates 83.246.65.88 as permitted sender) smtp.mailfrom=sava.jakovljev@teufel.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=teufel.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=tRiEtBb2qecgJsWTdNJsZZZMnn8rlHGxqslD9SpZl+c=; b=cpVC38UC3FGOcjYfX27j/EcEWxsOpA8f9pLcIkFQLikaKX11tg0PNLAOkvLPa+SD0O 9ZRfR/7fB1I4EahFggUUi9HKRfZ/uEFMfbvfH1PyGoAMZsR+bHAipbzVo1Nb57djYADG uKNDc2bawGm+FJRoJjAfbVGqV0hv3D1x8YofAsfLMzWfJPJiADDmVxux/YBYIhNeIKSx Cd42DkDQZnwg/3nM/XBTMMCWIKtv+fbpsx2mP0Up1MXKs5CgazFVZe5TFvQo/sUXVx+G C47jkQJgfbDg6si0az4h+co7uuMyTCoGfBOjLRsBQVoQZW+5oRsrpkzttDrzugRNhOcH u6ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=tRiEtBb2qecgJsWTdNJsZZZMnn8rlHGxqslD9SpZl+c=; b=f0R6nXj3vskcAw0S2MtcJ+SXCAYw2Oc/a51BzpOuFFpwKAW35eUrtHEzuJUfwz/5wG 9cXrCg5IDJ7mxphrNSHAKLezSfj0IL57uD1pDwD+pidIDgi3H3Fzl4KPiNahr2olve4O Ft9yav16d0ssool2nfEzYAkKfFijuSU9Z7fcvkoHfS+Hom5ZZkBT38nfPAQbzsSHy1qv qqDqEadzsp0Ur3ZOpQjsIfVCSSXUVzPTj7hAmVLcV7URqlIT2sRK+XxBEoR3UvKkp0iK 31dErSZWLubnexc8lo7O9Lci8SoMbrjNAXjs13LYVAaDiSya1yjyh+I/8jG/TvhX0iny JxwQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533TzKp1btRix9PGXIx4QCg9FwNLL6BMWJmfVyBcQ+EzU0HyoFyF r6RtPgPFccn61UnK/jEEXW8= X-Google-Smtp-Source: ABdhPJzQSXwJBBnuwy2wo1FdcCA+d4g3YtxqSM044nN18+VDYWHMgWDZwYYE1nudaxcNX1A2ZcxO4w== X-Received: by 2002:a05:6000:1623:: with SMTP id v3mr3480502wrb.288.1630585229630; Thu, 02 Sep 2021 05:20:29 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a5d:6251:: with SMTP id m17ls2507772wrv.1.gmail; Thu, 02 Sep 2021 05:20:28 -0700 (PDT) X-Received: by 2002:a05:6000:92:: with SMTP id m18mr3373273wrx.293.1630585228821; Thu, 02 Sep 2021 05:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630585228; cv=none; d=google.com; s=arc-20160816; b=UKQPWLGR4qZaLtw5iBvYd4eG7ExrlbP/iNLc+EYV7gXmLs/jK+wzoLDacMZBc9Bt39 gpB4I3ODawvqk8JV51mA42mGzNJJCHApxES/KeTM6ecaTLjlAafOhf8ZsaT5bR3ktSGC PV1Ry2fNGAsqluXD2nMgQ1x8wdCpsehY2QjLXpmNF/YCgB/OFBiPJ43jp5GE9BzfaTrP caVSqGTRJFSdPmQTh/itm+F1uVDJ+kyKVOFjPfIOvMokt04mOVfF1MQglBCBqViuHP+z xmzd7ozIhrZxjkgkHcJ25LQi/owt29vvWlHogkLMh4uOblDUEYhXddEhufHz7aZQJHR6 x0hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from; bh=Upi7tWhkiMjAoUGUmb7y8IKBKEBM0Ct5xrg7aCge4aI=; b=IP3YqRl2OOT5vDWK/gHj6XKUiYEPFOZ2ziizv1oCrZDysZH54LPx8lTiVp5Uq/2Bzp 7jNN8sUFHbmf1xRO1vn5jvFfXM0Lrz4BswHYpstKkh+ZOl0D7Lg0tDotmC/1EyH9FZLi 1O0Ya8V2FPXS0X3aLC7QHwbLGtEDXd2uBaueLT939IL/P79U9DDGfd2BFQzKKmD250Ls p9oOzlAi5f0uf4yk12+rE6KjKnDwK97W3wWtj75IX+7r41VnT4uP6D1WuQh7Zaa4N532 HDzOXG3mr8qWsCwPrTFceiSzWXKWZHLVJvTlUsyMSgLP8onY2zSdQtLSiRrq6nD+JbpB QonQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@teufel.de header.s=hse1 header.b="NAQ/HYcm"; spf=pass (google.com: domain of sava.jakovljev@teufel.de designates 83.246.65.88 as permitted sender) smtp.mailfrom=sava.jakovljev@teufel.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=teufel.de Received: from mx-relay02-hz2.antispameurope.com (mx-relay02-hz2.antispameurope.com. [83.246.65.88]) by gmr-mx.google.com with ESMTPS id m185si90512wme.3.2021.09.02.05.20.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Sep 2021 05:20:28 -0700 (PDT) Received-SPF: pass (google.com: domain of sava.jakovljev@teufel.de designates 83.246.65.88 as permitted sender) client-ip=83.246.65.88; Received: from unknown ([212.91.255.190]) by mx-relay02-hz2.antispameurope.com; Thu, 02 Sep 2021 14:20:28 +0200 From: Sava Jakovljev To: CC: Sava Jakovljev Subject: [swupdate] [PATCH v2] channel_curl: Add ability to define a set of custom HTTP headers Date: Thu, 2 Sep 2021 14:19:57 +0200 Message-ID: <20210902121957.3749846-1-sava.jakovljev@teufel.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.10.25.44] X-ClientProxiedBy: DNS-EX-01.teufel.local (10.10.0.80) To DNS-EX-02.teufel.local (10.10.0.81) X-C2ProcessedOrg: b93e13a0-e8da-4ba4-97b8-f14375b21c41 X-cloud-security-sender: sava.jakovljev@teufel.de X-cloud-security-recipient: swupdate@googlegroups.com X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mx-relay02-hz2.antispameurope.com with 96B521166484 X-cloud-security-connect: unknown[212.91.255.190], TLS=1, IP=212.91.255.190 X-cloud-security-Digest: 8a5abf0a97b8de248197df2972a0dd0c X-cloud-security: scantime:2.401 X-Original-Sender: sava.jakovljev@teufel.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@teufel.de header.s=hse1 header.b="NAQ/HYcm"; spf=pass (google.com: domain of sava.jakovljev@teufel.de designates 83.246.65.88 as permitted sender) smtp.mailfrom=sava.jakovljev@teufel.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=teufel.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , * Expand Suricatta/Hawkbit client with ability to define a custom set of HTTP requests, defined through command line or configuration file, using 'a' short option or "custom-http-header" long option. Signed-off-by: Sava Jakovljev Acked-by: Stefano Babic --- corelib/channel_curl.c | 8 +++++--- corelib/downloader.c | 3 ++- doc/source/swupdate.rst | 7 +++++-- include/channel_curl.h | 3 ++- suricatta/server_general.c | 33 +++++++++++++++++++++++++++------ suricatta/server_general.h | 3 ++- suricatta/server_hawkbit.c | 32 +++++++++++++++++++++++++++++--- suricatta/server_hawkbit.h | 1 + 8 files changed, 73 insertions(+), 17 deletions(-) diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index e910f76..bc387d0 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -585,7 +585,7 @@ channel_op_res_t channel_set_options(channel_t *this, channel_data_t *channel_da goto cleanup; } - if (channel_data->headers) { + if (channel_data->received_headers) { /* * Setup supply request and receive reply HTTP headers. * A LIST_INIT()'d dictionary is expected at channel_data->headers. @@ -596,14 +596,16 @@ channel_op_res_t channel_set_options(channel_t *this, channel_data_t *channel_da CURLOPT_HEADERFUNCTION, channel_callback_headers) != CURLE_OK) || (curl_easy_setopt(channel_curl->handle, CURLOPT_HEADERDATA, - channel_data->headers) != CURLE_OK)) { + channel_data->received_headers) != CURLE_OK)) { result = CHANNEL_EINIT; goto cleanup; } + } + if (channel_data->headers_to_send) { struct dict_entry *entry; char *header; - LIST_FOREACH(entry, channel_data->headers, next) + LIST_FOREACH(entry, channel_data->headers_to_send, next) { if (ENOMEM_ASPRINTF == asprintf(&header, "%s: %s", diff --git a/corelib/downloader.c b/corelib/downloader.c index 437b36d..3d0a0a5 100644 --- a/corelib/downloader.c +++ b/corelib/downloader.c @@ -104,7 +104,8 @@ static channel_data_t channel_options = { .source = SOURCE_DOWNLOADER, .debug = false, .retries = DL_DEFAULT_RETRIES, - .low_speed_timeout = DL_LOWSPEED_TIME + .low_speed_timeout = DL_LOWSPEED_TIME, + .headers_to_send = NULL }; int start_download(const char *fname, int argc, char *argv[]) diff --git a/doc/source/swupdate.rst b/doc/source/swupdate.rst index 70375fa..c3c25c7 100644 --- a/doc/source/swupdate.rst +++ b/doc/source/swupdate.rst @@ -184,7 +184,7 @@ Images fully streamed --------------------- In case of remote update, SWUpdate extracts relevant images from the stream -and copies them into the directory pointed to by the environment variable +and copies them into the directory pointed to by the environment variable ``TMPDIR`` (if unset, to ``/tmp``) before calling the handlers. This guarantee that an update is initiated only if all parts are present and correct. However, on some systems with less resources, the amount of RAM @@ -652,6 +652,9 @@ Mandatory arguments are marked with '\*': | | | during this period - adapt this value to | | | | your use case! | +-------------------------+----------+--------------------------------------------+ +| -a | strings | Custom HTTP header with given value to be | +| | | send on every HTTP request made. | ++-------------------------+----------+--------------------------------------------+ systemd Integration @@ -706,7 +709,7 @@ files are also handed over on a "regular" start of SWUpdate via ``systemctl start swupdate.service``. Note that the socket paths in the two ``ListenStream=`` directives -have to match the socket paths ``CONFIG_SOCKET_CTRL_PATH`` and +have to match the socket paths ``CONFIG_SOCKET_CTRL_PATH`` and ``CONFIG_SOCKET_PROGRESS_PATH`` in SWUpdate's configuration. Here, the default socket path configuration is depicted. diff --git a/include/channel_curl.h b/include/channel_curl.h index 4de098e..6dabae6 100644 --- a/include/channel_curl.h +++ b/include/channel_curl.h @@ -72,5 +72,6 @@ typedef struct { struct swupdate_digest *dgst; char sha1hash[SWUPDATE_SHA_DIGEST_LENGTH * 2 + 1]; sourcetype source; - struct dict *headers; + struct dict *headers_to_send; + struct dict *received_headers; } channel_data_t; diff --git a/suricatta/server_general.c b/suricatta/server_general.c index 1d11ada..146f02c 100644 --- a/suricatta/server_general.c +++ b/suricatta/server_general.c @@ -453,8 +453,9 @@ static server_op_res_t server_get_deployment_info(channel_t *channel, channel_da */ channel_data->url= server_prepare_query(server_general.url, &server_general.configdata); - LIST_INIT(&server_general.httpheaders); - channel_data->headers = &server_general.httpheaders; + LIST_INIT(&server_general.received_httpheaders); + LIST_INIT(&server_general.httpheaders_to_send); + channel_data->received_headers = &server_general.received_httpheaders; result = map_http_retcode(channel->get(channel, (void *)channel_data)); @@ -462,12 +463,12 @@ static server_op_res_t server_get_deployment_info(channel_t *channel, channel_da free(channel_data->url); } - pollstring = dict_get_value(&server_general.httpheaders, "Retry-After"); + pollstring = dict_get_value(&server_general.received_httpheaders, "Retry-After"); if (pollstring) { server_set_polling_interval(pollstring); } - dict_drop_db(&server_general.httpheaders); + dict_drop_db(&server_general.received_httpheaders); return result; } @@ -522,7 +523,9 @@ void server_print_help(void) "\t -w, --retrywait Time to wait prior to retry and " "resume a download (default: %ds).\n" "\t -y, --proxy Use proxy. Either give proxy URL, else " - "{http,all}_proxy env is tried.\n", + "{http,all}_proxy env is tried.\n" + "\t -a, --custom-http-header Set custom HTTP header, " + "appended to every HTTP request being sent.", CHANNEL_DEFAULT_POLLING_INTERVAL, CHANNEL_DEFAULT_RESUME_TRIES, CHANNEL_DEFAULT_RESUME_DELAY); } @@ -608,6 +611,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) int choice = 0; LIST_INIT(&server_general.configdata); + LIST_INIT(&server_general.httpheaders_to_send); if (fname) { swupdate_cfg_handle handle; @@ -626,7 +630,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) /* reset to optind=1 to parse suricatta's argument vector */ optind = 1; opterr = 0; - while ((choice = getopt_long(argc, argv, "u:l:r:w:p:2:", + while ((choice = getopt_long(argc, argv, "u:l:r:w:p:2:a:", long_options, NULL)) != -1) { switch (choice) { case 'u': @@ -652,6 +656,21 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) SETSTRING(server_general.cached_file, optarg); break; /* Ignore not recognized options, they can be already parsed by the caller */ + case 'a': + if (optind >= argc) + return SERVER_EINIT; + + char *name = NULL; + SETSTRING(name, optarg); + char *value = NULL; + SETSTRING(value, argv[optind++]); + + if (dict_insert_value(&server_general.httpheaders_to_send, + name, + value) < 0) + return SERVER_EINIT; + + break; case '?': default: break; @@ -664,6 +683,8 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) return SERVER_EINIT; } + channel_data_defaults.headers_to_send = &server_general.httpheaders_to_send; + if (channel_curl_init() != CHANNEL_OK) return SERVER_EINIT; diff --git a/suricatta/server_general.h b/suricatta/server_general.h index 69345a1..d5d8d48 100644 --- a/suricatta/server_general.h +++ b/suricatta/server_general.h @@ -23,7 +23,8 @@ typedef struct { bool debug; char *cached_file; struct dict configdata; - struct dict httpheaders; + struct dict received_httpheaders; + struct dict httpheaders_to_send; update_state_t update_state; channel_t *channel; } server_general_t; diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 805158d..483d0d4 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -52,6 +52,7 @@ static struct option long_options[] = { {"cache", required_argument, NULL, '2'}, {"initial-report-resend-period", required_argument, NULL, 'm'}, {"connection-timeout", required_argument, NULL, 's'}, + {"custom-http-header", required_argument, NULL, 'a'}, {NULL, 0, NULL, 0}}; static unsigned short mandatory_argument_count = 0; @@ -132,7 +133,9 @@ static channel_data_t channel_data_defaults = {.debug = false, .nocheckanswer = false, .nofollow = false, .strictssl = true, - .connection_timeout = 0 + .connection_timeout = 0, + .headers_to_send = NULL, + .received_headers = NULL }; static struct timeval server_time; @@ -1606,7 +1609,9 @@ void server_print_help(void) "\t --cache Use cache file as starting SWU\n" "\t -m, --initial-report-resend-period Time to wait prior to retry " "sending initial state with '-c' option (default: %ds).\n" - "\t -s, --connection-timeout Set the server connection timeout (default: 300s).\n", + "\t -s, --connection-timeout Set the server connection timeout (default: 300s).\n" + "\t -a, --custom-http-header Set custom HTTP header, " + "appended to every HTTP request being sent.", CHANNEL_DEFAULT_POLLING_INTERVAL, CHANNEL_DEFAULT_RESUME_TRIES, CHANNEL_DEFAULT_RESUME_DELAY, INITIAL_STATUS_REPORT_WAIT_DELAY); @@ -1665,6 +1670,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) mandatory_argument_count = 0; LIST_INIT(&server_hawkbit.configdata); + LIST_INIT(&server_hawkbit.httpheaders); server_hawkbit.initial_report_resend_period = INITIAL_STATUS_REPORT_WAIT_DELAY; if (fname) { @@ -1681,6 +1687,9 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) */ read_module_settings(&handle, "hawkbit", server_hawkbit_settings, NULL); read_module_settings(&handle, "identify", settings_into_dict, &server_hawkbit.configdata); + + read_module_settings(&handle, "custom-http-headers", + settings_into_dict, &server_hawkbit.httpheaders); } swupdate_cfg_destroy(&handle); } @@ -1693,7 +1702,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) /* reset to optind=1 to parse suricatta's argument vector */ optind = 1; opterr = 0; - while ((choice = getopt_long(argc, argv, "t:i:c:u:p:xr:y::w:k:g:f:2:m:s:", + while ((choice = getopt_long(argc, argv, "t:i:c:u:p:xr:y::w:k:g:f:2:m:s:a:", long_options, NULL)) != -1) { switch (choice) { case 't': @@ -1786,6 +1795,21 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) channel_data_defaults.connection_timeout = (unsigned int)strtoul(optarg, NULL, 10); break; + case 'a': + if (optind >= argc) + return SERVER_EINIT; + + char *name = NULL; + SETSTRING(name, optarg); + char *value = NULL; + SETSTRING(value, argv[optind++]); + + if (dict_insert_value(&server_hawkbit.httpheaders, + name, + value) < 0) + return SERVER_EINIT; + + break; /* Ignore not recognized options, they can be already parsed by the caller */ case '?': break; @@ -1803,6 +1827,8 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) return SERVER_EINIT; } + channel_data_defaults.headers_to_send = &server_hawkbit.httpheaders; + if (channel_curl_init() != CHANNEL_OK) return SERVER_EINIT; diff --git a/suricatta/server_hawkbit.h b/suricatta/server_hawkbit.h index aea4bb0..67f1c31 100644 --- a/suricatta/server_hawkbit.h +++ b/suricatta/server_hawkbit.h @@ -29,6 +29,7 @@ typedef struct { bool polling_interval_from_server; bool debug; struct dict configdata; + struct dict httpheaders; bool has_to_send_configData; char *configData_url; char *cancel_url;