From patchwork Sat Jun 15 19:11:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Glembotzki X-Patchwork-Id: 1948202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=vIPc/V6D; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=DW/2pwIa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23f; helo=mail-lj1-x23f.google.com; envelope-from=swupdate+bncbdy5juxlviebb4wsw6zqmgqev4b24sa@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lj1-x23f.google.com (mail-lj1-x23f.google.com [IPv6:2a00:1450:4864:20::23f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W1mFS6s5Nz23tx for ; Sun, 16 Jun 2024 05:20:28 +1000 (AEST) Received: by mail-lj1-x23f.google.com with SMTP id 38308e7fff4ca-2eaeaefbcc6sf4873121fa.3 for ; Sat, 15 Jun 2024 12:20:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718479221; cv=pass; d=google.com; s=arc-20160816; b=gB45xfvhhqiWwIm0q/iZ4okE1h+d2ldiRsRjxKbEMYebxzEHsyfc6EIFAXNiFzJYfG NNsGGQ0W8Gn08hcAWZcHhvxl8g+NI6Jx3WsTS0GI7RRWCT3Zv2VITDPCOIYF9hpa1CmI eTAEIxpCND9l7PyhE9bLYz3YbRFpekVTsgdlrspcTgp8r6GjzM1MOUYxjKLuc66y+ox8 ECBz7P5nRvvhK4MGUg7K0ab6/b2Cc/o41tmU9ZJzNNiFhO4XGEwEFsJ99jg7LoB/pdR2 WcV0q9rVGuZl4YJHbmvn4eGhRRC0bw1N7FR6sE0C/mQi9fJ82fFSZq17rFTEUnSbUO9V l0uw== 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=V1zBHmcuKQZFvVxJA3r0suarM4eHzZFcWCyzgj6Yd/o=; fh=c+wSWaQlAF99X3k4eEmcgQG2uws13OTj/Kae2VINN/4=; b=DjYq2kdrEsecTGkJdSp+/WJkD723SXMi61TU4ZQXEAttqzS+sov8JDW05kxJf8d9Dr xzOmrvrwL0tGnqTvf9BVTPg8G/606MeArX7t5E1eMU1ZUx+GbIwP5p5w1Ea30tcFzbgQ nSH7TF5O14hJZR0IsvbQ6aJBC6ZzxffW72PTGIPoLxnWwj7hDh7rIpPDAqxsDizBkWsu xuzpAf5WVpwnFRpe/zCam2256fJodSW/uZrz3N4S8+MTGo5UOh5S9R8MCmyA7YZHt33p tBAynxHgiHo8ZOoaOyv4QzZOZncp9Z2AQBxi7WMS6cya+JWIfSxeyT7Sv/9tRlW5ZTEM l9RA==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ciXBHPCi; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=m.glembo@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=20230601; t=1718479221; x=1719084021; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=V1zBHmcuKQZFvVxJA3r0suarM4eHzZFcWCyzgj6Yd/o=; b=vIPc/V6DTEigc4TZUt2/8C9e1soMNWMKHNO3dGJYBtdaOF+7vvRc6lRGAhxGY0N9S4 HJEWOTQzdprXa02UHm8gSDDCeVVoPKiQhReLWuNrQYI7i1emQV/9h/yq4dpDygapylO9 TNiN8vCUDJbNNoY8X1zUE8jMXEOJ9MCrzmyFFM/cyh5iLRcVJmOKI7Rz7WQe6GvVF/wk MvJpxKCwppllB0wpLUBGN0LJrV/ygThN09t4h0u/23A+TYmrLfphbPztNzyCLTXCi5PK CKRn0qlBMAayLlVxTpmFTCepLd5dMj4GfHUeh2FOrsKCl5+RT4p/Ujg7LlM3Zc7KYzLj h8yA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718479221; x=1719084021; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=V1zBHmcuKQZFvVxJA3r0suarM4eHzZFcWCyzgj6Yd/o=; b=DW/2pwIaCPFevUzSyRt2swl7qGsxgP/52BsPOjqiO5a4fz8e1c8GFTWc59QMlbEkaR w69bo4J1H3DBtfM4bxN74N3EvIPYo6QvNrGpl2C4q6tbXgwGQO+smCnzs5iROAPXCcZx w1oz5EkFywGderBdSwFvCE5RbiMKMZqIcTO0kEo4MqfPcavKmqsBe61S81qHQxYr0yyE W7gtz4JySRK9GLbc30Lw7FfU+GQG5m/rDnc9BfwF/5jaU94WhX6/rUb5VjVfpfqJ6K3P YGW8Y9sCYCCSSlNzOL7wuWhC5Q9GSiEuJvSceTZ+/YuQ572tk0SYeJ5GYTJFjkNd488a 6qKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718479221; x=1719084021; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=V1zBHmcuKQZFvVxJA3r0suarM4eHzZFcWCyzgj6Yd/o=; b=b2Q5OVLlVvRlhb94gJEa4A9gyxQ+dWhLic4etlWRtGcylo6v72J5fyCXAGwgp32KaT 9YezGLfpBP2eU+4loCrG/Rms/xm1UWgS/MfliW3s0MGw5ZLN9w3HUBaUKfBRUVlHH5eC FGqcw5FdO/5o5AY6GwAlLF/dw4MpJOQraEYyBaq27IxZGSIJVpu/RlPX9/g9HE9ux2On yRmFwf+Ko3/eQB3Ziz1dH2Bn6wF43Xlr8o74q8O698IRp9laJXw8MAH+XP/bUXcrnHs0 KSchWnV9y/GXaLqPvfBEKHPnX+yeVYrV1qsYRdFe7Nd1p2vG8s/QSI32UVxk2Vsyy1sB ljlQ== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCV02BpK+NmpucQCfLwrEenkklnqt1Zjd//R7TwUiDybYfhCcx4fVjYDhpKYdqfr9PuxGgiyJ2f8avxoeN0WDjRQ04KxmNsMEgpcsbbo8Q== X-Gm-Message-State: AOJu0YzCqrd4cRikglJvPo+yplQwdCO+2aHjzZ+K5Y4lTyjgxUnFFOTB WfLMD8TMHShLZDvWddKkVIqA0bREho0eLoHkZP1vYOc+NNYgDTQu X-Google-Smtp-Source: AGHT+IGr+lpriAosnOP7/iHcEjl5nuMwP7lpfmfZqYJUzNoDwRrWmrgnOHahhQXZq64YgZvmFrEUTA== X-Received: by 2002:a05:651c:2108:b0:2eb:da20:7b3f with SMTP id 38308e7fff4ca-2ec0e463c43mr41358711fa.1.1718479219491; Sat, 15 Jun 2024 12:20:19 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:97cb:0:b0:2ec:2bb:f35c with SMTP id 38308e7fff4ca-2ec02bbf3d5ls12880311fa.1.-pod-prod-03-eu; Sat, 15 Jun 2024 12:20:16 -0700 (PDT) X-Received: by 2002:ac2:46ed:0:b0:52c:83c2:9670 with SMTP id 2adb3069b0e04-52ca6e9dcb7mr3579687e87.69.1718479216278; Sat, 15 Jun 2024 12:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718479216; cv=none; d=google.com; s=arc-20160816; b=Uik2Cy+9sUvM7SyKqpvpvxFOu7AT5pM+0abOgKzL8KaO6lvRy8JZuNRcTwtp32US1A 9KQHSKVAi8CcQR6zTIlDvCBr6yrES4KeFRn83hGFW/F8wLynsJCM2X73AR6aBNUWl4ba PfoeRwgLXNZOaT+aVUBj7gOkxRxZOlgtOPZrjS6HX2fCNyCeO0uF9AQXiz3112TqbkHq 7114BWAUVBDOuRtGSApCH3ZBaUsyY7aetGyVbzTzgMMz3YkE2APkLYbUib6KBrrC4yJO xBr8WcqfomGDrluEd08fSwL7X8outUUBMRrlezIi3DQx0ahsxoh2MzN6i8wUoP3Trcqe 5kYA== 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=QdSlvGQz1vUR/9sqdYIVj0bXGa6kF7pkJEQTQFw2NIQ=; fh=zydHuzCQWrku2OPQyZfraJZFcOpEXLQ/YBcu3QNiBd0=; b=DFvzpzqiU49Ci7cZ8jG2VPOUfr9UKQs8aYOsGEgUKllEj3EtteV/t6Qkge1KYhgmxg 7TVexcShgg4f4sAmhnAkIJ8/C17MGdfmwXMQVxOVyhHnBwpg5TDnLfNSbSiwrn4TOaq3 lLdMBC/wIGd9SKZNRaGsNoA0jN2VdSVdPfPLu4Bpl1a1lfbVGZoU+kvY1gLZP5+H6iif UrOZJ87s9fO6WdUR5N9GOIgkqxqfH5eouXaCxwVBDRDwNlWihdsj4oDUVLrYajbEkNQe 9dmJDW7Rsdc1Lr8vDU/UWQ4k/6UzFn4lZXAbUPQA/N5pgBRsL7miLC/Eai0jnYee05hz iCAg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ciXBHPCi; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com. [2a00:1450:4864:20::62e]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-422855708b8si572635e9.1.2024.06.15.12.20.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jun 2024 12:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62e as permitted sender) client-ip=2a00:1450:4864:20::62e; Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a6f13dddf7eso403887166b.0 for ; Sat, 15 Jun 2024 12:20:16 -0700 (PDT) X-Received: by 2002:a17:907:c819:b0:a6f:65e5:c98 with SMTP id a640c23a62f3a-a6f65e50e76mr431836966b.1.1718479215495; Sat, 15 Jun 2024 12:20:15 -0700 (PDT) Received: from PC-2635.irisgmbh.local ([2a02:8108:96c0:76fc::80bb]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56db61e0sm327283766b.49.2024.06.15.12.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 12:20:14 -0700 (PDT) From: Michael Glembotzki To: swupdate@googlegroups.com Cc: Michael Glembotzki Subject: [swupdate] [PATCH 04/21] mongoose: Forward port deprecated mg_strstr() Date: Sat, 15 Jun 2024 21:11:17 +0200 Message-ID: <20240615191941.40301-5-Michael.Glembotzki@iris-sensing.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240615191941.40301-1-Michael.Glembotzki@iris-sensing.com> References: <20240615191941.40301-1-Michael.Glembotzki@iris-sensing.com> MIME-Version: 1.0 X-Original-Sender: m.glembo@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ciXBHPCi; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=m.glembo@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: , mongoose rev-id: b46bee0540c83c780ae9622ef18b9cc8a7b3ebab Signed-off-by: Michael Glembotzki --- mongoose/mongoose_multipart.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mongoose/mongoose_multipart.c b/mongoose/mongoose_multipart.c index fccc5a62..5e57d326 100644 --- a/mongoose/mongoose_multipart.c +++ b/mongoose/mongoose_multipart.c @@ -48,6 +48,19 @@ static void mg_http_free_proto_data_mp_stream( memset(mp, 0, sizeof(*mp)); } +static const char *mg_strstr(const struct mg_str haystack, + const struct mg_str needle) { + size_t i; + if (needle.len > haystack.len) return NULL; + if (needle.len == 0) return haystack.buf; + for (i = 0; i <= haystack.len - needle.len; i++) { + if (memcmp(haystack.buf + i, needle.buf, needle.len) == 0) { + return haystack.buf + i; + } + } + return NULL; +} + static void mg_http_multipart_begin(struct mg_connection *c, struct mg_http_message *hm) { struct mg_http_multipart_stream *mp_stream;