"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/h323filetransfer.cxx" between
h323plus-1_27_0.tar.gz and h323plus-1_27_1.tar.gz

About: H.323 Plus offers libraries for voice (VoIP) and videoconferencing using H.323.

h323filetransfer.cxx  (h323plus-1_27_0):h323filetransfer.cxx  (h323plus-1_27_1)
skipping to change at line 92 skipping to change at line 92
if (paramBlockSize[i].identifier == size) if (paramBlockSize[i].identifier == size)
return paramBlockSize[i].blocksize; return paramBlockSize[i].blocksize;
} }
return 16; return 16;
} }
H323FileTransferCapability::H323FileTransferCapability() H323FileTransferCapability::H323FileTransferCapability()
: H323DataCapability(132000), m_blockOctets(4096) : H323DataCapability(132000), m_blockOctets(4096)
{ {
m_blockSize = SetParameterBlockSize(m_blockOctets); // parameter block size m_blockSize = SetParameterBlockSize(m_blockOctets); // parameter block size
m_transferMode = 1; // Transfer mode is RTP encaptulated m_transferMode = 1; // Transfer mode is RTP encapsulated
} }
H323FileTransferCapability::H323FileTransferCapability(unsigned maxBitRate, unsi gned maxBlockSize) H323FileTransferCapability::H323FileTransferCapability(unsigned maxBitRate, unsi gned maxBlockSize)
: H323DataCapability(maxBitRate), m_blockOctets(maxBlockSize) : H323DataCapability(maxBitRate), m_blockOctets(maxBlockSize)
{ {
m_blockSize = SetParameterBlockSize(m_blockOctets); // parameter block size m_blockSize = SetParameterBlockSize(m_blockOctets); // parameter block size
m_transferMode = 1; // Transfer mode is RTP encaptulated m_transferMode = 1; // Transfer mode is RTP encapsulated
} }
PBoolean H323FileTransferCapability::OnReceivedPDU(const H245_DataApplicationCap ability & pdu) PBoolean H323FileTransferCapability::OnReceivedPDU(const H245_DataApplicationCap ability & pdu)
{ {
if (pdu.m_application.GetTag() != H245_DataApplicationCapability_application:: e_genericDataCapability) if (pdu.m_application.GetTag() != H245_DataApplicationCapability_application:: e_genericDataCapability)
return FALSE; return FALSE;
//maxBitRate = pdu.m_maxBitRate*100; //maxBitRate = pdu.m_maxBitRate*100;
const H245_GenericCapability & genCapability = (const H245_GenericCapability & )pdu.m_application; const H245_GenericCapability & genCapability = (const H245_GenericCapability & )pdu.m_application;
return OnReceivedPDU(genCapability); return OnReceivedPDU(genCapability);
skipping to change at line 1321 skipping to change at line 1321
if (packet.GetSize() == 0) if (packet.GetSize() == 0)
continue; continue;
#if PTRACING #if PTRACING
PTRACE(5,"FT\t" << DataPacketAnalysis(false,packet,final)); PTRACE(5,"FT\t" << DataPacketAnalysis(false,packet,final));
#endif #endif
int ptype = packet.GetPacketType(); int ptype = packet.GetPacketType();
if (ptype == H323FilePacket::e_ERROR) { if (ptype == H323FilePacket::e_ERROR) {
int errCode; int errCode = 0;
PString errString; PString errString;
packet.GetErrorInformation(errCode,errString); packet.GetErrorInformation(errCode, errString);
if (errCode > 0) { if (errCode > 0) {
OnError(errString); OnError(errString);
ChangeState(e_completed); ChangeState(e_completed);
OnTransferComplete(master); OnTransferComplete(master);
nextFrame.Signal(); nextFrame.Signal();
} }
} }
switch (currentState) { switch (currentState) {
case e_probing: case e_probing:
skipping to change at line 1347 skipping to change at line 1347
case e_connect: case e_connect:
// Do nothing // Do nothing
break; break;
case e_waiting: case e_waiting:
if (ptype == H323FilePacket::e_WRQ) { if (ptype == H323FilePacket::e_WRQ) {
p = filelist.GetSaveDirectory() + PDIR_SEPARATOR + packet.Get FileName(); p = filelist.GetSaveDirectory() + PDIR_SEPARATOR + packet.Get FileName();
curFileName = packet.GetFileName(); curFileName = packet.GetFileName();
curFileSize = packet.GetFileSize(); curFileSize = packet.GetFileSize();
curBlockSize = packet.GetBlockSize(); curBlockSize = packet.GetBlockSize();
delete curFile; delete curFile;
curFile = new H323FileIOChannel(p,FALSE); curFile = new H323FileIOChannel(p, FALSE);
if (curFile->IsError(ioerr)) { if (curFile->IsError(ioerr)) {
OnFileOpenError(p,ioerr); OnFileOpenError(p,ioerr);
ChangeState(e_error); ChangeState(e_error);
break; break;
} }
SetBlockState(recReady); SetBlockState(recReady);
ChangeState(e_receiving); ChangeState(e_receiving);
OnFileStart(p, curFileSize,FALSE); // Notify to start receiv e OnFileStart(p, curFileSize,FALSE); // Notify to start receiv e
shutdownTimer.SetInterval(0); shutdownTimer.SetInterval(0);
} else if (ptype == H323FilePacket::e_RRQ) { } else if (ptype == H323FilePacket::e_RRQ) {
skipping to change at line 1412 skipping to change at line 1412
if (ptype == H323FilePacket::e_DATA) { if (ptype == H323FilePacket::e_DATA) {
PBoolean OKtoWrite = FALSE; PBoolean OKtoWrite = FALSE;
int blockNo = 0; int blockNo = 0;
if ((packet.GetDataSize() == blockSize) || // We have comple te block if ((packet.GetDataSize() == blockSize) || // We have comple te block
(curFileSize == (curProgSize + packet.GetDataSize()))) { // We have the last block (curFileSize == (curProgSize + packet.GetDataSize()))) { // We have the last block
if (packet.GetBlockNo() > lastBlockNo) { // Make sure we have not already received this block if (packet.GetBlockNo() > lastBlockNo) { // Make sure we have not already received this block
if (packet.GetBlockNo() != lastBlockNo + 1) { if (packet.GetBlockNo() != lastBlockNo + 1) {
// This is not the next block request to resend. We are in trouble if we are here! // This is not the next block request to resend. We are in trouble if we are here!
SetBlockState(recIncomplete); SetBlockState(recIncomplete);
OnFileError(curFileName,lastBlockNo, FALSE); OnFileError(curFileName, lastBlockNo, FALSE);
packet.SetSize(0); packet.SetSize(0);
nextFrame.Signal(); nextFrame.Signal();
break; break;
} }
lastBlockNo = packet.GetBlockNo(); lastBlockNo = packet.GetBlockNo();
curProgSize = curProgSize + packet.GetDataSize(); curProgSize = curProgSize + packet.GetDataSize();
blockNo = lastBlockNo; blockNo = lastBlockNo;
OKtoWrite = TRUE; OKtoWrite = TRUE;
} }
SetBlockState(recOK); SetBlockState(recOK);
} else { } else {
SetBlockState(recIncomplete); SetBlockState(recIncomplete);
OnFileError(curFileName,lastBlockNo, FALSE); OnFileError(curFileName, lastBlockNo, FALSE);
} }
// Now write away block to file. // Now write away block to file.
if (OKtoWrite) { if (OKtoWrite) {
curFile->Write(packet.GetDataPtr(),packet.GetDataSize()) ; curFile->Write(packet.GetDataPtr(),packet.GetDataSize()) ;
OnFileProgress(curFileName,blockNo,curProgSize, FALSE); OnFileProgress(curFileName, blockNo, curProgSize, FALSE) ;
} }
// Signal to send confirmation // Signal to send confirmation
nextFrame.Signal(); nextFrame.Signal();
} }
packet.SetSize(0); packet.SetSize(0);
break; break;
case e_sending: case e_sending:
if (ptype == H323FilePacket::e_ACK) { if (ptype == H323FilePacket::e_ACK) {
if (packet.GetACKBlockNo() == 0) // Control ACKs = 0 so ign ore. if (packet.GetACKBlockNo() == 0) // Control ACKs = 0 so ign ore.
continue; continue;
if (packet.GetACKBlockNo() == lastBlockNo) { if (packet.GetACKBlockNo() == lastBlockNo) {
curProgSize = curProgSize + lastBlockSize; curProgSize = curProgSize + lastBlockSize;
OnFileProgress(curFileName,lastBlockNo,curProgSize, TRUE ); OnFileProgress(curFileName, lastBlockNo, curProgSize, TR UE);
SetBlockState(recOK); SetBlockState(recOK);
} else { } else {
PTRACE(6,"FT\tExpecting block " << lastBlockNo << " Rece ived " << packet.GetACKBlockNo()); PTRACE(6,"FT\tExpecting block " << lastBlockNo << " Rece ived " << packet.GetACKBlockNo());
} }
} else if (ptype == H323FilePacket::e_ERROR) { } else if (ptype == H323FilePacket::e_ERROR) {
OnFileError(curFileName,lastBlockNo, TRUE); OnFileError(curFileName,lastBlockNo, TRUE);
SetBlockState(recIncomplete); SetBlockState(recIncomplete);
} }
nextFrame.Signal(); nextFrame.Signal();
break; break;
 End of changes. 9 change blocks. 
9 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)