Commit Graph

492 Commits

Author SHA1 Message Date
Edward Hartnett
aab2f998b3 now testing that nc_inq_var_deflate() works for all formats and returns 0 deflate and deflate_level 2020-04-08 08:31:53 -06:00
Ward Fisher
2e7234ff5b
Merge pull request #1511 from mathstuf/fix-windows-define
nc4internal: detect Windows using the correct define name
2020-01-27 17:43:43 -07:00
Dennis Heimbigner
f587654670 Make the dap4 code resistant to various server errors.
Some versions of some servers are returning malformed responses.
Make the library either handle them or gracefully fail.
The three server errors "fixed" here are as follows.
1. The attribute _NCProperties sometimes has a trailing nul character
   in its value. Soln is to elide the nul(s).
2. Sometimes a DAP response has no data part, only a DMR.
   Soln is to detect and return an error code instead of crashing.
3. Sometimes a server returns a redirection, but our current
   openmagic() function was not following the redirect. Soln
   is to follow redirects.
Also because of #2, I am temporarily making --disable-dap-remote-tests
be the default.
2020-01-08 15:18:31 -07:00
Ward Fisher
16e83896c6 Disable byterange tests if DAP remote tests are disabled. 2020-01-07 17:40:03 -07:00
Dennis Heimbigner
7223c4a5aa Avoid spurious test failures when servers fail.
re: https://github.com/Unidata/netcdf-c/issues/1451

The situation with the various DAP (and other) remote test
servers is currently in a state of flux.  For example, Unidata
admin is planning to forcibly shift the remote test server to
remotetest.unidata.ucar.edu soon.  In addition, the server
test.opendap.org has shown some recent instability.

The result is that various DAP (and byterange) tests can fail
unexpectedly. This is an irritant to users and reveals nothing
about test sucess or failure.

Solve by modifying tests to report server inaccessibility and
otherwise pretend to succeed.

This puts an onus on Unidata to detect such server failures, but
will not cause users to see spurious failures. [Note. Do similar
fix for netcdf-java]. The check is:
1. export SETX=1 to cause all the shell scripts to trace
2. search the log files for the phrase "WARNING" (in upper case)
and see if it is complaining about not finding a server.

Misc. Changes
-------------
1. Added a pingurl program to see if a server was up.
2. modified some test case url targets
2019-12-31 15:42:58 -07:00
Edward Hartnett
6a902fe210 further removal of RELAX_COORD_BOUNDS macro 2019-11-26 06:45:26 -07:00
Edward Hartnett
64d821b568 removed non-relaxed coord bounds from test code 2019-11-26 06:20:34 -07:00
Ben Boeckel
464e2953a0 windows: detect Windows using the correct define name 2019-11-07 07:55:47 -05:00
Greg Sjaardema
56c0d5cf8a Spelling fixes 2019-09-18 08:03:01 -06:00
edwardhartnett
2077729abc removed base_pe functions from dispatch table 2019-08-15 06:51:06 -06:00
Ed Hartnett
1d17dd32be undid unnecessary changes to Makefile.am 2019-06-30 05:12:22 -06:00
Ed Hartnett
d228c4048e check nc_delete for handling of null name 2019-06-30 05:03:53 -06:00
Ed Hartnett
41cef20d1a fixed handling of NULL name in nc_open 2019-06-30 04:56:24 -06:00
Ed Hartnett
b1b76a8a9c fixed parallel build problem with mmap 2019-05-21 14:50:43 -06:00
Ed Hartnett
7a5040bea7 deleting tmp1.cdl in nc_test 2019-05-21 14:38:38 -06:00
Dennis Heimbigner
c9d16d82d6 Fix cmake X mmap
supercede PR: https://github.com/Unidata/netcdf-c/pull/1384

Since we have an mmap user, undeprecate it and make sure
it works. Other changes:

* fix test cases to work with make -j
* fix exposed ncgen error.
2019-04-19 20:32:26 -06:00
Dennis Heimbigner
0c59e13bf7 Master merge, conflict resolution, cleanup 2019-02-24 16:54:13 -07:00
Dennis Heimbigner
a1f080db19
Merge branch 'master' into byterange.dmh 2019-02-13 14:45:53 -07:00
Simon Holgate
6834f4155c Added int i and j declarations 2019-02-12 15:10:39 +00:00
Dennis Heimbigner
e4cb5c89a3 Made some mistakes in handling the PNETCDF case.
So, fixed the following:
1. Forgot to check for NC_FORMATX_PNETCDF case
   in one of the switches in NC_infermodel.
