1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

const in BitTorrent

This commit is contained in:
Kalle Olavi Niemitalo 2008-01-26 17:24:43 +02:00 committed by Kalle Olavi Niemitalo
parent cab0b3fbd5
commit a831beb6c8
3 changed files with 9 additions and 7 deletions

View File

@ -327,7 +327,7 @@ check_bencoding_dictionary_entry(struct scanner *scanner,
static off_t
parse_bencoding_integer(struct scanner_token *token)
{
unsigned char *string = token->string;
const unsigned char *string = token->string;
int pos = 0, length = token->length;
off_t integer = 0;
int sign = 1;
@ -356,7 +356,8 @@ parse_bencoding_integer(struct scanner_token *token)
}
static unsigned char *
normalize_bencoding_path(unsigned char *path, int pathlen, int *malicious)
normalize_bencoding_path(const unsigned char *path, int pathlen,
int *malicious)
{
struct string string;
@ -739,7 +740,7 @@ parse_bittorrent_metafile(struct bittorrent_meta *meta, struct string *metafile)
case BENCODING_TOKEN_INFO:
{
unsigned char *start = value->string;
const unsigned char *start = value->string;
struct scanner_token *token;
enum bittorrent_state state;
@ -885,8 +886,9 @@ parse_bencoding_peers_string(struct bittorrent_connection *bittorrent,
struct scanner *scanner)
{
struct scanner_token *token = get_scanner_token(scanner);
unsigned char *pos;
unsigned char *last_peer_info_start = token->string + token->length - 6;
const unsigned char *pos;
const unsigned char *last_peer_info_start
= token->string + token->length - 6;
enum bittorrent_state state = BITTORRENT_STATE_OK;
assert(get_scanner_token(scanner)->type == BENCODING_TOKEN_STRING);

View File

@ -213,7 +213,7 @@ get_peer_from_bittorrent_pool(struct bittorrent_connection *bittorrent,
enum bittorrent_state
add_peer_to_bittorrent_pool(struct bittorrent_connection *bittorrent,
bittorrent_id_T id, int port,
unsigned char *ip, int iplen)
const unsigned char *ip, int iplen)
{
struct bittorrent_peer *peer;

View File

@ -368,7 +368,7 @@ bittorrent_id_is_known(struct bittorrent_connection *bittorrent,
enum bittorrent_state
add_peer_to_bittorrent_pool(struct bittorrent_connection *bittorrent,
bittorrent_id_T id, int port,
unsigned char *ip, int iplen);
const unsigned char *ip, int iplen);
struct bittorrent_peer *
get_peer_from_bittorrent_pool(struct bittorrent_connection *bittorrent,