From: Asbjorn M. <ste...@us...> - 2002-03-08 11:10:19
|
Update of /cvsroot/epp-rtk/epp-rtk/c++/src/transport In directory usw-pr-cvs1:/tmp/cvs-serv21971 Modified Files: epp_TransportIOStream.cc Log Message: -Fixed readFromServer to handle "</epp>" properly even if it is not at the end of the line (looks ugly, but it works and is reasonably fast). -Changed ifdef identifier used for testing Index: epp_TransportIOStream.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/transport/epp_TransportIOStream.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** epp_TransportIOStream.cc 20 Feb 2002 17:26:02 -0000 1.4 --- epp_TransportIOStream.cc 8 Mar 2002 11:10:15 -0000 1.5 *************** *** 37,41 **** cout << endl; ! #ifdef TEST_OUTPUTTOCERR cerr << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"; cerr << xml_string << endl; --- 37,41 ---- cout << endl; ! #ifdef TEST_IO_REQUEST2CERR cerr << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"; cerr << xml_string << endl; *************** *** 45,59 **** string epp_TransportIOStream::readFromServer() { ! string s, line; ! ! // <FIXME>Must handle a situation where "</epp>" is not on a line of its own...</fixme> ! while(getline(cin,line) && line.find("</epp>") == string::npos) ! { ! s += line; ! s += "\n"; ! } ! s += line; ! s += "\n"; return s; --- 45,79 ---- string epp_TransportIOStream::readFromServer() { ! string s; ! char c; ! while(cin) { ! cin.get(c); ! s += c; ! if(c == '<') { // if "<" ! cin.get(c); ! s += c; ! if(c == '/') { // if "</" ! cin.get(c); ! s += c; ! if(c == 'e') { // if "</e" ! cin.get(c); ! s += c; ! if(c == 'p') { // if "</ep" ! cin.get(c); ! s += c; ! if(c == 'p') { // if "</epp" ! cin.get(c); ! s += c; ! if(c == '>') { // if "</epp>" ! break; ! } // if "</epp>" ! } // if "</epp" ! } // if "</ep" ! } // if "</e" ! } // if "</" ! } // if "<" ! ! } // while return s; |