Commit e0b4a302 authored by 's avatar

Add 'agent' component for DiMAPI

git-svn-id: file:///home/svn/mapi/trunk@227 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 64457166
......@@ -152,7 +152,7 @@ void *handle_request(void *arg) {
else
dbuf->cmd = CREATE_FLOW_ACK;
memcpy(dbuf->data, &mapid_result, sizeof(int));
active_flows = realloc(active_flows,ac_fl_size+sizeof(int));
active_flows = realloc(active_flows,(ac_fl_size+1)*sizeof(int));
active_flows[ac_fl_size++] = mapid_result;
print_table(active_flows,ac_fl_size);
dbuf->length = BASIC_SIZE+sizeof(int);
......@@ -164,7 +164,7 @@ void *handle_request(void *arg) {
for(i=0;i<ac_fl_size;++i){
if(active_flows[i] == dbuf->fd){
active_flows[i] = active_flows[--ac_fl_size];
active_flows = realloc(active_flows,ac_fl_size);
active_flows = realloc(active_flows,ac_fl_size*sizeof(int));
}
}
dbuf->cmd = CLOSE_FLOW_ACK;
......
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