Roxen.git / server / base_server / module.pike

version» Context lines:

Roxen.git/server/base_server/module.pike:1351:    }       string|int(-1..0) etag;       int(0..1) locked_fail = !!lock;    next_condition:    foreach(condition, array(array(string)) sub_cond) {    SIMPLE_TRACE_ENTER(this,    "Trying condition ( %{%s:%O %})...", sub_cond);    int negate; -  DAVLock locked = lock; +  int|DAVLock locked = lock;    foreach(sub_cond, array(string) token) {    switch(token[0]) {    case "not":    negate = !negate;    break;    case "etag":    if (!etag) {    // Get the etag for this resource (if any).    // FIXME: We only support straight strings as etag properties.    if (!stringp(etag = query_property(relative_path,
Roxen.git/server/base_server/module.pike:1383:    // Etag match with negated expression.    TRACE_LEAVE("Matched negated etag.");    continue next_condition;    }    negate = 0;    break;    case "key":    // The user has specified a key, so don't fail with DAV_LOCKED.    locked_fail = 0;    if (negate) { -  if (lock && lock->locktoken == token[1]) { +  if (objectp(lock) && lock->locktoken == token[1]) {    TRACE_LEAVE("Matched negated lock.");    continue next_condition; // Fail.    } -  } else if (!lock || lock->locktoken != token[1]) { +  } else if (!objectp(lock) || lock->locktoken != token[1]) {    // Lock mismatch.    TRACE_LEAVE("Lock mismatch.");    continue next_condition; // Fail.    } else {    locked = 0;    }    negate = 0;    break;    }    }