dhblock_replicated.c

来自「chord 源码 http://pdos.csail.mit.edu/chor」· C语言 代码 · 共 41 行

C
41
字号
#include "dhash_common.h"#include "dhblock_replicated.h"#include <configurator.h>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 + =
减小字号Ctrl + -
显示快捷键?