Hello<br><br>In RTSPClient <br><br>line 1312 void RTSPClient::incomingDataHandler1() {<br>line 1313 struct sockaddr_in dummy; // 'from' address - not used<br>line 1314<br>line 1315 int bytesRead = readSocket(envir(), fInputSocketNum, (unsigned char*)&fResponseBuffer[fResponseBytesAlreadySeen], <font style="color:rgb(255,0,0)" size="4">fResponseBufferBytesLeft</font>, dummy);<br>
line 1316 handleResponseBytes(bytesRead);<br>line 1317 }<br><br><br>line 1338 void RTSPClient::handleResponseBytes(int newBytesRead) {<br>line 1339 do {<br>line 1340 if (newBytesRead > 0 && (unsigned)newBytesRead < fResponseBufferBytesLeft) break; // data was read OK; process it below<br>
line 1341<br>line 1342 if (newBytesRead >= (int)fResponseBufferBytesLeft) {<br>line 1343 // We filled up our response buffer. Treat this as an error (for the first response handler):<br>line 1344 envir().setResultMsg("RTSP response was truncated. Increase \"RTSPClient::responseBufferSize\"");<br>
line 1345 }<br>...<br>line 1370 fResponseBuffer[fResponseBytesAlreadySeen] = '\0';<br><br>In line 1340, You expect newBytesRead < fResponseBufferBytesLeft, but it's possible newBytesRead == fResponseBufferBytesLeft.<br>
Though you expectd to increase responseBufferSize to contain network date, but it cann't avoid it.In some scenario it's still happen, especially in RTP over RTSP.<br><br>Would you mind to change function RTSPClient::incomingDataHandler1, line 1315 <font style="color:rgb(255,0,0)" size="4"><font><span style="color:rgb(51,0,51)">as the following:</span></font><br>
</font> int bytesRead = readSocket(envir(), fInputSocketNum, (unsigned char*)&fResponseBuffer[fResponseBytesAlreadySeen], <font style="color:rgb(255,0,0)" size="4">fResponseBufferBytesLeft</font><font style="color:rgb(255,0,0)" size="4"> - 1</font>, dummy);<br>
At this time, codes between line 1339-1366 maybe useless.<br><br>I don't think it can be avoid this problem at its root by change the value of TSPClient::responseBufferSize.<br><br>How do you think ?<br><br>Br<br><br>
Shiyong Zhang<br>