Commit 71017736 authored by 's avatar
Browse files

fix result size definition in TOP


git-svn-id: file:///home/svn/mapi/trunk@895 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 8501dcf7
...@@ -466,6 +466,7 @@ static int topx_process(mapidflib_function_instance_t *instance, ...@@ -466,6 +466,7 @@ static int topx_process(mapidflib_function_instance_t *instance,
struct topx_list_node *tmp; struct topx_list_node *tmp;
int i=0; int i=0;
unsigned int *ptr; unsigned int *ptr;
unsigned long *lptr;
struct topx_result *result; struct topx_result *result;
// struct timeval ts; // struct timeval ts;
unsigned int cur_secs = 0; unsigned int cur_secs = 0;
...@@ -516,6 +517,14 @@ static int topx_process(mapidflib_function_instance_t *instance, ...@@ -516,6 +517,14 @@ static int topx_process(mapidflib_function_instance_t *instance,
add_field_to_list(&field,data,(unsigned long long)(pkt_head->wlen - ether_len), data->last_rst); add_field_to_list(&field,data,(unsigned long long)(pkt_head->wlen - ether_len), data->last_rst);
tmp=data->list_head; tmp=data->list_head;
lptr=(unsigned long *)&(instance->result.info.shm.res_size);
//write the number of results
if(data->list_size<=data->x)
*lptr=(data->list_size * sizeof(struct topx_result) + sizeof(unsigned int));
else
*lptr=(data->x* sizeof(struct topx_result) + sizeof(unsigned int));
ptr=(unsigned int *)(instance->result.data); ptr=(unsigned int *)(instance->result.data);
//write the number of results //write the number of results
if(data->list_size<=data->x) if(data->list_size<=data->x)
......
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