diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index 17e6c989..43ba225d 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -1152,7 +1152,7 @@ void node_impl::incoming_request(msg const& m, entry& e) return; } - if (!multi && (!msg_keys[mk_seq] || msg_keys[mk_seq]->int_value() <= 0)) { + if (!multi && (!msg_keys[mk_seq] || msg_keys[mk_seq]->int_value() < 0)) { incoming_error(e, "seq is required for single"); return; } diff --git a/src/twister.cpp b/src/twister.cpp index 0f2f23c3..fd4fdfc3 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -930,17 +930,17 @@ Value newpostmsg(const Array& params, bool fHelp) } else { // TODO: swarm resource forwarding not implemented ses->dht_putData(strUsername, "swarm", false, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 1); } // post to dht as well ses->dht_putData(strUsername, string("post")+strK, false, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 1); // is this a reply? notify if( strReplyN.length() ) { ses->dht_putData(strReplyN, string("replies")+strReplyK, true, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 0); } // split and look for mentions and hashtags @@ -952,10 +952,10 @@ Value newpostmsg(const Array& params, bool fHelp) string word = token.substr(1); if( token.at(0) == '#') { ses->dht_putData(word, "hashtag", true, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 0); } else if( token.at(0) == '@') { ses->dht_putData(word, "mention", true, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 0); } } } @@ -1046,19 +1046,19 @@ Value newrtmsg(const Array& params, bool fHelp) } else { // TODO: swarm resource forwarding not implemented ses->dht_putData(strUsername, "swarm", false, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 1); } // post to dht as well ses->dht_putData(strUsername, string("post")+strK, false, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 1); // notification to keep track of RTs of the original post if( rt ) { string rt_user = rt->find_key("n")->string(); string rt_k = boost::lexical_cast(rt->find_key("k")->integer()); ses->dht_putData(rt_user, string("rts")+rt_k, true, - v, strUsername, GetAdjustedTime(), k); + v, strUsername, GetAdjustedTime(), 0); } return entryToJson(v);