From patchwork Tue Oct 12 09:07:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 1539666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=jWefxf+e; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=idbXYDVq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::637; helo=mail-pl1-x637.google.com; envelope-from=swupdate+bncbcl4hcw73qcbby5aswfqmgqewiuigra@googlegroups.com; receiver=) Received: from mail-pl1-x637.google.com (mail-pl1-x637.google.com [IPv6:2607:f8b0:4864:20::637]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HT8vV1VMtz9ssD for ; Tue, 12 Oct 2021 20:07:49 +1100 (AEDT) Received: by mail-pl1-x637.google.com with SMTP id w2-20020a170902d70200b0013ed4c6e6f3sf8720446ply.9 for ; Tue, 12 Oct 2021 02:07:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1634029667; cv=pass; d=google.com; s=arc-20160816; b=toQJb7Z6zMK7M9jQ3d815KF0b0El2PFQ1BgRQTOrBPlR/4fcR1HK8oB6gR/NYOF0qE 1JGiA9xufWgohU3f/W3647fc9Pd/Tns1yi+iIPsJD5l3fgn/edIvH/hajEqoh7+yYxCF N5Hp7tCAmAm+Txjc8p/72kauoaO7YmwY8qBoGuR5fUPKpSji4xryF/NoiOdIdD87hwH+ FqVG7RsomyW4a2OgpMBjHcCvtanU05xhCIKPl3Px4UXUTdmDyOcg+HRkPN3WteWtmOza /yZyS37uB6IDr87DBEqPWRVAXI/k3uSY0nW5CvkT4ybydQSLfwJTdUcCq9QjHw+tWMVU jo2w== 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:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=udTZ+vptNOJnds+qngv8irYDet9VK4Rr3+Eh9koelsc=; b=kJSkfdt6ClUob6FdOv+8KovQBUAzx2nVumzDX9XNqfTxEo7PVOHFQ1WDhh0LWVLIQY i+toRvV7qilbcAGXAa+arNEA7L75k7FB2PV3PB9HALyW61Co0+/UIggPILelTcMqBkrb oPAmwP9BwUkZ9+Jk8NqPQEbGUHhk5JCwnHd+WDT8kYFSxD2o+m/1Oo94iiqCTNY0BvTX U3VBSy7NWdmew18ToYnJF7a1Dgg3AKA6pZLIvfG/443/CmT+Oz97f5p7uNcIiL60Q55k HkYJ/I4rNesMqwwYHVB/QSA06hgwcjujCtD9TB60rsjI4lC9GZ+lXLQV7PZPeVNXmZie WzWw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lwdnZkg8; spf=pass (google.com: domain of james.hilliard1@gmail.com designates 2607:f8b0:4864:20::d2e as permitted sender) smtp.mailfrom=james.hilliard1@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :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=udTZ+vptNOJnds+qngv8irYDet9VK4Rr3+Eh9koelsc=; b=jWefxf+e3g/iAWDc/sO0WzGs9e3D67GF0E3A+OvgmMiKiP2dHvV6r5V+cgAlNHPDvu w0yREg6fVT2WffLYmtr8CNaa6GuMrXH8h1KFIPYEGyXHjf2R6bp1OpiYHUqJCZEjMr4D AhMkP4Hhj93/KcdGdvj2TYXZVL7xhqYKCHxugtGZrxwgBjdPDTU6J+zjPfrvlmMlpPRG dF5GFmeZq1CuIeV8Z+awg1CzGl8g0Lc6sbQ0jDkwO121SAQxfCj2rNCa5amST+9jKKWA LB1+OWaOYjQbzp+uiQjW0PrCQxZdHP2fWOO7Y5NV4CrJqfma4/pKZlT8JODfcVeoEexE 41mQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :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=udTZ+vptNOJnds+qngv8irYDet9VK4Rr3+Eh9koelsc=; b=idbXYDVqMviZxhbYKX4APMviqJp64XHjnT/s9KmOAFjFx34vzjVKorJBxaKtgzkYgt Dd9c+S+V80aEMNNwBTva2otM2V4dBl35tugKG6O0+mnN3tnLHbGHoGCh4gYvXW58Eufd 4C2LUu3tzYxlFlZ/gmD2Tjo9qX3g/lidnLWgoIVDqtNjBAJ6+5mIp/Ta2LFUgzM9ycqG LvP/u6j/r6gohpWn9C2Uhoo2GY+ML29s+eEsSPI529lV7J7P2HeFUsISwn9i6I1PZxPS YC9gwP6WMu9Z0HZ9o0QyhxsX9F2XauxCnybdyGUmi80S02sG2MPYDXGll2F3I0VDJgIW 4UGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references: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=udTZ+vptNOJnds+qngv8irYDet9VK4Rr3+Eh9koelsc=; b=MwOtJs0H2p4BJQJPJDQ4IWY6d7jvwlkEUO9S6ZvQ0Wj+Jn9cDUAWzIn4ZJiYuAnqaJ 6uB1FtOmZLjepnq125bmXuAGGlsQ6dF1okT4s+FqrL8gEo8+35l5gEVcvZ0ZHT0QFe9N DZIm2OpOM73M1I8ajBsRCo+rcn5d5HMt4KkdO8OlMQgCfgUnsGWuHDCBsVkgNJDVqv3T i9kaZBnUjJzAs2G66ihBnBMTtBO3qZ2yhyCjPIuf/sBUssasbeSLINpvAl+/gaYUx5mB yVPWKCDPuzLOfMUFgYRmT8GGLnSBiXNnHXXxkVKTz7tf/mlPQik2bgEkneqvb2fGJs3z DiJg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533YxpiSfh1vty56AHF1vF2qjfxmBA0y1JUGd4zg0cBDBF7nPLFF w/Xyy9yY6/O/G/+2/mqptGU= X-Google-Smtp-Source: ABdhPJx9NvOD6CTA0bVDUbOSVj8LTSWo/dPFnckC54pk8Lh5/evvjV4592cPM5WdRXTqnv1sR47vBA== X-Received: by 2002:a17:90b:e07:: with SMTP id ge7mr4638417pjb.75.1634029667428; Tue, 12 Oct 2021 02:07:47 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:aa7:9afa:: with SMTP id y26ls3964988pfp.4.gmail; Tue, 12 Oct 2021 02:07:46 -0700 (PDT) X-Received: by 2002:a05:6a00:a10:b0:412:448c:89c7 with SMTP id p16-20020a056a000a1000b00412448c89c7mr30440926pfh.83.1634029666731; Tue, 12 Oct 2021 02:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634029666; cv=none; d=google.com; s=arc-20160816; b=x+R4wooy5oTBq4hiuS189JBQXuUzhqalpzQNkSOTgI/D4AZmEhnVGF+YtK0nPQrZGZ Rbj1r1TsFCKmXgxw594ciMG62Wb9yI7Vnjr7PhHTioA0XtCEFXIXdKqnv5UlFN3khKUR VkvzoPchjTLElkewQ09m2NJiaiUDMJLBMhs75knP/UAMOXatkB5re/Y7YjEVKonYSupy TksXreGQC5dCJG3YTfX78SWWuoNgkF1FLwh0/4qd7jWpJcSeVpOfi3368IK7R8bM/7Dw H123ousKT7pp37PZ6PoxATSxkbmqCL6+tnIm0ge+mqtmIdrItgvSzZu2mRw7BCICSfZo OFWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wVvlxxZRHI3L8wLgCRYco7kRkOBTjUh1iQgi68XEK0U=; b=TXHzDPT7mHZuBd3dpFXM6xS+mlTY/hoEdN3pls0cOOo4V+1uFpUIYV3oIRGze+He/B MiCfgpcxoCUgjXXy35eWr0Q0WHGojK7CflDHRpExxRXMqOIq9OsNnG0ZdqmGFCTETn1d 3hshHBZA0FJeNVLuPjcsjVzNIsz7rsjuJKhD0pjqzES1NjovljacJKHMYWhg7dTUC+zb 3wUyGz7zCFH3BAyahWRu8kzyAuuWS1FOCYI6s5RS/uoo0OIN0/qW7/4LXxO+N/NCzCPE Sf29Lx8BA2i+XLd6Wo/MVyX/SdS8f77FDKx57RamvjWPE1x87Rm0UJOmMHguPWVFKo8k sISw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lwdnZkg8; spf=pass (google.com: domain of james.hilliard1@gmail.com designates 2607:f8b0:4864:20::d2e as permitted sender) smtp.mailfrom=james.hilliard1@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com. [2607:f8b0:4864:20::d2e]) by gmr-mx.google.com with ESMTPS id u14si572951pgi.5.2021.10.12.02.07.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Oct 2021 02:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of james.hilliard1@gmail.com designates 2607:f8b0:4864:20::d2e as permitted sender) client-ip=2607:f8b0:4864:20::d2e; Received: by mail-io1-xd2e.google.com with SMTP id q205so22890017iod.8 for ; Tue, 12 Oct 2021 02:07:46 -0700 (PDT) X-Received: by 2002:a05:6602:13c3:: with SMTP id o3mr10129036iov.142.1634029666240; Tue, 12 Oct 2021 02:07:46 -0700 (PDT) Received: from MacBook-Pro.localdomain ([143.131.12.194]) by smtp.gmail.com with ESMTPSA id l20sm5266823ioh.34.2021.10.12.02.07.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Oct 2021 02:07:45 -0700 (PDT) From: James Hilliard To: swupdate@googlegroups.com Cc: James Hilliard Subject: [swupdate] [PATCH v2 3/3] mongoose: Fix compile warnings and add SPDX Date: Tue, 12 Oct 2021 03:07:33 -0600 Message-Id: <20211012090733.13578-3-james.hilliard1@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211012090733.13578-1-james.hilliard1@gmail.com> References: <20211012090733.13578-1-james.hilliard1@gmail.com> MIME-Version: 1.0 X-Original-Sender: james.hilliard1@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lwdnZkg8; spf=pass (google.com: domain of james.hilliard1@gmail.com designates 2607:f8b0:4864:20::d2e as permitted sender) smtp.mailfrom=james.hilliard1@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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: , Signed-off-by: James Hilliard --- mongoose/mongoose.c | 14 ++++++++------ mongoose/mongoose.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mongoose/mongoose.c b/mongoose/mongoose.c index 84978f6..403b471 100644 --- a/mongoose/mongoose.c +++ b/mongoose/mongoose.c @@ -2,6 +2,8 @@ // Copyright (c) 2013-2021 Cesanta Software Limited // All rights reserved // +// SPDX-License-Identifier: GPL-2.0-only +// // This software is dual-licensed: you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. For the terms of this @@ -177,7 +179,7 @@ static size_t mg_dns_parse_name_depth(const uint8_t *s, size_t len, size_t ofs, return i; } -size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst, +static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst, size_t dstlen) { return mg_dns_parse_name_depth(s, n, ofs, dst, dstlen, 0); } @@ -303,7 +305,7 @@ static void dns_cb(struct mg_connection *c, int ev, void *ev_data, (void) fn_data; } -void mg_dns_send(struct mg_connection *c, const struct mg_str *name, +static void mg_dns_send(struct mg_connection *c, const struct mg_str *name, uint16_t txnid, bool ipv6) { struct { struct mg_dns_header header; @@ -922,7 +924,7 @@ struct mg_str *mg_http_get_header(struct mg_http_message *h, const char *name) { return NULL; } -void mg_http_parse_headers(const char *s, const char *end, +static void mg_http_parse_headers(const char *s, const char *end, struct mg_http_header *h, int max_headers) { int i; for (i = 0; i < max_headers; i++) { @@ -1122,7 +1124,7 @@ static void restore_http_cb(struct mg_connection *c) { c->pfn = http_cb; } -char *mg_http_etag(char *buf, size_t len, size_t size, time_t mtime) { +static char *mg_http_etag(char *buf, size_t len, size_t size, time_t mtime) { snprintf(buf, len, "\"%lx." MG_INT64_FMT "\"", (unsigned long) mtime, (int64_t) size); return buf; @@ -2575,7 +2577,7 @@ static uint32_t blk0(union char64long16 *block, int i) { z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ w = rol(w, 30); -void mg_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) { +static void mg_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) { uint32_t a, b, c, d, e; union char64long16 block[1]; @@ -2973,7 +2975,7 @@ static void mg_set_non_blocking_mode(SOCKET fd) { #endif } -SOCKET mg_open_listener(const char *url, struct mg_addr *addr) { +static SOCKET mg_open_listener(const char *url, struct mg_addr *addr) { SOCKET fd = INVALID_SOCKET; int s_err = 0; // Memoized socket error, in case closesocket() overrides it memset(addr, 0, sizeof(*addr)); diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h index 55a828c..16e6a67 100644 --- a/mongoose/mongoose.h +++ b/mongoose/mongoose.h @@ -2,6 +2,8 @@ // Copyright (c) 2013-2021 Cesanta Software Limited // All rights reserved // +// SPDX-License-Identifier: GPL-2.0-only +// // This software is dual-licensed: you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. For the terms of this