aboutsummaryrefslogtreecommitdiff
path: root/conn_data.c
blob: fa2da10bafc298c60bfa078bee3311c7b8caaeb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "conn_data.h"


void conn_data_init(struct conn_data *data,int fd){
	data->fd=fd;
	data->bufsz=512;
	data->buflen=0;
	data->buffer=malloc(data->bufsz,char);

	data->protversion=-1;
	data->userid=-1;
}

void conn_data_nullify(struct conn_data *data){
	free(data->buffer);
	data->buffer=NULL;
	data->bufsz=0;
	data->buflen=0;

	data->protversion=-1;
	data->userid=-1;
}