MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / SetTransferStructure

Method SetTransferStructure

UTCP/src/ftp_c.cpp:1804–1831  ·  view source on GitHub ↗

SetTransferStructure Sets the data transfer structure Params type - 0:file 1:record 2:page Return UTE_SUCCESS - success UTE_NO_RESPONSE - no response UTE_SVR_REQUEST_DENIED - request denied by server UTE_PARAMETER_INVALID_VALUE - invalid type ****************************************/

Source from the content-addressed store, hash-verified

1802 UTE_PARAMETER_INVALID_VALUE - invalid type
1803****************************************/
1804int CUT_FTPClient::SetTransferStructure(int structure){
1805 int rt;
1806
1807 //check for a valid range
1808 if(structure < 0 || structure > 3)
1809 return OnError(UTE_PARAMETER_INVALID_VALUE);
1810
1811 //send the mode info
1812 if(structure ==0) //file
1813 Send("STRU F\r\n");
1814 else if(structure ==1) //record
1815 Send("STRU R\r\n");
1816 else if(structure ==2) //page
1817 Send("STRU P\r\n");
1818
1819 //check for a return of 2??
1820 rt = GetResponseCode(this);
1821
1822 if(rt == 0)
1823 return OnError(UTE_NO_RESPONSE); //no response
1824
1825 else if(rt >=200 && rt <=299) {
1826 m_nTransferStructure = structure;
1827 return OnError(UTE_SUCCESS);
1828 }
1829
1830 return OnError(UTE_SVR_REQUEST_DENIED);
1831}
1832/***************************************
1833GetTransferStructure
1834 Gets the data transfer structure

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected