IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13254


Ignore:
Timestamp:
May 4, 2007, 1:42:08 PM (19 years ago)
Author:
jhoblitt
Message:

fix a nasty logic bug in nebReplicate()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/nebclient.c

    r13201 r13254  
    44 * Copyright (C) 2005  Joshua Hoblitt
    55 *
    6  * $Id: nebclient.c,v 1.46 2007-05-03 21:28:30 jhoblitt Exp $
     6 * $Id: nebclient.c,v 1.47 2007-05-04 23:42:08 jhoblitt Exp $
    77 */
    88
     
    169169    }
    170170
    171     if (soap_call_ns1__replicate_USCOREobject(server->soap, server->endpoint,
    172             NULL, (char *)key, (char *)volume, (char **)&response) != SOAP_OK) {
    173         nebSetServerErr(server);
    174 
    175         return false;
    176     }
    177 
    178     if (!nebParseURI(server, (char *)response.result, &filename)) {
    179         nebSetErr(server, "can not parse URI");
    180 
    181         return false;
    182     }
    183 
    184     // need a read lock
     171
     172    // We have to open the instance that we're going to copy from first.  If
     173    // we don't do this, it's possible that open will find & open the new
     174    // instance that we're in the process of creating
    185175    sourceFH = nebOpen(server, (char *)key, NEB_READ);
    186176    if (sourceFH == -1) {
    187177        nebSetErr(server, "can not open key %s", key);
    188178        nebFree(filename);
     179
     180        return false;
     181    }
     182
     183    // ask the server for a new instance attached to our key
     184    if (soap_call_ns1__replicate_USCOREobject(server->soap, server->endpoint,
     185            NULL, (char *)key, (char *)volume, (char **)&response) != SOAP_OK) {
     186        nebSetServerErr(server);
     187
     188        return false;
     189    }
     190
     191    if (!nebParseURI(server, (char *)response.result, &filename)) {
     192        nebSetErr(server, "can not parse URI");
    189193
    190194        return false;
Note: See TracChangeset for help on using the changeset viewer.