Fix errors:

1. I accidentally used ncrc_initialize instead of nc_initialize.
2. Change HTTP.CAINFO to HTTP.SSL.CAINFO
This commit is contained in:
Dennis Heimbigner 2022-06-20 14:09:05 -06:00
parent 2445d779a3
commit abba5c383b
3 changed files with 11 additions and 7 deletions

View File

@ -492,9 +492,9 @@ setupconn(NC_HTTP_STATE* state, const char* objecturl)
ncuriparse(objecturl,&uri);
if(uri == NULL) goto fail;
hostport = NC_combinehostport(uri);
value = NC_rclookup("HTTP.CAINFO",hostport,NULL);
value = NC_rclookup("HTTP.SSL.CAINFO",hostport,NULL);
if(value == NULL)
value = NC_rclookup("HTTP.CAINFO",NULL,NULL);
value = NC_rclookup("HTTP.SSL.CAINFO",NULL,NULL);
if(value != NULL) {
cstat = CURLERR(curl_easy_setopt(state->curl, CURLOPT_CAINFO, value));
if (cstat != CURLE_OK) goto fail;

View File

@ -23,6 +23,7 @@ See COPYRIGHT for license information.
#include "ncauth.h"
#include "ncpathmgr.h"
#include "nc4internal.h"
#include "ncdispatch.h"
#ifndef nulldup
#define nulldup(x) ((x)?strdup(x):(x))
@ -91,7 +92,8 @@ nc_rc_get(const char* key)
NCglobalstate* ncg = NULL;
char* value = NULL;
if(!NCRCinitialized) ncrc_initialize();
if(!NC_initialized) nc_initialize();
ncg = NC_getglobalstate();
assert(ncg != NULL && ncg->rcinfo != NULL && ncg->rcinfo->entries != NULL);
if(ncg->rcinfo->ignore) return NC_NOERR;
@ -113,9 +115,9 @@ nc_rc_set(const char* key, const char* value)
{
int stat = NC_NOERR;
NCglobalstate* ncg = NULL;
NCRCentry* entry = NULL;
if(!NCRCinitialized) ncrc_initialize();
if(!NC_initialized) nc_initialize();
ncg = NC_getglobalstate();
assert(ncg != NULL && ncg->rcinfo != NULL && ncg->rcinfo->entries != NULL);
if(ncg->rcinfo->ignore) return NC_NOERR;

View File

@ -2,7 +2,7 @@
Copyright 2018 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Test HDF5 alignment
Test RC interface
Dennis Heimbigner
*/
@ -63,7 +63,6 @@ main(int argc, char **argv)
char* newvalue;
printf("load:\n");
if ((stat=nc_initialize())) {fprintf(stderr,"***fail\n"); exit(1);}
key = "key1";
value = "value1";
@ -72,6 +71,7 @@ main(int argc, char **argv)
printf("insert: before: %s = %s\n",key,newvalue);
nullfree(newvalue);
stat = nc_rc_set(key, value);
if(stat) {fprintf(stderr,"***Fail: nc_rc_set: %s\n",nc_strerror(stat)); goto done;}
newvalue = nc_rc_get(key);
printf("insert: after: %s = %s\n",key,newvalue);
nullfree(newvalue);
@ -83,10 +83,12 @@ main(int argc, char **argv)
printf("replace: before: %s = %s\n",key,newvalue);
nullfree(newvalue);
stat = nc_rc_set(key, value);
if(stat) {fprintf(stderr,"***Fail: nc_rc_set: %s\n",nc_strerror(stat)); goto done;}
newvalue = nc_rc_get(key);
printf("replace: after: %s = %s\n",key,newvalue);
nullfree(newvalue);
done:
nc_finalize();
return 0;
}