| 128 | } |
| 129 | |
| 130 | void FtpServerConnection::cmdPort(const String& data) |
| 131 | { |
| 132 | int last = getSplitterPos(data, ',', 4); |
| 133 | if(last < 0) { |
| 134 | response(550); // Invalid arguments |
| 135 | //return; |
| 136 | } |
| 137 | int ipEnd = getSplitterPos(data, ',', 3); |
| 138 | String sip = data.substring(0, ipEnd); |
| 139 | sip.replace(',', '.'); |
| 140 | ip = sip; |
| 141 | String ps1 = data.substring(ipEnd + 1, last); |
| 142 | String ps2 = data.substring(last + 1); |
| 143 | int p1 = ps1.toInt(); |
| 144 | int p2 = ps2.toInt(); |
| 145 | port = (p1 << 8) | p2; |
| 146 | debug_d("connection to: %s, %d", ip.toString().c_str(), port); |
| 147 | response(200); |
| 148 | } |
| 149 | |
| 150 | IFS::FileSystem* FtpServerConnection::getFileSystem() |
| 151 | { |