/** * $Id: scanner_server.cpp,v 1.9.2.1 2002/10/31 22:32:23 plasmahh Exp $ * $Revision: 1.9.2.1 $ * $Author: plasmahh $ * $Date: 2002/10/31 22:32:23 $ */ #include "scanner_server.h" mstring scanner_server::get_rfc_answer ( void )/*{{{*/ { // get answer string... search for last line, then search for %%%- like rfc answers... // the last line is without the -, so return if found mstring answer; mstring temp; mstring last; int nocount = 0; // counts number of empty answers // TODO what if we are disconnected ? while ( sock.Connected() ) { temp = sock.Receive(10000,recv_timeout); answer += temp; if ( answer.length() < 4 ) { nocount++; if ( nocount > 5 ) { sock.Disconnect(); } continue; } while ( temp.lsearch("\n") > 0 ) { last = temp; temp = temp.substring(temp.lsearch("\n",0)+1,0); } if ( last.lsearch("-") != 4 ) { break; } } return answer; }/*}}}*/ mstring scanner_server::get_next_line ( mfile& datei)/*{{{*/ { mstring line; int rpos; line = datei.ReadLine().strip_whitespaces(); rpos = line.lsearch("#"); if (rpos == 1) return mstring(""); line = line.substring(1,rpos-1); return line.strip_whitespaces(); }/*}}}*/ /** *$Log: scanner_server.cpp,v $ *Revision 1.9.2.1 2002/10/31 22:32:23 plasmahh *fix mstring class ;) * *Revision 1.9 2002/10/21 08:38:29 plasmahh *begin cleanup and structure changes for smtpmap 0.8-stable * *Revision 1.8 2002/10/01 20:59:02 plasmahh *some new structures, to maintain multiple protocols bette * *Revision 1.7 2002/08/12 13:13:05 plasmahh *removed some memory leaks * *Revision 1.6 2002/08/08 22:13:46 plasmahh *fixed bug with really fast connecting * *Revision 1.5 2002/08/08 21:57:57 plasmahh *DEBUG !!! * *Revision 1.4 2002/08/08 21:47:28 plasmahh *more debug * *Revision 1.3 2002/06/18 13:42:39 plasmahh *fixed timeout behaviour *new fingerprints added *improved documentation * *Revision 1.2 2002/06/17 20:41:10 plasmahh *fixed little bug * *Revision 1.1 2002/06/17 12:23:48 plasmahh *fixed timeout bugs * */