Skip to content

Commit

Permalink
fixes to VB and NC:
Browse files Browse the repository at this point in the history
- better logging
- better DB transation code (Entities instead of EntityWrapper)
- separated host and instance polling
- coverity fixes
  • Loading branch information
dmitrii committed Jan 12, 2012
2 parents 5a85131 + 16fb414 commit e7f504f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion storage/blobstore.c
Expand Up @@ -4074,7 +4074,7 @@ static int open_blobstore (const char * path, blobstore ** bs, const char * name
blobstore_set_error_function ( &bs_errors );

* bs = blobstore_open (path, 0, BLOBSTORE_FLAG_RDWR, BLOBSTORE_FORMAT_ANY, BLOBSTORE_REVOCATION_ANY, BLOBSTORE_SNAPSHOT_ANY);
if (bs==NULL) {
if (* bs == NULL) {
fprintf (stderr, "failed to open %s blobstore in '%s': %s\n", name, path, blobstore_get_error_str(blobstore_get_error()));
exit (1);
}
Expand Down
3 changes: 2 additions & 1 deletion storage/vbr.c
Expand Up @@ -194,7 +194,8 @@ parse_rec ( // parses the VBR as supplied by a client or user, checks values, an

// identify the type of resource location from location string
int error = OK;
if (strcasestr (vbr->resourceLocation, "http://") == vbr->resourceLocation) {
if (strcasestr (vbr->resourceLocation, "http://") == vbr->resourceLocation ||
strcasestr (vbr->resourceLocation, "https://") == vbr->resourceLocation) {
if (strcasestr (vbr->resourceLocation, "/services/Walrus/")) {
vbr->locationType = NC_LOCATION_WALRUS;
} else {
Expand Down
7 changes: 4 additions & 3 deletions storage/walrus.c
Expand Up @@ -132,12 +132,13 @@ static int walrus_request_timeout (const char * walrus_op, const char * verb, co

/* isolate the PATH in the URL as it will be needed for signing */
char * url_path;
if (strncasecmp (url, "http://", 7)!=0) {
logprintfl (EUCAERROR, "{%u} walrus_request: URL must start with http://...\n",(unsigned int)pthread_self());
if (strncasecmp (url, "http://", 7)!=0 &&
strncasecmp (url, "https://", 8)!=0) {
logprintfl (EUCAERROR, "{%u} walrus_request: URL must start with http(s)://...\n",(unsigned int)pthread_self());
pthread_mutex_unlock(&wreq_mutex);
return code;
}
if ((url_path=strchr(url+7, '/'))==NULL) { /* find first '/' after hostname */
if ((url_path=strchr(url+8, '/'))==NULL) { /* find first '/' after hostname */
logprintfl (EUCAERROR, "{%u} walrus_request: URL has no path\n",(unsigned int)pthread_self());
pthread_mutex_unlock(&wreq_mutex);
return code;
Expand Down
2 changes: 1 addition & 1 deletion util/misc.c
Expand Up @@ -2061,7 +2061,7 @@ int get_blkid (const char * dev_path, char * uuid, unsigned int uuid_size)
char parse_boolean (const char * s)
{
char * lc = strduplc (s);
char val;
char val = 0;

if (strcmp (lc, "y")==0 ||
strcmp (lc, "yes")==0 ||
Expand Down

0 comments on commit e7f504f

Please sign in to comment.