Commit Graph

232 Commits

Author SHA1 Message Date
Ward Fisher
b7289cdfa4 Further debugging for [NCF-330]. Making decent progress using the debug flags Microsoft provides. See JIRA issue for links to documentation describing these flags. 2015-05-08 14:02:11 -06:00
dmh
06a11e51df 1. Allow for the user specified rc file via the env variable
NCRCFILE.  Note that the value of this environment
   variable should be the absolute path of the rc file, not
   the path to its containing directory.
2015-03-03 20:17:27 -07:00
Ward Fisher
2d3d747b17 Corrected a couple of dereferencing-null errors identified by static analysis. 2015-02-10 13:51:52 -07:00
Ward Fisher
64e69f26f3 Resource leak, coverity 1264410 2015-01-20 11:00:03 -07:00
dmh
65f78d6a8b 1. synch with oc
2. replace all occurrences of
   'template' with 'pattern'
   since template is reserved in windows.
2015-01-15 14:19:51 -07:00
dmh
f423f27693 Sync with oc project.
This supports better authorization
handling for DAP requests, especially redirection
based authorization. I also added a new test case
ncdap_tests/testauth.sh.

Specifically, suppose I have a netrc file /tmp/netrc
containing this.
    machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
Also suppose I have a .ocrc file containing these lines
    HTTP.COOKIEJAR=/tmp/cookies
    HTTP.NETRC=/tmp/netrc
Assume that .ocrc is in the local directory or HOME.

Then this command should work (assuming a valid login and password).
    ncdump -h "https://54.86.135.31/opendap/data/nc/fnoc1.nc"
2014-12-24 10:22:47 -07:00
dmh
7de1f7bef8 oc synch 2014-11-30 20:30:23 -07:00
Ward Fisher
a641a8834d Addressed a memory leak issue identified by static analysis. 2014-10-01 16:18:00 -06:00
Ward Fisher
b43813d821 When using the '-ansi' flag with gcc, netcdf would fail to build because of the use of '//' for one-line comments. I've addressed this by replacing instances of // with enclosing comment blocks. 2014-08-26 11:19:32 -06:00
Ward Fisher
1c079da460 Fixed coverity issue. 2014-08-22 15:12:24 -06:00
dmh
b274c6f6dc Coverity fixes 2014-08-17 14:12:19 -06:00
dmh
46063247cb conflict resolution 2014-08-17 12:52:53 -06:00
dmh
18eb1c1126 Coverity fixing 2014-08-17 12:03:23 -06:00
Ward Fisher
d25b94f92d Coverity: 712596 2014-08-15 16:09:07 -06:00
Ward Fisher
bc141aef5a Fixed error with previous merge that prevented compilation. 2014-08-11 20:29:18 -06:00
Dennis Heimbigner
b5aa5924a9 double attempt to fix coverity error 2014-08-11 16:13:45 -06:00
Dennis Heimbigner
f2e2a2c266 Fix coverity errors CID 1230781
and 1230782,
2014-08-11 16:12:14 -06:00
Ward Fisher
84fadd3de7 Coverity: 1230781. Oops! Fixing my previous fix. 2014-08-11 14:34:24 -06:00
Ward Fisher
60461bd138 Coverity: 711764 2014-08-11 12:55:25 -06:00
Ward Fisher
a98157437d Coverity: 712599 2014-08-11 12:52:57 -06:00
Ward Fisher
d3c122e8bb Coverity issue 1197642 2014-08-11 12:33:25 -06:00
Ward Fisher
d18b93e0d2 Coverity issue: 711827 2014-07-31 15:59:47 -06:00
Ward Fisher
1ddaa1d310 Coverity issue: 1197640 2014-07-31 15:34:52 -06:00
Ward Fisher
906f2ae3ac Addressed Coverity issue 1197638 2014-07-29 10:44:50 -06:00
dmh
cd2574ba7c Change assertion failure to a error 2014-07-23 11:25:49 -06:00
Ward Fisher
16cb63a223 Corrected a couple of Unix API issues reported by static analysis. 2014-07-15 12:34:43 -06:00
dmh
0a954fc58d Merge branch 'master' of http://github.com/Unidata/netcdf-c 2014-07-08 09:21:19 -06:00
dmh
7689f8be32 JIRA: NCF-308
Jennifer Adams has requested a reversion in behavior so that
all dap requests include a constraint.

