MCPcopy Create free account
hub / github.com/HASwitchPlate/openHASP / processCommand

Method processCommand

lib/SimpleFTPServer/FtpServer.cpp:289–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289bool FtpServer::processCommand()
290{
291 ///////////////////////////////////////
292 // //
293 // AUTHENTICATION COMMANDS //
294 // //
295 ///////////////////////////////////////
296
297 // RoSchmi added the next two lines
298 DEBUG_PRINT("Command is: ");
299 DEBUG_PRINTLN(command);
300
301 //
302 // USER - User Identity
303 //
304 if(CommandIs("USER")) {
305 if(!strcmp(parameter, user)) {
306 client.println(F("331 Ok. Password required"));
307 strcpy(cwdName, "/");
308 cmdStage = FTP_Pass;
309 } else {
310 client.println(F("530 "));
311 cmdStage = FTP_Stop;
312 }
313 }
314 //
315 // PASS - Password
316 //
317 else if(CommandIs("PASS")) {
318 if(cmdStage != FTP_Pass) {
319 client.println(F("503 "));
320 cmdStage = FTP_Stop;
321 } else if(!strcmp(parameter, pass)) {
322 DEBUG_PRINTLN(F(" Authentication Ok. Waiting for commands."));
323
324 client.println(F("230 Ok"));
325 cmdStage = FTP_Cmd;
326 } else if(!strcmp("anonymous", user)) {
327 DEBUG_PRINTLN(F(" Anonymous login. Waiting for commands."));
328
329 client.println(F("230 Ok"));
330 cmdStage = FTP_Cmd;
331 } else {
332 client.println(F("530 "));
333 cmdStage = FTP_Stop;
334 }
335 }
336 //
337 // FEAT - New Features
338 //
339 else if(CommandIs("FEAT")) {
340 client.println(F("211-Extensions suported:"));
341 client.println(F(" MLST type*;modify*;size*;"));
342 client.println(F(" MLSD"));
343 client.println(F(" MDTM"));
344 client.println(F(" MFMT"));
345 client.println(F(" SIZE"));
346 client.println(F(" SITE FREE"));

Callers

nothing calls this directly

Calls 2

printMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected