pike.git / lib / modules / Search.pmod / Queue.pmod / MySQL.pike

version» Context lines:

pike.git/lib/modules/Search.pmod/Queue.pmod/MySQL.pike:88:    if( force || check_link(uri, allow, deny) )    {    if(has_uri(r))    {    // FIXME:    // Race condition:    // If a url is forced to be indexed *while* it's being indexed,    // and it's changed since the indexing started, setting the stage    // to 0 here might be worthless, since it could be overwritten before    // it's fetched again. -  if(force) +  if(force) {    set_stage(r, 0); -  +  set_recurse(r, recurse);    } -  +  }    else    db->query( "insert into "+table+    " (uri,uri_md5,recurse,template) values (%s,%s,%d,%s)",    string_to_utf8((string)r),    to_md5((string)r), recurse, (template||"") );    }   }      void set_md5( Standards.URI uri, string md5 )   { -  +  if( extra_data[(string)uri] ) +  extra_data[(string)uri]->md5 = md5;    db->query( "update "+table+    " set md5=%s WHERE uri_md5=%s", md5, to_md5((string)uri) );   }    -  + void set_recurse( Standards.URI uri, int recurse ) + { +  if( extra_data[(string)uri] ) +  extra_data[(string)uri]->recurse = recurse; +  db->query( "update "+table+ +  " set recurse=%d WHERE uri_md5=%s", recurse, to_md5((string)uri)); + } +    mapping(string:mapping(string:string)) extra_data = ([]);   mapping get_extra( Standards.URI uri )   {    if( extra_data[(string)uri] )    return extra_data[(string)uri];    array r = db->query( "SELECT md5,recurse,stage,template "    "FROM "+table+" WHERE uri_md5=%s", to_md5((string)uri) );    if( sizeof( r ) )    return r[0];