Problem is caused by change in prefetch where if all variables
are requested, then no constraint is generated.
Fix is to always generate a constraint in prefetch.
2014-07-07 14:08:19 -06:00
Dennis Heimbigner
39a5bf5efa Modify ncdap_test/test_nstride_cached.c
to use a dataset on remotetest instead
of an external server.
2014-07-01 10:39:18 -06:00
Ward Fisher
7f812b367e Manual merge of pull request https://github.com/Unidata/netcdf-c/pull/64 contributed by nschloe. Assorted CMake improvements. 2014-06-11 15:51:31 -06:00
dmh
ed068ef643 Fix misc. typos from previous commit 2014-06-02 14:02:34 -06:00
dmh
83ec39f5db [NCF-272]
re: e support ZCL-340681 and CPW-270700

HDF4 supports compression (and chunking)
but the chunking was not being recorded
for HDF4 files. So, I modified the necessary
files to support HDF4 chunking.
2014-06-02 13:04:28 -06:00
Ward Fisher
07a71c82db Fixed 'dead assignment' issue identified by static analysis. 2014-05-13 10:01:39 -06:00
dmh
ed5a504417 Fix int/enum conversion bug: re esupport (TXX-867549) 2014-05-06 13:10:59 -06:00
Ward Fisher
44fae42214 Cleaned up indentation, white space in multiple CMakeLists.txt files. 2014-04-21 11:15:33 -06:00
dmh
4346b01c19 note jna problem 2014-04-15 21:25:44 -06:00
dmh
fb00c88763 fix bugs introduced by previous coverity fixes 2014-04-07 14:01:40 -06:00
dmh
389d2ea394 fix some coverity complaints 2014-04-07 13:00:47 -06:00
dmh
3a7769123b fix some coverity errors 2014-04-04 21:04:28 -06:00
Ward Fisher
76e5e0f1fa Addressed several minor issues revealed by static analysis (coverity, clang). Mostly to do with extreme corner cases in which a null pointer would be dereferenced, or dereferencing a non-null (but non-initialized) pointer would result in garbage. 2014-03-28 17:11:26 -06:00
dmh
af566dd300 In preparation for adding dap4 support, I have cleaned up
the libdap2 code to make it dap2 protocol + netcdf classic
only.
2014-03-24 14:02:52 -06:00
dmh
b524e151ef Remove last vestiges of thredds-test 2014-03-14 14:07:35 -06:00
dmh
c7086dd04b Add support to detect authorization errors to DAP 2014-03-11 11:58:22 -06:00
dmh
ba726d55ce synch with oc2.0 2014-03-03 13:43:47 -07:00
dmh
0ee6d11d85 fix t_auth failure now that tiggeUser password is set 2014-02-28 14:39:30 -07:00
Quincey Koziol
d033f9f6ff Clean up Coverity warnings from last checkin. 2014-02-20 08:24:55 -06:00
Quincey Koziol
3ef7eeb30a Merge remote-tracking branch 'upstream/master' 2014-02-12 08:49:03 -06:00
Quincey Koziol
4bfd9b27a0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	libdap2/common34.c
	oc2/ocutil.c
