From patchwork Mon Feb 26 13:34:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hartikainen, Sami" X-Patchwork-Id: 877890 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:400c:c05::23e; helo=mail-vk0-x23e.google.com; envelope-from=swupdate+bncbaabbie22dkakgqeq4e6f5i@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=teleste.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="A2pphyUK"; dkim-atps=neutral Received: from mail-vk0-x23e.google.com (mail-vk0-x23e.google.com [IPv6:2607:f8b0:400c:c05::23e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zqjWT0D3mz9s1q for ; Tue, 27 Feb 2018 00:35:31 +1100 (AEDT) Received: by mail-vk0-x23e.google.com with SMTP id m190sf8915678vkg.5 for ; Mon, 26 Feb 2018 05:35:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1519652129; cv=pass; d=google.com; s=arc-20160816; b=sEpiQ7eGMVUkg+JVXLQUq5Nv1bInhRk1OTqsYmPpWfILv9wF5SN540Ky3wgAAqS1xb boJDC57MgiwhP1fANu4RMcgXf8sLCFQsMreArQLgZbuxE1+f0kVRHEh6SnVnMTuO4whG nDGxb6NRMcD4hoci26TdlHY18Kk6C7rKi5b4QAxVf2ksXNGfFYbtfoYsWW1FE+1LyNIP VxszB2WqHNBaqSSPX9U+7fp6Kx8GE8FEhjdlOs+K7ysIdFsLWAXRqa58ik2wsA/G9Bd3 J5JMjetYS4jRRDFxJdRKzdJRfPQ5ieavO9Jml0OGIQ+b22TsZhy8woAp85Grt19uKi9x iHmA== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:arc-authentication-results:arc-message-signature:sender :dkim-signature:arc-authentication-results; bh=A5+9UEhLXZ7FK7Qen3Y6ksZ7Wov4Pdpx/g+oqN+7HdQ=; b=q2TY8pJLHETgAhkz9OV0OyZFo4Vxsw2zsglM6jJxPmmRDlnPqY5xrbqfBgcROP7KD9 ISyK/Zfl0Ol8CktpXaWyeM0mFeWRB39OPmejPatvDOzbASRDqGUYaRGNQgWOeG8RiLOy QGNiP48CDR3dQy7Y7RzyWLy+mQCBqBFQy5c2xy5SPsXH4XtfL056RPjC9hkx7Fs6KbN/ FofIeWZowSCYAYm+7FIk7KXyFUgY5NSxgBWgsQTJa3tHOmiQ/q/I1sRZ6qP7CIZ58s2B YFYwPWTiB2LeppC6rJt3rNNpvnmCP3N7vCR5eWpoNuGxF4FZ33fM/KpG9PbO+ewsNPDw V54Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@Teleste.onmicrosoft.com header.s=selector1-Teleste-com header.b=Rc7/66pe; spf=pass (google.com: domain of sami.hartikainen@teleste.com designates 40.107.1.70 as permitted sender) smtp.mailfrom=Sami.Hartikainen@teleste.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :spamdiagnosticoutput:spamdiagnosticmetadata:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=A5+9UEhLXZ7FK7Qen3Y6ksZ7Wov4Pdpx/g+oqN+7HdQ=; b=A2pphyUKxtZ7f14imAyPOs8WZYs12xqjqEsPB/26MXy8vsC+d9KIBMze6l/SmP5LMj Xu9xMZwMZn7QtGe9PeK3vEfz4gF7ZdWW1/OdsGfCFUFfQpq3rwQYDOKHIkKrABda4Ndr lYrj6SaIT+5lUHGylCYJhwaPeVs4YoB1n/xA3akWDQk3yxS4Iz9LuhlX+Q/ga1hw1ALY eNE5ZTUJ44d4HWGJc3FEE8Y5LtioqfC4Ym6VJwWBOrh7trF6rAfRgKV/IljUY8B2TOIx zIM5xDlbVACOG1Sly2F7bqgw1wYVXMK23QanaunaJTc1NfdeLlDEPfMplG0dtjAJtdzt jqhg== 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:spamdiagnosticoutput:spamdiagnosticmetadata :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=A5+9UEhLXZ7FK7Qen3Y6ksZ7Wov4Pdpx/g+oqN+7HdQ=; b=B4Xx0/WhmXbddXDU26G/XCdqGihPJcZHraD+7XPExgSeVQumiXcFhaWS4xLVIlMVbE DGdvP2nJcfmCj7/jpdduGdCWnarGGwRQkrG6aVBLmX3U3U1urLrjN1bknHInqX0J7UZE 4pu/kpnsZsclWLS5HKLyR1y/1Ob5PP9L9mlq8n6TBeguO4aoX4ZYRTJ+s8jh7Osz2j8i mKZrzBOAo7vNpYYqerJt0hCfDjgy5CW23Zkc1X0Kfua7OyN/5aBk3UxIgHay0M9Y64oE 6K6DLafu+DqRtqC8A5er3RfVlvrYXanV7Ep3KHaAKemP1HAtFeU8ahpQOrith5thUSdw T3sQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: APf1xPAKx0KNvp/lz1bEkXE0ce9U5fE+CKkPhxQr/rNB85RbYMBzMXOw AM8ef9D406FEx3Ir++My4Lg= X-Google-Smtp-Source: AG47ELu4QfSshxCD4qq/U7m4MJYWsHKZ6V/mOiyN4Oq6Ju5egUtwJxKk0nAXDnI7ZTqFjOogKJI6wA== X-Received: by 10.31.16.33 with SMTP id g33mr1098014vki.13.1519652129181; Mon, 26 Feb 2018 05:35:29 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 10.55.77.8 with SMTP id a8ls7519402qkb.3.gmail; Mon, 26 Feb 2018 05:35:28 -0800 (PST) X-Received: by 10.233.237.82 with SMTP id c79mr7767745qkg.40.1519652128606; Mon, 26 Feb 2018 05:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519652128; cv=none; d=google.com; s=arc-20160816; b=fU7WujJttmd/b45U8WZxq4HUqXL2vzxSBwQxwcpS8Stcsze/I1WlUfFVwEHj0cyaBs j0y3/PFR9ErERr2rX/g2wMSAnWpIqLFn54luTyhdMDpuTzCl/V7JDiHbjUskgDF34hB3 vsEuyeRCicAIBW33QjxeIAJWwMPK7IhpqRMNODo+U18c29sBEJXcZy+NS7UHRzJduvlS MM5Wvmct3xZRW3iuY0IhVRc8UW/o7R6N99J8BAKQ21DhwyU6SKGipHyg1UmW31uLruFa J1TFH/OhjadFwGV0+ru4/jg0YS3Vq4rCkSE1UtVO99sENYaN8HybPsMX3OjQKMGyIKBB R0pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput:mime-version:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/e2KGswakP16JyYulwIYMi5HS/F0rAhiRD4jMLa/9EQ=; b=fkHFVS1jP5oQsuv2sKS7NYAwcIgtBGJsOPCfYJJjQY3d5PFOdypCtP75wV91XlGFPi TTdSDGuqANURuQYTd2m+41HDWSY/hC+MrH6aYKGGD1aGW9rzAcnbTnfSfJAY3t3Asl6O 2DHtHRuFnXY/il8FI3QCzFux37eMsUelVj/01lpYA04h5kv6cIpUFrOz1FeliKmF/WFu FBowCwfOGdEsx7Jju8JTRGOuUhwDe8yQbyxHj1UmzgUHqvNQU+QXIdgXTblaNfv8UpD0 N+UQdUf+PT/LB9h7mketSwZ85qhbUiqJRGKrNnk5EVxffkCg6TT2r5l/PyXHFZ/Zg5n0 Y47Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@Teleste.onmicrosoft.com header.s=selector1-Teleste-com header.b=Rc7/66pe; spf=pass (google.com: domain of sami.hartikainen@teleste.com designates 40.107.1.70 as permitted sender) smtp.mailfrom=Sami.Hartikainen@teleste.com Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10070.outbound.protection.outlook.com. [40.107.1.70]) by gmr-mx.google.com with ESMTPS id v129si498824qka.0.2018.02.26.05.35.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 05:35:28 -0800 (PST) Received-SPF: pass (google.com: domain of sami.hartikainen@teleste.com designates 40.107.1.70 as permitted sender) client-ip=40.107.1.70; Received: from HE1PR0401CA0081.eurprd04.prod.outlook.com (2603:10a6:3:19::49) by AM0PR0402MB3523.eurprd04.prod.outlook.com (2603:10a6:208:1b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Mon, 26 Feb 2018 13:35:23 +0000 Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by HE1PR0401CA0081.outlook.office365.com (2603:10a6:3:19::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.527.15 via Frontend Transport; Mon, 26 Feb 2018 13:35:23 +0000 Received-SPF: Pass (protection.outlook.com: domain of teleste.com designates 212.213.19.238 as permitted sender) receiver=protection.outlook.com; client-ip=212.213.19.238; helo=FRAX.twin.net; Received: from FRAX.twin.net (212.213.19.238) by AM5EUR03FT037.mail.protection.outlook.com (10.152.17.241) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Mon, 26 Feb 2018 13:35:22 +0000 Received: from contrix.teleste.com (192.168.150.55) by FRAX.twin.net (10.1.0.45) with Microsoft SMTP Server id 14.2.247.3; Mon, 26 Feb 2018 15:35:16 +0200 Received: by contrix.teleste.com (Postfix, from userid 1001) id 1338B124; Mon, 26 Feb 2018 15:35:16 +0200 (EET) From: Sami Hartikainen To: CC: Sami Hartikainen Subject: [swupdate] [PATCH] mongoose: Allow WEB API v1 and v2 both be enabled Date: Mon, 26 Feb 2018 15:34:55 +0200 Message-ID: <1519652095-8588-1-git-send-email-sami.hartikainen@teleste.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:212.213.19.238; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39850400004)(396003)(39380400002)(346002)(2980300002)(438002)(199004)(189003)(6916009)(2351001)(50226002)(305945005)(69596002)(5660300001)(26005)(2906002)(356003)(50466002)(81166006)(106466001)(81156014)(68736007)(16586007)(316002)(59450400001)(1857600001)(48376002)(107886003)(42186006)(53936002)(8936002)(4326008)(6666003)(6346003)(6266002)(103686004)(478600001)(72206003)(186003)(97736004)(51416003)(36756003)(86362001)(8676002)(47776003)(52956003)(336011)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0402MB3523; H:FRAX.twin.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT037; 1:uZ8cMwIJk45kjC6AsxAx+DDTnmT+QwqbUBLWrQX89IW9J4qm4BBXmKQk9K05Dr/v8CGBSC3EG8UBs2/ACEd5IFgFnsdGsyzr6oKcU4FE/6ikiu3n+QswNZN6BPSADvCx X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b5fb0177-f574-4a8c-7871-08d57d1dc99c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:AM0PR0402MB3523; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0402MB3523; 3:s/183iMIdOyvAge1TBrwQXk1IppDaXCI/Z6goBQxsUgAXWok8b7R4dIz7xF9ktAr0CM9ldDacKkfJwqbLO9KTefgWqfhGP07kvemmGlP6OpIfUVZBqLZizWt9xUSQYwTVl/fja+gQcidNM18uTIJDrY0Op2cKKj6gaCPI4LeqtrYlHWe2IWf3ODwLxQFDWPwxfgfR4E5oHnqo8SfZYX0CQo2snyu8EoFIsFEv6YgaTjVLGL49PDYOcNhwS1zYx3b0ZQ0OVwdg9k8bdygrVEaJl6CN7MAKVoWyzNJQmGM/CSnif2e0O4obyMjFloBagY/iga5yWtAntkrscN/MQ3hVBbOynrpFF8LsYssQRMvqQs=; 25:BLCevgeU197XHp1+s46v2fQ6ue/l8sCnzKGaAlD8m5XpsIE/4mY0oHT5iGihHq058TZJkTac4CkbRTo9MqkPeTkyQqJyo1vmSmE5CQbn9NFdfHh76tIM11QF1er11XuyemV+0TMk/XDQR8Ge4P3PAKvBG6Elu/Y5lmBFODfZkFncJ7mDhCvSOwsw3QmrbdE8EUP1c2aYdFdZlH/hfUvQLximjmc+Crow28NrSIMonjjZIh5aDaMYQ4XsN7N8w0HBI+b5AzzAfqxrqghKJIQYEyS5VyDwAn2sXMi+SCTtKHN0Ncmqlq0QnhjeZ4N13wb2t5m+cnR3DU+D7JcNtPUywA== X-MS-TrafficTypeDiagnostic: AM0PR0402MB3523: X-Microsoft-Exchange-Diagnostics: 1; AM0PR0402MB3523; 31:Nz3/+a2eZGpcrDShv0a8/BLoUpvaQGFmMHycCmtCl+DPCtnVzRZxbmbkwFvaQ4JgFzXlOsS+kvW0c/HryDml2lIRUIFeMpFbp7ByOl56sgxy012ffzW15ZjzOHVVI3GcH9n7jlnDtRnEI2Mx/XfMZEl04A36YGlQWo6ZR9KqFqGVqFOoKOn9c0phzG/t4bMWlXh8av7yXm9gQ76zBRkXwMy2xBZ2ZcQKElWJgUPxqPQ=; 20:4U6SwLckZkfiT7pG6umnJtwzv5DkUBa9tWajE6oDlpUDEbX2et92vH0CHny8OsJHer5dIGlcRTj1kJulHO9+AKGgR44bEXDm0vCfa0k9lx9/VwDUXJ1fdr3YH0yCcmXb4crY2JARencdCZVfJWtV6hFH+IT6VxcUJtb1cuOQfVDpo8ZYdAMvW+LaURgMtCaFTs1s1We1OuFMgou47jB1JrfotNNXAJ6Zb2YSDrLfqNxxxR+4XurfYPHv8NZSj4weqpuQPe2uD9e3Wf7eCn3dSHvYqy/LB496cdAX8dmeqPrso+86ZdaZeNHRR5v4ChOzPOiHb71B9fHIbw94ZsaAo9iCuVEBPvmUshpuREzL4sQWyG+TXXSNOS/bu1yk5Nic0jxH4jPzaO2v4nqXkjqmj5wgd/hul2KzQnBZJpXACg2r8+Iv+V/pg4SldlSrnaH1N6nT9FOCgP0N0EOkCv1mM5Iekw18RYT2R5ANlk+HFyV/aZUHLeVTOAi9FpxV9eg6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3231220)(944501187)(52105095)(3002001)(6041288)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:AM0PR0402MB3523; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0402MB3523; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0402MB3523; 4:A2xnBne0wBpwqYWgEAguqPepdGr/rROahYZoBtlmltvl6sqwQS08MGP5C255EvMwumpYOka2D7+gP/CagI76od+1xH9aKC5c6M/exDPgJKlBdQ+ZFIQYXsTVIw5yfuKdeZ0crboKJxc53mP5qesiy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IdNU+YF69UDYp8OF93/TiwzAYI/Xx4+dWhlebJtKjychacAmfa3nLnqUzSS6A59TV7Ck4yoqtgeVp73nNUbsZTmpStqJJyegRWsVypfdH3F+NmgjiciWTyRcftvo7hLc9Z/HEEwkA5f68fyc3Ivzyz3aCt57opBJC5J8WQJZx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Teleste.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2018 13:35:22.9666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5fb0177-f574-4a8c-7871-08d57d1dc99c X-MS-Exchange-CrossTenant-Id: 0a3a6402-5c43-4939-8e53-47a694177b24 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0a3a6402-5c43-4939-8e53-47a694177b24; Ip=[212.213.19.238]; Helo=[FRAX.twin.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3523 X-Original-Sender: sami.hartikainen@teleste.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@Teleste.onmicrosoft.com header.s=selector1-Teleste-com header.b=Rc7/66pe; spf=pass (google.com: domain of sami.hartikainen@teleste.com designates 40.107.1.70 as permitted sender) smtp.mailfrom=Sami.Hartikainen@teleste.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: , To ease transition, or simply to enable the use of modern clients while still supporting the use of the swuforwarder handler (which only talks API v1), both the v1 and v2 API may be enabled. When both API versions are enabled, the v2 message broadcast thread consumes the status messages from the installer. A message queue is set up to make those messages available for the v1 message polling handler for URI /getstatus.json. Signed-off-by: Sami Hartikainen --- mongoose/Config.in | 15 +-- mongoose/mongoose_interface.c | 246 +++++++++++++++++++++++++++++++----------- 2 files changed, 194 insertions(+), 67 deletions(-) diff --git a/mongoose/Config.in b/mongoose/Config.in index a001247..cd52f2c 100644 --- a/mongoose/Config.in +++ b/mongoose/Config.in @@ -14,27 +14,28 @@ choice config MONGOOSE bool "mongoose" help - Mongoose embeddded web server + Mongoose embedded web server endchoice -choice - prompt "Web Application Interface" - default MONGOOSE_WEB_API_V1 - help - Choose the bootloader +menu "Web Application Interface" config MONGOOSE_WEB_API_V1 bool "Version 1 (deprecated)" + default y help Support for version 1 config MONGOOSE_WEB_API_V2 bool "Version 2" + default n help Support for version 2 -endchoice +comment "Web API v1 or v2 or both required" + depends on !MONGOOSE_WEB_API_V1 && !MONGOOSE_WEB_API_V2 + +endmenu config MONGOOSEIPV6 bool "IPv6 support" diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c index 89a51f3..0401a9a 100644 --- a/mongoose/mongoose_interface.c +++ b/mongoose/mongoose_interface.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "mongoose.h" @@ -32,6 +33,9 @@ #define MG_PORT "8080" #define MG_ROOT "." +#define WEB_API_v1 1 +#define WEB_API_v2 2 + struct mongoose_options { char *root; char *listing; @@ -49,6 +53,25 @@ struct file_upload_state { static struct mg_serve_http_opts s_http_server_opts; +#if !defined(CONFIG_MONGOOSE_WEB_API_V1) && !defined(CONFIG_MONGOOSE_WEB_API_V2) +#error "WEB API v1 or v2 or both must be defined" +#endif + +#if defined(CONFIG_MONGOOSE_WEB_API_V1) && defined(CONFIG_MONGOOSE_WEB_API_V2) +#define NUM_CACHED_MESSAGES 100 + +struct msg_elem { + ipc_message msg; + SIMPLEQ_ENTRY(msg_elem) next; +}; + +SIMPLEQ_HEAD(msglist, msg_elem); +static struct msglist ipcmessages; +static unsigned long nrmsgs = 0; +static pthread_mutex_t msglock = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t msgcond = PTHREAD_COND_INITIALIZER; +#endif + #if defined(CONFIG_MONGOOSE_WEB_API_V2) #define enum_string(x) [x] = #x static const char *get_status_string(unsigned int status) @@ -112,20 +135,163 @@ static size_t snescape(char *dst, size_t n, const char *src) } #endif -static void upload_handler(struct mg_connection *nc, int ev, void *p) +static int get_inst_status(ipc_message *msg, int __attribute__ ((__unused__)) api_vers) +{ +#if defined(CONFIG_MONGOOSE_WEB_API_V1) && defined(CONFIG_MONGOOSE_WEB_API_V2) + struct msg_elem *newmsg; + struct msg_elem *oldmsg; + int ret = -1; + + switch (api_vers) { + case WEB_API_v1: + pthread_mutex_lock(&msglock); + pthread_cond_wait(&msgcond, &msglock); + oldmsg = SIMPLEQ_FIRST(&ipcmessages); + if (oldmsg) { + SIMPLEQ_REMOVE_HEAD(&ipcmessages, next); + nrmsgs--; + memcpy(msg, &oldmsg->msg, sizeof(*msg)); + free(oldmsg); + ret = 0; + } + pthread_mutex_unlock(&msglock); + break; + + case WEB_API_v2: + newmsg = (struct msg_elem *)calloc(1, sizeof(*newmsg)); + if (!newmsg) + return -1; + + ret = ipc_get_status(msg); + + /* Cache message for APIv1, but consider + * changed messages only. */ + if (!ret) { + pthread_mutex_lock(&msglock); + + oldmsg = SIMPLEQ_LAST(&ipcmessages, msg_elem, next); + if (!oldmsg || memcmp(&oldmsg->msg.data.status, + &msg->data.status, + sizeof(msg->data.status))) { + + nrmsgs++; + if (nrmsgs > NUM_CACHED_MESSAGES) { + oldmsg = SIMPLEQ_FIRST(&ipcmessages); + SIMPLEQ_REMOVE_HEAD(&ipcmessages, next); + free(oldmsg); + nrmsgs--; + } + + memcpy(&newmsg->msg, msg, sizeof(*msg)); + SIMPLEQ_INSERT_TAIL(&ipcmessages, newmsg, next); + newmsg = NULL; + } + + pthread_cond_signal(&msgcond); + pthread_mutex_unlock(&msglock); + } + + if (newmsg) + free(newmsg); + break; + } + + return ret; +#else + return ipc_get_status(msg); +#endif +} + +static void cleanup_msg_list(void) +{ +#if defined(CONFIG_MONGOOSE_WEB_API_V1) && defined(CONFIG_MONGOOSE_WEB_API_V2) + struct msg_elem *elem; + + pthread_mutex_lock(&msglock); + + while (!SIMPLEQ_EMPTY(&ipcmessages)) { + elem = SIMPLEQ_FIRST(&ipcmessages); + SIMPLEQ_REMOVE_HEAD(&ipcmessages, next); + free(elem); + } + + nrmsgs = 0; + pthread_mutex_unlock(&msglock); +#endif +} + +static void upload_handler_v2(struct mg_connection *nc, int ev, void *p) { struct mg_http_multipart_part *mp; struct file_upload_state *fus; + + switch (ev) { + case MG_EV_HTTP_PART_BEGIN: + mp = (struct mg_http_multipart_part *) p; + + fus = (struct file_upload_state *) calloc(1, sizeof(*fus)); + if (fus == NULL) { + mg_http_send_error(nc, 500, "Out of memory"); + break; + } + + cleanup_msg_list(); + + fus->fd = ipc_inst_start_ext(SOURCE_WEBSERVER, strlen(mp->file_name), mp->file_name); + if (fus->fd < 0) { + mg_http_send_error(nc, 500, "Failed to queue command"); + free(fus); + break; + } + + mp->user_data = fus; + + break; + + case MG_EV_HTTP_PART_DATA: + mp = (struct mg_http_multipart_part *) p; + fus = (struct file_upload_state *) mp->user_data; + + if (!fus) + break; + + ipc_send_data(fus->fd, (char *) mp->data.p, mp->data.len); + fus->len += mp->data.len; + + break; + + case MG_EV_HTTP_PART_END: + mp = (struct mg_http_multipart_part *) p; + fus = (struct file_upload_state *) mp->user_data; + + if (!fus) + break; + + ipc_end(fus->fd); + + mg_send_response_line(nc, 200, + "Content-Type: text/plain\r\n" + "Connection: close"); + mg_send(nc, "\r\n", 2); + mg_printf(nc, "Ok, %s - %d bytes.\r\n", mp->file_name, (int) fus->len); + nc->flags |= MG_F_SEND_AND_CLOSE; + + mp->user_data = NULL; + free(fus); + break; + } +} + #if defined(CONFIG_MONGOOSE_WEB_API_V1) +static void upload_handler_v1(struct mg_connection *nc, int ev, void *p) +{ struct mg_str *filename, *data; struct http_message *hm; size_t length; char buf[16]; int fd; -#endif switch (ev) { -#if defined(CONFIG_MONGOOSE_WEB_API_V1) case MG_EV_HTTP_REQUEST: hm = (struct http_message *) p; @@ -149,6 +315,8 @@ static void upload_handler(struct mg_connection *nc, int ev, void *p) return; } + cleanup_msg_list(); + fd = ipc_inst_start_ext(SOURCE_WEBSERVER, filename->len, filename->p); ipc_send_data(fd, (char *) hm->body.p, hm->body.len); ipc_end(fd); @@ -161,62 +329,13 @@ static void upload_handler(struct mg_connection *nc, int ev, void *p) nc->flags |= MG_F_SEND_AND_CLOSE; break; -#endif - case MG_EV_HTTP_PART_BEGIN: - mp = (struct mg_http_multipart_part *) p; - fus = (struct file_upload_state *) calloc(1, sizeof(*fus)); - if (fus == NULL) { - mg_http_send_error(nc, 500, "Out of memory"); - break; - } - - fus->fd = ipc_inst_start_ext(SOURCE_WEBSERVER, strlen(mp->file_name), mp->file_name); - if (fus->fd < 0) { - mg_http_send_error(nc, 500, "Failed to queue command"); - free(fus); - break; - } - - mp->user_data = fus; - - break; - - case MG_EV_HTTP_PART_DATA: - mp = (struct mg_http_multipart_part *) p; - fus = (struct file_upload_state *) mp->user_data; - - if (!fus) - break; - - ipc_send_data(fus->fd, (char *) mp->data.p, mp->data.len); - fus->len += mp->data.len; - - break; - - case MG_EV_HTTP_PART_END: - mp = (struct mg_http_multipart_part *) p; - fus = (struct file_upload_state *) mp->user_data; - - if (!fus) - break; - - ipc_end(fus->fd); - - mg_send_response_line(nc, 200, - "Content-Type: text/plain\r\n" - "Connection: close"); - mg_send(nc, "\r\n", 2); - mg_printf(nc, "Ok, %s - %d bytes.\r\n", mp->file_name, (int) fus->len); - nc->flags |= MG_F_SEND_AND_CLOSE; - - mp->user_data = NULL; - free(fus); + default: + upload_handler_v2(nc, ev, p); break; } } -#if defined(CONFIG_MONGOOSE_WEB_API_V1) static void recovery_status(struct mg_connection *nc, int ev, void *ev_data) { ipc_message ipc; @@ -226,7 +345,7 @@ static void recovery_status(struct mg_connection *nc, int ev, void *ev_data) (void)ev; (void)ev_data; - ret = ipc_get_status(&ipc); + ret = get_inst_status(&ipc, WEB_API_v1); if (ret) { mg_http_send_error(nc, 500, NULL); @@ -306,7 +425,9 @@ static void post_update_cmd(struct mg_connection *nc, int ev, void *ev_data) nc->flags |= MG_F_SEND_AND_CLOSE; } -#elif defined(CONFIG_MONGOOSE_WEB_API_V2) +#endif + +#if defined(CONFIG_MONGOOSE_WEB_API_V2) static void restart_handler(struct mg_connection *nc, int ev, void *ev_data) { struct http_message *hm = (struct http_message *) ev_data; @@ -350,7 +471,7 @@ static void *broadcast_message_thread(void *data) { for (;;) { ipc_message msg; - int ret = ipc_get_status(&msg); + int ret = get_inst_status(&msg, WEB_API_v2); if (!ret && strlen(msg.data.status.desc) != 0) { struct mg_mgr *mgr = (struct mg_mgr *) data; @@ -610,15 +731,20 @@ int start_mongoose(const char *cfgfname, int argc, char *argv[]) exit(EXIT_FAILURE); } +#if defined(CONFIG_MONGOOSE_WEB_API_V1) && defined(CONFIG_MONGOOSE_WEB_API_V2) + SIMPLEQ_INIT(&ipcmessages); +#endif + #if defined(CONFIG_MONGOOSE_WEB_API_V1) - mg_register_http_endpoint(nc, "/handle_post_request", MG_CB(upload_handler, NULL)); + mg_register_http_endpoint(nc, "/handle_post_request", MG_CB(upload_handler_v1, NULL)); mg_register_http_endpoint(nc, "/getstatus.json", MG_CB(recovery_status, NULL)); mg_register_http_endpoint(nc, "/rebootTarget", MG_CB(reboot_target, NULL)); mg_register_http_endpoint(nc, "/postUpdateCommand", MG_CB(post_update_cmd, NULL)); -#elif defined(CONFIG_MONGOOSE_WEB_API_V2) +#endif +#if defined(CONFIG_MONGOOSE_WEB_API_V2) mg_register_http_endpoint(nc, "/restart", restart_handler); #endif - mg_register_http_endpoint(nc, "/upload", MG_CB(upload_handler, NULL)); + mg_register_http_endpoint(nc, "/upload", MG_CB(upload_handler_v2, NULL)); mg_set_protocol_http_websocket(nc); #if defined(CONFIG_MONGOOSE_WEB_API_V2)