pike.git / lib / modules / Protocols.pmod / Bittorrent.pmod / Bencoding.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/Bittorrent.pmod/Bencoding.pmod:101:    error("dictionaries (mappings) must have "    "string keys!\n");    res+=encode(key)+encode(value);    }    return res+"e";    default:    error("Cannot Bittorrent-Bencode type: %t\n",data);    }   }    - private static array(string) bits= + private protected array(string) bits=    sprintf("%08b",Array.enumerate(256)[*]); - private static array(string) bobs= + private protected array(string) bobs=    sprintf("%c",Array.enumerate(256)[*]);      //! Convert an array of @expr{int(0..1)@} to a Bittorrent style   //! bitstring. Input will be padded to even bytes.   string bits2string(array(int(0..1)) v)   {    if (sizeof(v)&7) v+=({0})*(8-sizeof(v)&7);    return replace(sprintf("%@d",v),bits,bobs);   }   
pike.git/lib/modules/Protocols.pmod/Bittorrent.pmod/Bencoding.pmod:133:   {    if (last2arrbits==s) return copy_value(last2arrarr); // simple cache    array v=string2bits(last2arrbits=s);    array w=indices(v);    sort(v,w);    int i=search(v,1);    if (i==-1) return last2arrarr=({});    return last2arrarr=w[i..];   }    - static private string last2arrbits=0; - static private array(int) last2arrarr=0; + protected private string last2arrbits=0; + protected private array(int) last2arrarr=0;