2014-02-11 17:26:09 -06:00
Ward Fisher
ae902f1909 Fixed an issue with variable declaration in Visual Studio-based builds. 2014-02-11 15:49:34 -07:00
dmh
d7de6fd551 [NCF-287/MCI-552767
Problem related to NCF-284.
Namely an old thredds server that
does not properly implement the
dap2 spec. It is accessing a field of a grid
but is not wrapping it as a structure.
url:http://thredds.aodn.org.au/thredds/dodsC/IMOS/ACORN/gridded_1h-avg-current-map_QC/SAG/2010/01/27/IMOS_ACORN_V_20100127T023000Z_SAG_FV01_1-hour-avg.nc.dds?SPEED.SPEED

In any case, this exposed another bug.
Also, in looking at this, I realized that the
code could be simplified.
2014-02-05 17:05:33 -07:00
dmh
0f4b72c53b [NCF-286]/e-support:JVN-123940
using cygwin64 causes a couple of bugs during make check.
Fixes are as follows:
1. in ncdump.c and nccopy.c change all occurrences of
   'return EXIT_FAILURE'
   and
   'return EXIT_SUCCESS'
   with
   exit(EXIT_FAILURE)
   and
   exit(EXIT_SUCCESS)
   respectively.
   I have no idea why this works.
2. in libdap2/ncdap3a.c#freeNCDAPCOMMON,
   remove the call to nc_abort, it is
   causing a loop; not sure why this
   is not caught under other operating systems.
2014-02-04 16:26:52 -07:00
dmh
8541a32175 [NCF-284]/ ZQX-155900
Some servers do not properly
implement the current DAP2 spec.
It turns out that this server is one of those:
    http://nomads.ncep.noaa.gov:9090/
When a reference such as this is made:
    http://nomads.ncep.noaa.gov:9090/dods/gens/gens20140123/gep_all_12z?prmslmsl[0][0][0][0:359]
tt is returning this:
Dataset {
    float prmslmsl[ens=1][time=1][lat=1][lon=360];
} gens%2fgens20140123%2fgep_all_12z;

when it should be returning this:
Dataset {
  Structure {
    float prmslmsl[ens=1][time=1][lat=1][lon=360];
  } prmslmsl;
} gens%2fgens20140123%2fgep_all_12z;

The reason is that when picking fields out of a grid,
one must maintain the fully qualified name, so the grid
is converted to an enclosing structure.

It turns out that the problem was that
when I create the new structure node, I was
improperly linking it into the existing graph.
This caused a null pointer failure.
Fix is to make sure the relevant field (node->root)
is set.
2014-01-24 13:26:00 -07:00
dmh
dfc3749506 [NCF-282]/ HAD-595112
The code that tests if a path is a url is
faulting when the url does not end in a slash
(e.g. http://thredds-tests.ucar.edu).
The code that tests if a path is a url is
faulting when the url does not end in a slash
(e.g. http://thredds-tests.ucar.edu).
CF-273]/HZY-708311

Solution was to do a null pointer test.
Added a test (tst_misc).
2014-01-20 16:11:45 -07:00
Quincey Koziol
cd71eb525c Corrected "BAIL" macros to avoid infinite loop when logging is disabled and an
error occurs after an "exit:" label.

Corrected a dozen Coverity errors (mainly allocation issues, along with a few
    other things):
        711711, 711802, 711803, 711905, 970825, 996123, 996124, 1025787,
        1047274, 1130013, 1130014, 1139538

Refactored internal fill-value code to correctly handle string types, and
    especially to allow NULL pointers and null strings (ie. "") to be
    distinguished.  The code now avoids partially aliasing the two together
    (which only happened on the 'write' side of things and wasn't reflected on
    the 'read' side, adding to the previous confusion).

    Probably still weak on handling fill-values of variable-length and compound
    datatypes.

Refactored the recursive metadata reads a bit more, to process HDF5 named
    datatypes and datasets immediately, avoiding chewing up memory for those
    types of objects, etc.

Finished uncommenting and updating the nc_test4/tst_fills2.c code (as I'm
    proceeding alphabetically through the nc_test4 code files).
2013-12-29 01:12:43 -06:00
dmh
582410a407 [NCF-273]/HZY-708311
Add a new function called nc_inq_format_extended that
returns more detailed format information (vis-a-vis
nc_inq_format) about an open dataset.

Note that the netcdf API will present the file as if it had
the format specified by nc_inq_format.  The true file
format, however, may not even be a netcdf file; it might be
DAP, HDF4, or PNETCDF, for example. This function returns
that true file type.  It also returns the effective mode for
the file.

signature: nc_inq_format_extended(int ncid, int* formatp, int* modep)
where
* ncid is the NetCDF ID from a previous call to nc_open() or
  nc_create().
* formatp is a pointer to a location for returned true format.
* modep is a pointer to a location for returned mode flags.

Refer to the actual list in the file netcdf.h to see the
currently defined set.

Also added test cases (tst_formatx*).
2013-12-22 12:53:20 -07:00
dmh
564a9d56a4 Merge branch 'master' of https://github.com/Unidata/netcdf-c 2013-12-10 11:23:10 -07:00
Ward Fisher
18afaa9145 Corrected several convoluted chains in cache.c by which either null pointers might be dereferenced, or by which a pointer might be referenced after being freed. These were reported by Clang static analysis. 2013-11-22 13:49:21 -07:00
Ward Fisher
74fce49fe1 Corrected an issue reported by clang related to dereferencing a NULL value. 2013-11-20 14:03:55 -07:00
Ward Fisher
1d007eb101 Addressed a number of minor bugs reported by Clang. 2013-11-20 13:37:21 -07:00
dmh
ea7c0fc91b [NCF-280]/TLO-836022
Fix bug where leading backslash digit
in name was not being properly handled.
The reason was that I accidentally attemped to allow \x... and \0...
escapes in identifiers. This make identifiers
with leading escaped digits not work any more.
Also added test case.
2013-11-19 21:58:56 -07:00
dmh
d6061db87d define mode_t when under windows 2013-11-15 15:41:17 -07:00
dmh
baed147ba4 [NCF-277]
Fix Http Basic Authorization.
The problem is really in oc2.0.
In order for it to work,
the CURLOPT_COOKIEJAR must have
a non-null value. The code
was already there, but not being
used for some reason.
1. fixed cookiejar code in oc2.0
2. synched oc2.0 with netcdf-c/oc2
3. added a test case
2013-11-15 11:38:54 -07:00
dmh
2bc308432d sync with oc2.0 2013-11-14 15:13:20 -07:00
Ward Fisher
e80dbb92c0 Addressed Coverity issue 990694, 'Resource Leak' in restruct3. 2013-08-14 09:47:11 -06:00
Ward Fisher
f43bf8f1da Addressed a handful of issues identified by
Coverity static analysis.
2013-08-05 20:36:33 +00:00
Dennis Heimbigner
beba09e70b 1. The duplicate name checking in oc2 was
effectively o(n cubed); modified to be
   o(n squared).
2. If the list of prefetched variables is too long,
   (something on the order of 400 variables), then
   the server may reject it. Modified code so that
   in the case that the set of prefetch'd vars is
   the in fact all variables, it does not create a long
   request. This does not actually solve the problem
   if the prefetch list is long, but not all inclusive.
2013-07-27 20:54:50 +00:00
Dennis Heimbigner
fcecd1a2bc 1. The duplicate name checking in oc2 was
effectively o(n cubed); modified to be
   o(n squared).
2. If the list of prefetched variables is too long,
   (something on the order of 400 variables), then
   the server may reject it. Modified code so that
   in the case that the set of prefetch'd vars is
   the in fact all variables, it does not create a long
   request. This does not actually solve the problem
   if the prefetch list is long, but not all inclusive.
2013-07-27 20:20:13 +00:00
Dennis Heimbigner
b85d3568ec Added the necessary code to support
group renaming. The primary API
is 'nc_rename_grp(int grpid, const char* name)'.
No test cases provided yet.
This also required adding a rename_grp entry
to the dispatch tables.
2013-07-19 21:48:37 +00:00
Dennis Heimbigner
628aed80d9 1. synch changes with oc2.0
2. Fix a bug in ncgen to
   catch a special case of a malformed
   datalist.
2013-06-26 18:55:30 +00:00
Ward Fisher
33d3d06971 Added initial 'make dist', 'make distcheck' support to
CMake-based builds.
2013-06-03 16:42:04 +00:00
Dennis Heimbigner
228e8439d2 1. The code to parse a constraint
was losing the initial double quote
for a quoted string.
2. The code in ncuri.c was not properly
   handling occurrences of e.g. %xx
2013-05-16 21:37:58 +00:00
Dennis Heimbigner
ce290d3459 Fix Jirs 255
The DAP code compiles constraints into an internal
tree form. When it goes to fetch data, it converts
that tree form into a string suitable for use in a url.
The tree->string code was using '<' when it should be
using '<=' and vice versa.
The fix is to make sure the right operator is used.
2013-05-16 18:22:17 +00:00
Dennis Heimbigner
253a26cb82 change format of url parameters in fragment part 2013-05-13 19:12:37 +00:00
Dennis Heimbigner
de34ed2d5b merge from netcdf/trunk prior to merge back to trunk 2013-05-11 19:37:38 +00:00
Dennis Heimbigner
79215c77ae Allow dapodom.[ch] to be used in tests 2013-05-11 19:34:54 +00:00
Dennis Heimbigner
c583f91992 merge with trunk and fix conflicts 2013-05-10 17:04:28 +00:00
Dennis Heimbigner
19c1c11f1d It turns out that my dap code
is not properly checking the incoming
count argument for nc_get_vars.
It is treating the count as pre-stride
rather than post-stride.
2013-05-01 22:31:01 +00:00
Ward Fisher
67f96188ff Merged latest from netCDF-cmake branch in preparation for 4.3.0 release. 2013-04-23 21:50:07 +00:00
Dennis Heimbigner
e3a4a617cf Add test for Jira NCF-249 2013-04-23 21:06:14 +00:00
Dennis Heimbigner
7e8bfb01f3 Fix jira NCF-249 2013-04-23 20:18:16 +00:00
Dennis Heimbigner
e960416761 Fix JIRA NCF-248 2013-04-23 18:02:35 +00:00
Dennis Heimbigner
f17e7324c1 Rebuilt the compose operation in dceconstraints.c. The
revisions are simpler, and I hope, clearer than the all
previous versions.  Part of the code taken from the
ucar.nc2.Range.compose function.  Modified to handle edge
cases not handled in the Range.compose function.
2013-04-19 19:55:43 +00:00
Dennis Heimbigner
b5697ae20f Rebuild the projection merging code 2013-04-17 18:58:37 +00:00
Ward Fisher
b113f6f8b6 Merged a handful of changes from netcdf-cmake branch.
Addressed the following coverity issues:

711762
711763
711766
711788
711933
711934
711935
2013-04-16 23:02:54 +00:00
Ward Fisher
4a274b9870 Merged latest changes from cmake development branch.
Addressed a number of memory-related problems
reported by Coverity.
2013-04-02 22:09:31 +00:00
Dennis Heimbigner
c659633d2e merge from trunk 2013-03-26 16:45:02 +00:00
Dennis Heimbigner
ab17dded89 Caron says to use thredds-test
as the default test server.
2013-03-25 18:01:32 +00:00
Dennis Heimbigner
4e41843740 1) fix some minor bugs when pnetcdf is enabled 2)Comment out some apparently unused procedures 2013-03-25 17:12:50 +00:00
Dennis Heimbigner
9b4db7a039 Make some things static that do not need to be externally visible 2013-03-24 17:33:17 +00:00
Dennis Heimbigner
dea3c726c8 merge trunk into this branch 2013-03-15 20:31:07 +00:00
Dennis Heimbigner
1abb2ecb56 Fix jira NCF-243
Problem was that the NC_create
code was not checking for the NC_CLASSIC_MODEL
mode flag in deciding what dispatch table to use.
This meant that it was then defaulting to use
the default format, and if that was changed
to e.g. NC_FORMAT_NETCDF4, then it would try
to create a netcdf-4 format file, even is
NC_CLASSIC_MODEL mode flag was set.
2013-03-15 20:03:59 +00:00
Ward Fisher
6096f6b43b Merged changes from CMake branch.
Addressed a handful of memory leaks
reported by Coverity.
2013-03-14 22:49:21 +00:00
Dennis Heimbigner
9eaac2a595 Apply Wei-Keng's fix
for JIRA issue NCF-241.
This is only temporary
until I can make pnetcdf
operate as a separate dispatch table.