2. Accidentally turned on both the NC_64BIT_OFFSET
   and the NC_64BIT_DATA mode flags.
2019-02-01 14:31:44 -07:00
Ward Fisher
b27c7d899d Merge branch 'master' into byterange.dmh 2019-01-25 14:50:23 -07:00
Ed Hartnett
64f0ac6801
Merge branch 'master' into ejh_test_pnetcdf 2019-01-16 18:19:03 -07:00
Ward Fisher
2285e1dfa1 Merge branch 'ejh_test_null_vars_stride' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-01-15 15:10:40 -07:00
Ward Fisher
9a365be6d0 Merge branch 'ansifix.dmh' into pr-aggregation.wif 2019-01-15 14:58:54 -07:00
Ed Hartnett
c03432ac4c warnings fixes 2019-01-03 07:07:13 -07:00
Ed Hartnett
f8a33aace5 merged ejh_test_null_vars_stride this time I mean it! 2019-01-03 06:36:58 -07:00
Ed Hartnett
867bbad753 merged ejh_relax 2019-01-03 06:26:08 -07:00
Ed Hartnett
ee1680bb80
Merge branch 'master' into ejh_relax 2019-01-03 05:18:57 -07:00
Ed Hartnett
c278109c9f
Merge branch 'master' into ejh_test_null_vars_stride 2019-01-03 05:18:25 -07:00
Ward Fisher
c21820a1ae Merge branch 'master' into ansifix.dmh 2019-01-02 22:26:59 -08:00
Ward Fisher
94af1d49c6
Merge branch 'master' into ansicomment.dmh 2019-01-02 20:51:28 -08:00
Dennis Heimbigner
84c2bc0d78 Merge branch 'master' into byterange.dmh 2019-01-02 13:18:45 -07:00
Ed Hartnett
c15c3fa8d5 cleaned up makefile.am, added config.h to some tests 2019-01-02 05:31:15 -07:00
Ed Hartnett
bdf7eef7c6 merged master 2019-01-02 03:52:51 -07:00
Ed Hartnett
35495eb734
Merge branch 'master' into ejh_test_null_vars_stride 2019-01-02 03:49:22 -07:00
Dennis Heimbigner
bf2746b8ea Provide byte-range reading of remote datasets
re: issue https://github.com/Unidata/netcdf-c/issues/1251

Assume that you have the URL to a remote dataset
which is a normal netcdf-3 or netcdf-4 file.

This PR allows the netcdf-c to read that dataset's
contents as a netcdf file using HTTP byte ranges
if the remote server supports byte-range access.

Originally, this PR was set up to access Amazon S3 objects,
but it can also access other remote datasets such as those
provided by a Thredds server via the HTTPServer access protocol.
It may also work for other kinds of servers.

Note that this is not intended as a true production
capability because, as is known, this kind of access to
can be quite slow. In addition, the byte-range IO drivers
do not currently do any sort of optimization or caching.

An additional goal here is to gain some experience with
the Amazon S3 REST protocol.

This architecture and its use documented in
the file docs/byterange.dox.

There are currently two test cases:

1. nc_test/tst_s3raw.c - this does a simple open, check format, close cycle
   for a remote netcdf-3 file and a remote netcdf-4 file.
2. nc_test/test_s3raw.sh - this uses ncdump to investigate some remote
   datasets.

