diff --git a/PIPEasp_CNL113334.tpd b/PIPEasp_CNL113334.tpd index f93f65d3e18484623a85f35780e2add8d1870f1b..3541edab76f0aa60459a97c0b6c327ee31fc2019 100644 --- a/PIPEasp_CNL113334.tpd +++ b/PIPEasp_CNL113334.tpd @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2015 Ericsson + Copyright (c) 2018 Ericsson All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -10,7 +10,7 @@ File: PIPEasp_CNL113334.tpd Description: tpd project file - Rev: R7C + Rev: R7D Prodnr: CNL 113 334 --> diff --git a/doc/PIPEasp_CNL113334_PRI.doc b/doc/PIPEasp_CNL113334_PRI.doc index 8d160e6a75cebfef67e57deda5a0ef1a22107202..f1784dd657db8524647ae1128b0e4c0da9e929c7 100644 Binary files a/doc/PIPEasp_CNL113334_PRI.doc and b/doc/PIPEasp_CNL113334_PRI.doc differ diff --git a/src/PIPE.grp b/src/PIPE.grp index a25dac6ae91a11e68c23f4221f191be99238be7c..23ec62ad3b1365ec58bdd9614ba067c19876a76d 100644 --- a/src/PIPE.grp +++ b/src/PIPE.grp @@ -19,7 +19,7 @@ // // File: PIPE.grp // Description: Group file of PIPE testport implementation -// Rev: R7C +// Rev: R7D // Prodnr: CNL 113 334 // --> diff --git a/src/PIPEasp_PT.cc b/src/PIPEasp_PT.cc index d71b13987d5be42fd13c83d0a04a84281e3039a4..3e98503b395ebdacb0693345ad4c140f602e1617 100644 --- a/src/PIPEasp_PT.cc +++ b/src/PIPEasp_PT.cc @@ -18,7 +18,7 @@ // // File: PIPEasp_PT.cc // Description: Source code of PIPE testport implementation -// Rev: R7C +// Rev: R7D // Prodnr: CNL 113 334 // @@ -121,8 +121,9 @@ namespace PIPEasp__PortType { PIPEasp__PT::PIPEasp__PT(const char *par_port_name) : PIPEasp__PT_BASE(par_port_name) - , pipedata_len(0) - , pipedata_used(0) + , maindata_len(0) + , maindata_used(0) + , threaddata_len(0) , main_data(NULL) , thread_data(NULL) , lineMode(true) @@ -158,7 +159,7 @@ PIPEasp__PT::~PIPEasp__PT() } if(main_data){ - for(int i=0;i<pipedata_len;i++) { + for(int i=0;i<maindata_len;i++) { if((main_data+i)->stdout_buffer){delete (main_data+i)->stdout_buffer;}; if((main_data+i)->stderr_buffer){delete (main_data+i)->stderr_buffer;}; } @@ -284,8 +285,8 @@ void PIPEasp__PT::user_map(const char *system_port) { log("%s mapping, child pid: %d",system_port, processServerPid); Handler_Add_Fd_Read(processServerUp); - pipedata_len=1; - pipedata_used=1; + maindata_len=1; + maindata_used=1; main_data=(pipedata_main*)Malloc(sizeof(pipedata_main)); setup_pipedata_main(0); main_data[0].reuse=true; @@ -343,7 +344,7 @@ void PIPEasp__PT::user_unmap(const char *system_port) log("Message sent %d",res); if(main_data){ - for(int i=0;i<pipedata_len;i++) { + for(int i=0;i<maindata_len;i++) { if((main_data+i)->stdout_buffer){delete (main_data+i)->stdout_buffer;}; if((main_data+i)->stderr_buffer){delete (main_data+i)->stderr_buffer;}; } @@ -1020,7 +1021,7 @@ void PIPEasp__PT::handle_childDeath(const int p_id) { main_data[p_id].stdout_buffer=NULL; Free(main_data[p_id].stderr_buffer); main_data[p_id].stderr_buffer=NULL; - pipedata_used--; + maindata_used--; } } @@ -1435,7 +1436,7 @@ void PIPEasp__PT::processHandler(){ //printf("kill(%d,%d) returned %d\r\n", processPid,sig_no,a); break; case 9: // unmap command - for(int i=0;i<pipedata_len;i++){ + for(int i=0;i<threaddata_len;i++){ if(thread_data[i].processStdin!=-1){ close(thread_data[i].processStdin); thread_data[i].processStdin=-1; @@ -1461,13 +1462,13 @@ void PIPEasp__PT::processHandler(){ case 12: p_id=((int)msg[5]<<8) + (int)msg[6]; - if(pipedata_len<=p_id){ + if(threaddata_len<=p_id){ int new_size=p_id+1; thread_data=(pipedata_thread *)Realloc(thread_data,new_size*sizeof(pipedata_thread)); - for(int i= pipedata_len;i<new_size;i++){ + for(int i= threaddata_len;i<new_size;i++){ init_pipedata(i); } - pipedata_len=new_size; + threaddata_len=new_size; } init_pipedata(p_id); break; @@ -1485,7 +1486,7 @@ void PIPEasp__PT::processHandler(){ return; } } - for(int p_id=0;result>0 && p_id<pipedata_len;p_id++){ + for(int p_id=0;result>0 && p_id<threaddata_len;p_id++){ if(thread_data[p_id].processStdout!=-1 && FD_ISSET(thread_data[p_id].processStdout,&select_set)){ result--; nBytes = PIPE_BUF_SIZE; @@ -1801,7 +1802,7 @@ void PIPEasp__PT::close_and_remove_fd(int fd){ FD_CLR(fd,&working_set); if(fd==max_fd){ max_fd=processServerDown; - for(int i=0;i<pipedata_len;i++){ + for(int i=0;i<threaddata_len;i++){ if(thread_data[i].processStdout!=-1 && thread_data[i].processStdout!=fd){ max_fd=max_fd>thread_data[i].processStdout?max_fd:thread_data[i].processStdout; } @@ -1818,12 +1819,12 @@ void PIPEasp__PT::close_and_remove_fd(int fd){ INTEGER f__PIPE__request__p__id(PIPEasp__PortType::PIPEasp__PT& pl__port, BOOLEAN const&pl__reuse){ int return_value=-1; - if((pl__port.pipedata_used+1)>pl__port.pipedata_len){ - return_value=pl__port.pipedata_len; - pl__port.pipedata_len++; - pl__port.main_data=(PIPEasp__PT::pipedata_main*)Realloc(pl__port.main_data,pl__port.pipedata_len*sizeof(PIPEasp__PT::pipedata_main)); + if((pl__port.maindata_used+1)>pl__port.maindata_len){ + return_value=pl__port.maindata_len; + pl__port.maindata_len++; + pl__port.main_data=(PIPEasp__PT::pipedata_main*)Realloc(pl__port.main_data,pl__port.maindata_len*sizeof(PIPEasp__PT::pipedata_main)); } else { - for(int i=0;i<pl__port.pipedata_len;i++){ + for(int i=0;i<pl__port.maindata_len;i++){ if(!pl__port.main_data[i].state){ return_value=i; break; @@ -1832,7 +1833,7 @@ INTEGER f__PIPE__request__p__id(PIPEasp__PortType::PIPEasp__PT& pl__port, BOOLEA } - pl__port.pipedata_used++; + pl__port.maindata_used++; pl__port.setup_pipedata_main(return_value); pl__port.main_data[return_value].reuse=pl__reuse; pl__port.send_p_id_to_thread(return_value); @@ -1841,7 +1842,7 @@ INTEGER f__PIPE__request__p__id(PIPEasp__PortType::PIPEasp__PT& pl__port, BOOLEA BOOLEAN f__PIPE__release__p__id(PIPEasp__PortType::PIPEasp__PT& pl__port, INTEGER const&pl__pid){ int p_id=(int)pl__pid; - if( (p_id>=0) && (p_id<pl__port.pipedata_len) && pl__port.main_data[p_id].state && !pl__port.main_data[p_id].processExecuting){ + if( (p_id>=0) && (p_id<pl__port.maindata_len) && pl__port.main_data[p_id].state && !pl__port.main_data[p_id].processExecuting){ pl__port.main_data[p_id].state=0; if(pl__port.main_data[p_id].stdout_buffer) { Free(pl__port.main_data[p_id].stdout_buffer); @@ -1851,7 +1852,7 @@ BOOLEAN f__PIPE__release__p__id(PIPEasp__PortType::PIPEasp__PT& pl__port, INTEGE Free(pl__port.main_data[p_id].stderr_buffer); pl__port.main_data[p_id].stderr_buffer=NULL; } - pl__port.pipedata_used--; + pl__port.maindata_used--; return true; } diff --git a/src/PIPEasp_PT.hh b/src/PIPEasp_PT.hh index 9fbae9812dc6f6f47f963ec77010cc0e03439f5e..4fe1f87695218219731e585849a4abb37e4f96e0 100644 --- a/src/PIPEasp_PT.hh +++ b/src/PIPEasp_PT.hh @@ -18,7 +18,7 @@ // // File: PIPEasp_PT.hh // Description: Header file of PIPE testport implementation -// Rev: R7C +// Rev: R7D // Prodnr: CNL 113 334 // @@ -68,8 +68,9 @@ public: }; - int pipedata_len; - int pipedata_used; + int maindata_len; + int maindata_used; + int threaddata_len; pipedata_main *main_data; pipedata_thread *thread_data; void setup_pipedata_main(int idx); @@ -109,7 +110,7 @@ private: - boolean pipe_id_valid(const int p_id){if((p_id>=0)&&(p_id<pipedata_len)){return main_data[p_id].state==1;} else {return false;}} + boolean pipe_id_valid(const int p_id){if((p_id>=0)&&(p_id<maindata_len)){return main_data[p_id].state==1;} else {return false;}} int execCommand(const char* command); @@ -148,7 +149,7 @@ private: void newcmd_pty(const int p_id,const char* command); void close_and_remove_fd(int fd); - void free_thread_data(){ if(thread_data){Free(thread_data);thread_data=NULL;pipedata_used=0;pipedata_len=0;}} + void free_thread_data(){ if(thread_data){Free(thread_data);thread_data=NULL;threaddata_len=0;}} void init_pipedata(int idx); private: diff --git a/src/PIPEasp_PortType.ttcn b/src/PIPEasp_PortType.ttcn index 4692eba0b9c0b9e530cc36b279cdf7388a46a175..d0ec1f2d27da90808220bbd79d0ea2f6240861c4 100644 --- a/src/PIPEasp_PortType.ttcn +++ b/src/PIPEasp_PortType.ttcn @@ -17,7 +17,7 @@ ******************************************************************************/ // // File: PIPEasp_PortType.ttcn -// Rev: R7C +// Rev: R7D // Prodnr: CNL 113 334 module PIPEasp_PortType diff --git a/src/PIPEasp_Types.ttcn b/src/PIPEasp_Types.ttcn index 8f02a737f02fcc22eed2daed774d27bbf5e58520..e9a7c7427ff80a5ee1365044246f3e329c262ac3 100644 --- a/src/PIPEasp_Types.ttcn +++ b/src/PIPEasp_Types.ttcn @@ -18,7 +18,7 @@ // // File: PIPEasp_Types.ttcn // Description: PIPE (ASP) definitions -// Rev: R7C +// Rev: R7D // Prodnr: CNL 113 334 //