Also, fix nc_test4/tst_pnetcdf
to open with nc_open_par;
this is necessary because a pnetcdf
created file cannot be opened
as a netcdf classic file.
2013-03-13 17:34:47 +00:00
Dennis Heimbigner
c18c90b012 removed some unused local variables 2013-03-12 20:45:58 +00:00
Dennis Heimbigner
d70cf6d10c Primary change is to add ability
to do prefetch on either a lazy
or eager basis. Lazy means that
the prefetch does not occur
until and unless the client actually
makes a get_var request.

Also repaired a problem where
doing prefetch wrt a url that
has a constraint will prefetch
a whole variable if its constrained
size is small enough, even if the
underlying variable is too large
to warrant prefetch.
2013-03-03 04:06:43 +00:00
Dennis Heimbigner
6cf31dcf2d jira: NCF-232: bad conversion of grids 2013-02-26 04:31:06 +00:00
Ward Fisher
ddf3c31bb0 Corrected a handful of syntax issues in CMake config files,
probably introduced more.  

Added CMake-related files to Makefile.am files for inclusion
when creating a distribution package.
2013-02-20 23:28:28 +00:00
Dennis Heimbigner
b0b6c77a3e 1. corrected the nc_get_varm/put_varm documentation
to indicate that they only work for atomic types,
   not user defined types.

2. modified NCDEFAULT_{get/put}_vars to no longer use
   nc_get/put_varm. They now directly use nc_get/put_vara
   directly. This means that nc_get/put_vars now work
   properly for user defined types as well as atomic types.

3. Added test cases for get_vars/put_vars with a
   user defined type. Tests placed into
   nc_test/tst_compounds.c
2013-02-17 23:42:15 +00:00
Dennis Heimbigner
4109174d00 Add quick check for Error {...} at start of the datadds data part 2013-02-07 22:14:57 +00:00
Dennis Heimbigner
ccb523fb56 add fix for '/' in dap names plus test 2013-02-04 18:49:48 +00:00