[Feature][T8TSK-4][Data]Fix data ret = -1 problem
Change-Id: I49b85a622f5f1b30847d06c490ed315b0c389fd5
diff --git a/src/lynq/lib/liblynq-data/lynq_data.cpp b/src/lynq/lib/liblynq-data/lynq_data.cpp
index 677fb5f..456b888 100755
--- a/src/lynq/lib/liblynq-data/lynq_data.cpp
+++ b/src/lynq/lib/liblynq-data/lynq_data.cpp
@@ -262,12 +262,11 @@
}
return 0;
}
-int JumpHeader(Parcel &p,int *resp_type,int *token, int *request,int *slot_id,int *error)
+int JumpHeader(Parcel &p,int *resp_type,int *request,int *slot_id,int *error)
{
if(p.dataAvail() > 0)
{
p.readInt32(resp_type);
- p.readInt32(token);
p.readInt32(request);
p.readInt32(slot_id);
p.readInt32(error);
@@ -602,7 +601,6 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
- int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -627,7 +625,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
lynq_data_call_id = updateApn("default");
lynq_data_call = 1;
@@ -649,7 +647,6 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
- int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -690,7 +687,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
cleanOnceApnTable(lynq_data_call_id);
return error;
@@ -700,7 +697,6 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
- int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -767,7 +763,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
lynq_data_call_id = updateApn(apnType);
lynq_data_call = 1;
@@ -811,7 +807,7 @@
return -1;
}
get_response(lynq_client_sockfd,p);
- JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
@@ -848,7 +844,19 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
+ if(p.dataAvail() > 0)
+ {
+ p.readInt32(resp_type);
+ p.readInt32(token);
+ p.readInt32(request);
+ p.readInt32(slot_id);
+ p.readInt32(error);
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
p.readInt32(&version);
if(version==11)