Changeset 4b21a98c9a064c9e5ff5494de47668330438165c

Show
Ignore:
Timestamp:
07/07/11 06:05:22 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1310018722 -0400
git-parent:

[37e31fd9f0e6a806307056bdfcd2f642317d283f]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1310018722 -0400
Message:

the data store layer needs to know to pass through the B records

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_datastore.c

    rd10f13b r4b21a98  
    213213  interim_journal_t *ij = NULL; 
    214214  char uuid_str[UUID_STR_LEN+1], *cp1, *cp2; 
     215  char rtype[256]; 
    215216  const char *fqdn = NULL, *dsn = NULL; 
    216217  int storagenode_id = 0; 
    217218  uuid_t checkid; 
    218219  if(!line) return; 
     220  cp1 = strchr(line, '\t'); 
     221  if(cp1 && cp1 - line < sizeof(rtype) - 1) { 
     222    memcpy(rtype, line, cp1 - line); 
     223    rtype[cp1 - line] = '\0'; 
     224  } 
     225  else rtype[0] = '\0'; 
    219226  /* if it is a UUID based thing, find the storage node */ 
    220   switch(*line) { 
     227  switch(*rtype) { 
    221228    case 'C': 
    222229    case 'S': 
    223230    case 'M': 
    224231    case 'D': 
    225       if(line[1] == '\t' && (cp1 = strchr(line+2, '\t')) != NULL && 
     232    case 'B': 
     233      if((cp1 = strchr(cp1+1, '\t')) != NULL && 
    226234         (cp2 = strchr(cp1+1, '\t')) != NULL && 
    227235         (cp2-cp1 >= UUID_STR_LEN)) {