MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / GetResponse

Method GetResponse

deps/FtpClient/FTPClient.cpp:1189–1216  ·  view source on GitHub ↗

This function gets the server response. A server response can exists of more than one line. This function returns the full response (multiline). @param[out] Reply Reply of the server to a command.

Source from the content-addressed store, hash-verified

1187/// returns the full response (multiline).
1188/// @param[out] Reply Reply of the server to a command.
1189bool CFTPClient::GetResponse(CReply& Reply) const
1190{
1191 tstring strResponse;
1192 if( !GetSingleResponseLine(strResponse) )
1193 return false;
1194
1195 if( strResponse.length()>3 && strResponse.at(3)==_T('-') )
1196 {
1197 tstring strSingleLine(strResponse);
1198 const int iRetCode=CCnv::TStringToLong(strResponse);
1199 // handle multi-line server responses
1200 while( !(strSingleLine.length()>3 &&
1201 strSingleLine.at(3)==_T(' ') &&
1202 CCnv::TStringToLong(strSingleLine)==iRetCode) )
1203 {
1204 if( !GetSingleResponseLine(strSingleLine) )
1205 return false;
1206 strResponse += mc_strEolCharacterSequence + strSingleLine;
1207 }
1208 }
1209
1210 bool fRet = Reply.Set(strResponse);
1211
1212 for( TObserverSet::const_iterator it=m_setObserver.begin(); it!=m_setObserver.end(); it++ )
1213 (*it)->OnResponse(Reply);
1214
1215 return fRet;
1216}
1217
1218/// Reads a single response line from the server control channel.
1219/// @param[out] strResponse Response of the server as string.

Callers 1

TransferFileMethod · 0.80

Calls 5

atMethod · 0.80
SetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
OnResponseMethod · 0.45

Tested by

no test coverage detected