From 0c3d0c0bfaa459b40ccc3b49d5d8882e25718c62 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Jun 2023 10:03:02 +0000 Subject: [PATCH] GRIB2: Handle from partial message. Try 01 --- definitions/grib2/sections.def | 42 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/definitions/grib2/sections.def b/definitions/grib2/sections.def index 0da884a39..ed998ca61 100644 --- a/definitions/grib2/sections.def +++ b/definitions/grib2/sections.def @@ -1,5 +1,7 @@ # (C) Copyright 2005- ECMWF. +meta headersOnly headers_only(); + lookup[1] sectionNumber(4) ; if(sectionNumber == 1 or new() ){ @@ -42,23 +44,25 @@ meta md5Headers md5(startOfHeaders,lengthOfHeaders); lookup[1] sectionNumber(4) ; -if (sectionNumber == 5 or new() ) { - position sectionPosition; - template section_5 "grib2/section.5.def"; +if (!headersOnly) { + if (sectionNumber == 5 or new() ) { + position sectionPosition; + template section_5 "grib2/section.5.def"; + } + + lookup[1] sectionNumber(4) ; + + if (sectionNumber == 6 or new() ) { + position sectionPosition; + template section_6 "grib2/section.6.def"; + } + + lookup[1] sectionNumber(4) ; + + if (sectionNumber == 7 or new() ) { + position sectionPosition; + template section_7 "grib2/section.7.def"; + } + + #template metas "grib2/meta.def"; } - -lookup[1] sectionNumber(4) ; - -if (sectionNumber == 6 or new() ) { - position sectionPosition; - template section_6 "grib2/section.6.def"; -} - -lookup[1] sectionNumber(4) ; - -if (sectionNumber == 7 or new() ) { - position sectionPosition; - template section_7 "grib2/section.7.def"; -} - -#template metas "grib2/meta.def";