Commit ec78a7c8 authored by 's avatar
Browse files

fixes in ifdef inside mapi.c , bug hunting in cooking.c


git-svn-id: file:///home/svn/mapi/trunk@214 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 6bc9b42f
......@@ -1061,7 +1061,8 @@ int mapi_apply_function(int fd, char* funct, ...)
}
addarg(&pos,marshalBuffer,STRING);
}
#else
else
#endif
// parse function arguments
if(strncmp(fdef->argdescr, "", 1)) { // there are some args
argdescr_ptr = fdef->argdescr;
......@@ -1073,6 +1074,7 @@ int mapi_apply_function(int fd, char* funct, ...)
arg_size+=strlen(temp)+1;
break;
case 'i':
printf("lalala\n");
tmp = va_arg(vl, int);
addarg(&pos, &tmp, INT);
arg_size+=sizeof(int);
......@@ -1135,7 +1137,6 @@ int mapi_apply_function(int fd, char* funct, ...)
argdescr_ptr++; // move to the next arg
}
}
#endif
#ifdef DIMAPI
if(is_remote){//flow is remote
......
......@@ -76,8 +76,7 @@ static int cook_instance(mapidflib_function_instance_t* instance, flist_t *flist
data= (struct cooking_data*)malloc(sizeof(struct cooking_data));
data->flow=flow;
instance->internal_data=data;
return 0;
}
......@@ -100,10 +99,7 @@ void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthd
ip->tlen = ntohs(flow->client_size + ip_len + tcp_len);
flow->mod_pkt = malloc(sizeof(char) * (flow->client_size + ether_len + ip_len + tcp_len));
if(flow->mod_pkt==NULL) {
//fprintf(stderr,"client size: %d\n",flow->client_size);
assert(flow->mod_pkt!=NULL);
}
assert(flow->mod_pkt!=NULL);
memcpy(flow->mod_pkt, eth, ether_len);
memcpy(&flow->mod_pkt[ether_len], ip, ip_len);
memcpy(&flow->mod_pkt[ether_len + ip_len], tcp, tcp_len);
......@@ -112,10 +108,7 @@ void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthd
//server packet
flow->server_mod_pkt = malloc(sizeof(char) * (flow->server_size + ether_len + ip_len + tcp_len));
if(flow->server_mod_pkt==NULL) {
fprintf(stderr,"client size: %d\n",flow->client_size);
assert(flow->server_mod_pkt!=NULL);
}
assert(flow->server_mod_pkt!=NULL);
memcpy(flow->server_mod_pkt, eth, ether_len);
memcpy(&flow->server_mod_pkt[ether_len], ip, ip_len);
memcpy(&flow->server_mod_pkt[ether_len + ip_len], tcp, tcp_len);
......@@ -125,8 +118,7 @@ void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthd
flow->client_headers = flow->ret_client_headers;
flow->server_headers = flow->ret_server_headers;
pkt_head->caplen = flow->client_size + ether_len + ip_len + tcp_len;
pkt_head->wlen = flow->client_size + ether_len + ip_len + tcp_len;
pkt_head->caplen = pkt_head->wlen = flow->client_size + ether_len + ip_len + tcp_len;
}
void process_flushed_data(struct mapidlibflow *flow) {
......@@ -363,6 +355,7 @@ static int cook_init(mapidflib_function_instance_t *instance,
fargs=instance->args;
data=(struct cooking_data *)(instance->internal_data);
data->threshold=getargint(&fargs);
data->timeout=getargint(&fargs);
data->id=cooking_id;
......@@ -381,8 +374,6 @@ static int cook_init(mapidflib_function_instance_t *instance,
data->threshold = -1;
}
instance->internal_data=(void *)data;
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment