MCPcopy Create free account
hub / github.com/SmingHub/Sming / cmdPort

Method cmdPort

Sming/Components/Network/src/Network/Ftp/FtpServerConnection.cpp:130–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void 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
150IFS::FileSystem* FtpServerConnection::getFileSystem()
151{

Callers

nothing calls this directly

Calls 6

getSplitterPosFunction · 0.85
substringMethod · 0.45
replaceMethod · 0.45
toIntMethod · 0.45
c_strMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected