[Dfsm-devel] dFSM/src/libdfsm tinput.cpp,1.19,1.20
Status: Beta
Brought to you by:
amoreno
|
From: Andreu M. <am...@us...> - 2004-03-26 12:47:50
|
Update of /cvsroot/dfsm/dFSM/src/libdfsm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15475/src/libdfsm Modified Files: tinput.cpp Log Message: Improvement buffer used in tInput::send_to Index: tinput.cpp =================================================================== RCS file: /cvsroot/dfsm/dFSM/src/libdfsm/tinput.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tinput.cpp 5 Mar 2004 18:41:14 -0000 1.19 --- tinput.cpp 26 Mar 2004 12:36:52 -0000 1.20 *************** *** 30,33 **** --- 30,36 ---- * $Revision$ * $Log$ + * Revision 1.20 2004/03/26 12:36:52 amoreno + * Improvement buffer used in tInput::send_to + * * Revision 1.19 2004/03/05 18:41:14 jvalduvieco * Major modifications. Quick implemetation. A little messy. *************** *** 140,143 **** --- 143,147 ---- // We should protect against a user mistake in "len". // Retornar coses + // TODO: Total order of events is not guaranteed. Some blocked tool is needed int tInput::send_to(u_int16_t id_msg, const char *data=0,u_int16_t len=0) { *************** *** 149,152 **** --- 153,158 ---- char *ptr; + msg=new unsigned char[sizeof(tEvent::Event)+len]; + vector<u_int16_t>::iterator vns_i; vector<u_int16_t> vns = tInput::sm->get_msg_machine(id_msg); *************** *** 181,185 **** // Now we can read/write via sockfd FSMLOG(3) <<"Connected to "<<address.sun_path<<endl; ! msg=new unsigned char[sizeof(tEvent::Event)+len]; event=(tEvent::Event *)msg; if (msg != NULL) --- 187,191 ---- // Now we can read/write via sockfd FSMLOG(3) <<"Connected to "<<address.sun_path<<endl; ! //msg=new unsigned char[sizeof(tEvent::Event)+len]; event=(tEvent::Event *)msg; if (msg != NULL) *************** *** 212,220 **** } close(sockfd); ! delete[] msg ; } } return bytes_sent; } --- 218,227 ---- } close(sockfd); ! //delete[] msg ; } } + delete[] msg ; return bytes_sent; } |