SetTransferMode Sets the data transfer mode in which data is to be transferred via the data connection. The mode defines the data format during transfer including EOR and EOF. The transfer modes defined in FTP are as described below in the param section Params type 0 -:stream "The data is transmitted as a stream of bytes. There is no
| 1699 | UTE_PARAMETER_INVALID_VALUE - invalid type |
| 1700 | ****************************************/ |
| 1701 | int CUT_FTPClient::SetTransferMode(int mode){ |
| 1702 | |
| 1703 | int rt; |
| 1704 | |
| 1705 | //check for a valid range |
| 1706 | if(mode <0 || mode >3) |
| 1707 | return OnError(UTE_PARAMETER_INVALID_VALUE); |
| 1708 | |
| 1709 | //send the mode info |
| 1710 | if(mode ==0) //stream |
| 1711 | Send("MODE S\r\n"); |
| 1712 | else if(mode ==1) //block |
| 1713 | Send("MODE B\r\n"); |
| 1714 | else if(mode ==2) //compressed |
| 1715 | Send("MODE C\r\n"); |
| 1716 | |
| 1717 | //check for a return of 2?? |
| 1718 | rt = GetResponseCode(this); |
| 1719 | if(rt == 0) |
| 1720 | return OnError(UTE_NO_RESPONSE); //no response |
| 1721 | |
| 1722 | else if(rt >=200 && rt <=299) { |
| 1723 | m_nTransferMode = mode; |
| 1724 | return OnError(UTE_SUCCESS); |
| 1725 | } |
| 1726 | |
| 1727 | return OnError(UTE_SVR_REQUEST_DENIED); |
| 1728 | } |
| 1729 | /*************************************** |
| 1730 | GetTransferMode |
| 1731 | Gets the data transfer mode in which data is |
nothing calls this directly
no outgoing calls
no test coverage detected