Exemple #1
0
static int deal_with_wrap_up_from_chfd(struct iobuf *rbuf, struct blist *blist,
	struct dpth *dpth)
{
	static struct blk b;
	if(blk_set_from_iobuf_wrap_up(&b, rbuf))
		return -1;

	if(mark_up_to_index(blist, b.index, dpth)) return -1;
	if(mark_not_got(blist->blk_from_champ_chooser, dpth)) return -1;
	return 0;
}
Exemple #2
0
static int deal_with_read_from_chfd(struct asfd *asfd, struct asfd *chfd,
	struct blist *blist, uint64_t *wrap_up, struct dpth *dpth)
{
	int ret=-1;
	uint64_t file_no;
	char *save_path;

	// Deal with champ chooser read here.
	//printf("read from cc: %s\n", chfd->rbuf->buf);
	switch(chfd->rbuf->cmd)
	{
		case CMD_SIG:
			// Get these for blks that the champ chooser has found.
			file_no=decode_file_no_and_save_path(chfd->rbuf,
				&save_path);
		//	printf("got save_path: %d %s\n", file_no, save_path);
			if(mark_up_to_index(blist, file_no, dpth)) goto end;
			mark_got(blist->blk_from_champ_chooser, save_path);
//			printf("after mark_got: %d\n",
//				blist->blk_from_champ_chooser->index);
			break;
		case CMD_WRAP_UP:
			file_no=decode_file_no(chfd->rbuf);
	//		printf("mark up to: %d\n", file_no);
			if(mark_up_to_index(blist, file_no, dpth)) goto end;
			mark_not_got(blist->blk_from_champ_chooser, dpth);

			//printf("after mark_up: %d\n",
			//	blist->blk_from_champ_chooser->index);
			break;
		default:
			iobuf_log_unexpected(chfd->rbuf, __func__);
			goto end;
	}
	ret=0;
end:
	iobuf_free_content(chfd->rbuf);
	return ret;
}
Exemple #3
0
static int deal_with_sig_from_chfd(struct iobuf *rbuf, struct blist *blist,
	struct dpth *dpth)
{
	static struct blk b;
	if(blk_set_from_iobuf_index_and_savepath(&b, rbuf))
		return -1;

	if(mark_up_to_index(blist, b.index, dpth))
		return -1;
	blist->blk_from_champ_chooser->savepath=b.savepath;
	blist->blk_from_champ_chooser->got=BLK_GOT;
	blist->blk_from_champ_chooser->got_save_path=1;
	return 0;
}