Changeset 9846 in ntrip
- Timestamp:
- Oct 4, 2022, 12:52:39 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
r9843 r9846 278 278 return; 279 279 } 280 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);281 282 int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch283 if (iEpoEnd == -1) {284 emit(newMessage(285 "bncRtnetUploadCaster: no EOE found " + _casterID.toLatin1(), false));286 return;287 }288 else {289 lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);290 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);291 }292 293 if (lines.size() < 2) {294 emit(newMessage(295 "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1(), false));296 return;297 }298 299 // Keep the last unfinished line in buffer300 // ---------------------------------------301 int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n');302 if (iLastEOL != -1) {303 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1);304 emit(newMessage(305 "bncRtnetUploadCaster: keep the last unfinished line in buffer " + _casterID.toLatin1(), false));306 }307 308 309 /* Append to internal buffer310 // -------------------------311 _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));312 313 // Select buffer part that contains last epoch314 // -------------------------------------------315 QStringList lines;316 int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch317 if (iEpoBeg == -1) {318 _rtnetStreamBuffer.clear();319 emit(newMessage(320 "bncRtnetUploadCaster: no Epoch line found " + _casterID.toLatin1(), false));321 return;322 }323 280 324 281 int iEpoBegEarlier = _rtnetStreamBuffer.indexOf('*'); … … 339 296 340 297 while (_rtnetStreamBuffer.count('*') > 1) { // is there more than 1 epoch line in buffer? 298 emit(newMessage( 299 "bncRtnetUploadCaster: more than 1 epoch line in buffer " + _rtnetStreamBuffer.count('*'), false)); 341 300 QString rtnetStreamBuffer = _rtnetStreamBuffer.mid(1); 342 301 int nextEpoch = rtnetStreamBuffer.indexOf('*'); … … 358 317 return; 359 318 } 360 */ 319 361 320 // Read first line (with epoch time) 362 321 // ---------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.