This PR also incorporates significantly changed model inference code
(see the superceded PR https://github.com/Unidata/netcdf-c/pull/1259).

1. It centralizes the code that infers the dispatcher.
2. It adds support for byte-range URLs

Other changes:

1. NC_HDF5_finalize was not being properly called by nc_finalize().
2. Fix minor bug in ncgen3.l
3. fix memory leak in nc4info.c
4. add code to walk the .daprc triples and to replace protocol=
   fragment tag with a more general mode= tag.

Final Note:
Th inference code is still way too complicated. We need to move
to the validfile() model used by netcdf Java, where each
dispatcher is asked if it can process the file. This decentralizes
the inference code. This will be done after all the major new
dispatchers (PIO, Zarr, etc) have been implemented.
2019-01-01 18:27:36 -07:00
Ed Hartnett
46e50bc196 more tests for NULL strides 2018-12-31 09:44:29 -07:00
Ward Fisher
c62d7eb541 Merge remote-tracking branch 'origin/gh1233.dmh' into pr-aggregation.wif 2018-12-30 23:55:30 -08:00
Dennis Heimbigner
ac528ae34e T.B. found a couple more 2018-12-12 15:14:19 -07:00
Dennis Heimbigner
75759ca957 Separate out the --ansi comment fixes.
re: pull request https://github.com/Unidata/netcdf-c/pull/1242

This pr should be applied before https://github.com/Unidata/netcdf-c/pull/1242.
It fixes only the -ansi '//' comment problems. There may be some
slight conflicts with that other pr when it is applied, since in some
cases I converted #if 0...#endif to /*...*/
2018-12-12 13:23:09 -07:00
Dennis Heimbigner
735ae80928 merge master and fix conflicts 2018-12-12 11:47:54 -07:00
Ward Fisher
30ea33435c Merge remote-tracking branch 'origin/license_update.wif' into pr-aggregation.wif 2018-12-11 17:08:21 -05:00
Ward Fisher
e9f617e335 Testing a fix for a failure I observed. 2018-12-06 17:46:30 -07:00
Ward Fisher
763750fab5 More copyright stanza updates. 2018-12-06 14:56:42 -07:00
Dennis Heimbigner
1a7531392f Make the netcdf-c library compile with gcc -ansi.
Primary fixes to get -ansi to work.
1. Convert all '//' C++ style comments to /*...*/ or to use #if 0...#endif
2. It turns out that when -ansi is specified, then a number of
   functions no longer are defined in the header -- but they are still
   in the .so file.<br>
   The big example is strdup(). So, added code to include/ncconfig.h to define
   externs for those missing functions that occur in more than one place.
   These are enabled if !_WIN32 && __STDC__ == 1 (__STDC__ is supposed to
   be the equivalent compile time flag to -ansi). Note that this requires
   config.h (which references ncconfig.h) to be included in files where it is
   currently not included. Single uses will be only in the file that uses them.
3. Added mmap test for the MAP_ANONYMOUS flag to configure.ac. Apparently
   this is not always defined with -ansi.
4. fix some large integer constants in nc_test4/tst_atts3.c and nc_test4/tst_filterparser.c
   to avoid compiler complaints.
5. fix a double constant in nc_test4/tst_filterparser.c to avoid compiler complaints.

[Note I suspect #4 and #5 will be a problem on big-endian machines, but we have no way to test]

Misc. Changes:
1. convert more instances of _MSC_VER to _WIN32.
2. added some debugging code to include/nctestserver.h
3. added comment about libdispatch/drc.c always being compiled.
4. modify parser generation in ncgen to remove unneeded files.
2018-12-05 19:20:43 -07:00
Dennis Heimbigner
30d63bbaa5 Fix failings of nc_test/run_inmemory.sh
re: issue https://github.com/Unidata/netcdf-c/issues/1233

Changes:

1. remove exit that was there for testing.
2. the program tst_open_mem must be netcdf-4 only.
3. fix some diff problems
   - Change dataset name for tst_inmemory4_create to tst_inmemory4
   - Modify tst_inmemory.c to reorder the variables (somewhat major rewrite)

Minor Unrelated Fixes:
1. fix comment problem in nc_provenance.h
2. Fix memory leak in tst_open_mem.c
3. fix ncdump/bindata.c to properly compile if netcdf4 is disabled.
4. minor changes to ncgen.l
2018-12-04 19:22:02 -07:00
Ed Hartnett
846153b3fd makefile.am cleanup 2018-12-03 07:42:34 -07:00
Ed Hartnett
88029414c8 fix memory leak 2018-12-03 06:33:16 -07:00
Ed Hartnett
693271c278 now always relax coord bounds checking, also fix parallel builds for --enable-pnetcdf 2018-12-03 06:17:23 -07:00
Ed Hartnett
bbfbd98f6e test and util changes to split libsrc4 and libhdf5 2018-12-01 08:24:56 -07:00