comparison lib/rfc959.c @ 286:de030cbd432c

2003-10-12 Brian Masney <masneyb@gftp.org> * lib/rfc959.c - when logging in to the server, if a 5xx code is returned, don't attempt to log in again.
author masneyb
date Mon, 13 Oct 2003 00:50:06 +0000
parents 3bc63e3dbe12
children c8627e70adb5
comparison
equal deleted inserted replaced
285:470759f49ba2 286:de030cbd432c
478 tempstr = g_strconcat ("USER ", request->username, "\r\n", NULL); 478 tempstr = g_strconcat ("USER ", request->username, "\r\n", NULL);
479 resp = rfc959_send_command (request, tempstr); 479 resp = rfc959_send_command (request, tempstr);
480 g_free (tempstr); 480 g_free (tempstr);
481 if (resp < 0) 481 if (resp < 0)
482 return (GFTP_ERETRYABLE); 482 return (GFTP_ERETRYABLE);
483
483 if (resp == '3') 484 if (resp == '3')
484 { 485 {
485 tempstr = g_strconcat ("PASS ", request->password, "\r\n", NULL); 486 tempstr = g_strconcat ("PASS ", request->password, "\r\n", NULL);
486 resp = rfc959_send_command (request, tempstr); 487 resp = rfc959_send_command (request, tempstr);
487 g_free (tempstr); 488 g_free (tempstr);
488 if (resp < 0) 489 if (resp < 0)
489 return (GFTP_ERETRYABLE); 490 return (GFTP_ERETRYABLE);
490 } 491 }
492
491 if (resp == '3' && request->account) 493 if (resp == '3' && request->account)
492 { 494 {
493 tempstr = g_strconcat ("ACCT ", request->account, "\r\n", NULL); 495 tempstr = g_strconcat ("ACCT ", request->account, "\r\n", NULL);
494 resp = rfc959_send_command (request, tempstr); 496 resp = rfc959_send_command (request, tempstr);
495 g_free (tempstr); 497 g_free (tempstr);
499 } 501 }
500 502
501 if (resp != '2') 503 if (resp != '2')
502 { 504 {
503 gftp_disconnect (request); 505 gftp_disconnect (request);
504 return (GFTP_ERETRYABLE); 506
507 if (resp == '5')
508 return (GFTP_EFATAL);
509 else
510 return (GFTP_ERETRYABLE);
505 } 511 }
506 512
507 if ((ret = rfc959_syst (request)) < 0 && request->datafd < 0) 513 if ((ret = rfc959_syst (request)) < 0 && request->datafd < 0)
508 return (ret); 514 return (ret);
509 515