⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhblock_replicated.c

📁 基于DHT的对等协议
💻 C
字号:
#include "dhash_common.h"#include "dhblock_replicated.h"#include <configurator.h>chordIDdhblock_replicated::id_to_dbkey (const chordID &key){  // get a key with the low bits cleared out  return (key >> 32) << 32;}u_intdhblock_replicated::num_replica (){  static bool initialized = false;  static int v = 0;  if (!initialized) {    initialized = Configurator::only ().get_int ("dhash.replica", v);    assert (initialized);  }  return v;}int dhblock_replicated::process_download (blockID k, str frag){  //XXX logic to keep track of other frags (if any)   // and vote if we get more than one content  done_flag = true;  result_str = frag;  return 0;}strdhblock_replicated::produce_block_data (){  assert (done_flag);  return result_str;}str dhblock_replicated::generate_fragment (ptr<dhash_block> block, int n){  return block->data;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -