mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merge branch 'master' into nccopy-chunking.dmh
This commit is contained in:
commit
764ea739b3
@ -1224,8 +1224,10 @@ if test "x$enable_pnetcdf" = xyes; then
|
||||
AC_MSG_ERROR([PNetCDF must be built with relax-coord-bound])
|
||||
fi
|
||||
else
|
||||
# default setting
|
||||
enable_erange_fill=no
|
||||
if test "x$enable_erange_fill" = xauto; then
|
||||
# if --enable-erange-fill is not used, default setting is no
|
||||
enable_erange_fill=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_zero_length_coord_bound" = xyes; then
|
||||
|
@ -529,11 +529,7 @@ ncuribuild(NCURI* duri, const char* prefix, const char* suffix, int flags)
|
||||
{
|
||||
char* newuri = NULL;
|
||||
NCbytes* buf = ncbytesnew();
|
||||
#ifdef NEWESCAPE
|
||||
const int encode = (flags&NCURIENCODE ? 1 : 0);
|
||||
#else
|
||||
const int encode = 0;
|
||||
#endif
|
||||
|
||||
if(prefix != NULL)
|
||||
ncbytescat(buf,prefix);
|
||||
@ -574,12 +570,18 @@ ncuribuild(NCURI* duri, const char* prefix, const char* suffix, int flags)
|
||||
if(suffix != NULL)
|
||||
ncbytescat(buf,suffix);
|
||||
|
||||
if((flags & NCURIQUERY) && duri->querylist != NULL) {
|
||||
/* The query and the querylist are assumed to be unencoded */
|
||||
if(flags & NCURIQUERY && duri->querylist != NULL) {
|
||||
char** p;
|
||||
int first = 1;
|
||||
for(p=duri->querylist;*p;p+=2,first=0) {
|
||||
ncbytescat(buf,(first?"?":"&"));
|
||||
ncbytescat(buf,p[0]);
|
||||
if(encode) {
|
||||
char* encoded = ncuriencodeonly(p[0],queryallow);
|
||||
ncbytescat(buf,encoded);
|
||||
nullfree(encoded);
|
||||
} else
|
||||
ncbytescat(buf,p[0]);
|
||||
if(p[1] != NULL && strlen(p[1]) > 0) {
|
||||
ncbytescat(buf,"=");
|
||||
if(encode) {
|
||||
|
@ -48,7 +48,6 @@
|
||||
/*Forward*/
|
||||
static OCerror ocextractddsinmemory(OCstate*,OCtree*,int);
|
||||
static OCerror ocextractddsinfile(OCstate*,OCtree*,int);
|
||||
static char* constraintescape(const char* url);
|
||||
static OCerror createtempfile(OCstate*,OCtree*);
|
||||
static int dataError(XXDR* xdrs, OCstate*);
|
||||
static void ocremovefile(const char* path);
|
||||
@ -165,9 +164,7 @@ ocfetch(OCstate* state, const char* constraint, OCdxd kind, OCflags flags,
|
||||
memset((void*)tree,0,sizeof(OCtree));
|
||||
tree->dxdclass = kind;
|
||||
tree->state = state;
|
||||
tree->constraint = constraintescape(constraint);
|
||||
if(tree->constraint == NULL)
|
||||
tree->constraint = nulldup(constraint);
|
||||
tree->constraint = nulldup(constraint);
|
||||
|
||||
/* Set per-fetch curl properties */
|
||||
#if 0 /* temporarily make per-link */
|
||||
@ -457,40 +454,6 @@ fprintf(stderr,"missing bod: ddslen=%lu bod=%lu\n",
|
||||
return OCTHROW(stat);
|
||||
}
|
||||
|
||||
/* Allow these (non-alpha-numerics) to pass thru */
|
||||
static const char okchars[] = "&/:;,.=?@'\"<>{}!|\\^[]`~";
|
||||
static const char hexdigits[] = "0123456789abcdef";
|
||||
|
||||
/* Modify constraint to use %XX escapes */
|
||||
static char*
|
||||
constraintescape(const char* url)
|
||||
{
|
||||
size_t len;
|
||||
char* p;
|
||||
int c;
|
||||
char* eurl;
|
||||
|
||||
if(url == NULL) return NULL;
|
||||
len = strlen(url);
|
||||
eurl = ocmalloc(1+3*len); /* worst case: c -> %xx */
|
||||
MEMCHECK(eurl,NULL);
|
||||
p = eurl;
|
||||
*p = '\0';
|
||||
while((c=*url++)) {
|
||||
if(c >= '0' && c <= '9') {*p++ = c;}
|
||||
else if(c >= 'a' && c <= 'z') {*p++ = c;}
|
||||
else if(c >= 'A' && c <= 'Z') {*p++ = c;}
|
||||
else if(strchr(okchars,c) != NULL) {*p++ = c;}
|
||||
else {
|
||||
*p++ = '%';
|
||||
*p++ = hexdigits[(c & 0xf0)>>4];
|
||||
*p++ = hexdigits[(c & 0xf)];
|
||||
}
|
||||
}
|
||||
*p = '\0';
|
||||
return eurl;
|
||||
}
|
||||
|
||||
OCerror
|
||||
ocupdatelastmodifieddata(OCstate* state)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user