summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-03-19 14:42:34 (UTC)
committer korovkin <korovkin>2006-03-19 14:42:34 (UTC)
commitadbd8bde1b0b24e5ea7047dea7228451964ac23a (patch) (unidiff)
tree761e7695e2c88ae2ac40d9b4e4adeff7d931cddc
parent3b671ecea335b81c65ec03ad70fa3f25e9bb0a3e (diff)
downloadopie-adbd8bde1b0b24e5ea7047dea7228451964ac23a.zip
opie-adbd8bde1b0b24e5ea7047dea7228451964ac23a.tar.gz
opie-adbd8bde1b0b24e5ea7047dea7228451964ac23a.tar.bz2
We scan ports prior to scanning names.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/parser.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/noncore/net/opietooth/lib/parser.cc b/noncore/net/opietooth/lib/parser.cc
index 7e95907..d20b9f3 100644
--- a/noncore/net/opietooth/lib/parser.cc
+++ b/noncore/net/opietooth/lib/parser.cc
@@ -155,8 +155,17 @@ bool Parser::parseProtocol( const QString& str) {
155 m_protocolAdded = false; 155 m_protocolAdded = false;
156 return true; 156 return true;
157 157
158 }else if (m_protocolOver && str.startsWith(" ") ) {
159 m_protocolAdded = true;
160 QString dummy = str.stripWhiteSpace();
161 int pos = dummy.findRev(':');
162 if ( pos > -1 ) {
163 int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt();
164 Services::ProtocolDescriptor desc( m_protName, m_protId, port );
165 m_item.insertProtocolDescriptor( desc );
166 }
167 return true;
158 }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100) 168 }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100)
159 owarn << "double protocol filter" << oendl;
160 169
161 if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now 170 if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now
162 Services::ProtocolDescriptor desc( m_protName, m_protId ); 171 Services::ProtocolDescriptor desc( m_protName, m_protId );
@@ -167,17 +176,6 @@ bool Parser::parseProtocol( const QString& str) {
167 m_protId = convert(str, m_protName ); 176 m_protId = convert(str, m_protName );
168 } 177 }
169 return true; 178 return true;
170 }else if (m_protocolOver && str.startsWith(" ") ) {
171 owarn << "tripple protocol filter" << oendl;
172 m_protocolAdded = true;
173 QString dummy = str.stripWhiteSpace();
174 int pos = dummy.findRev(':');
175 if ( pos > -1 ) {
176 int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt();
177 Services::ProtocolDescriptor desc( m_protName, m_protId, port );
178 m_item.insertProtocolDescriptor( desc );
179 }
180 return true;
181 }else if (m_protocolOver ) { 179 }else if (m_protocolOver ) {
182 m_protocolOver = false; 180 m_protocolOver = false;
183 } 181 }