Tor 0.4.9.1-alpha-dev
Functions
consdiff.h File Reference

Header for consdiff.c. More...

#include "core/or/or.h"

Go to the source code of this file.

Functions

char * consensus_diff_generate (const char *cons1, size_t cons1len, const char *cons2, size_t cons2len)
 
char * consensus_diff_apply (const char *consensus, size_t consensus_len, const char *diff, size_t diff_len)
 
int looks_like_a_consensus_diff (const char *document, size_t len)
 

Detailed Description

Header for consdiff.c.

Definition in file consdiff.h.

Function Documentation

◆ consensus_diff_apply()

char * consensus_diff_apply ( const char *  consensus,
size_t  consensus_len,
const char *  diff,
size_t  diff_len 
)

Given a consensus document and a diff, try to apply the diff to the consensus. On success return a newly allocated string containing the new consensus. On failure, return NULL.

Definition at line 1381 of file consdiff.c.

◆ consensus_diff_generate()

char * consensus_diff_generate ( const char *  cons1,
size_t  cons1len,
const char *  cons2,
size_t  cons2len 
)

Given two consensus documents, try to compute a diff between them. On success, return a newly allocated string containing that diff. On failure, return NULL.

Definition at line 1341 of file consdiff.c.

◆ looks_like_a_consensus_diff()

int looks_like_a_consensus_diff ( const char *  document,
size_t  len 
)

Return true iff, based on its header, document is likely to be a consensus diff.

Definition at line 1416 of file consdiff.c.

Referenced by handle_response_fetch_consensus().