PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > FTP 221 reply for USER cmd
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

FTP 221 reply for USER cmd

Réponse
 
LinkBack Outils de la discussion
Vieux 22/03/2006, 11h40   #1
deepthi.kallahakalla@lntinfotech.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut FTP 221 reply for USER cmd

Hi All,

We have written a FTP client code. using which we are trying to
ftp to a server and transfer a file.
First i am connecting to the server, by creating a new socket, then
making it a reusable socket then connect using default FTP port.
I am able to connect to the FTP server, and i get a reply "220 moon
FTP server (SunOS 5.8) ready."

Then i try to authenticate by sending USER command. The command i am
sending is "USER ipbss\r\n"
To this command i am getting a reply as "221 You could at least say
goodbye."
I am not getting 331 reply.

I am not able to understand why FTP server is sending me 221 error code
instead of 331.


Here is my authenticate part of code.

strcpy(mCmd, "USER ipbss\r\n");
mObjFtpSocket.Send(mCmd, strlen(mCmd));
if (GetReply() != 331)
{
emtLog << l_ERROR <<
"CFTP::Authenticate : Authentication failed, as
error code returned is not 331..possible connection lost"
<< endl;
return false;
}

SetCommand("PASS ", Password);
mObjFtpSocket.Send(mCmd, strlen(mCmd));
if (GetReply() != LOGIN_SUCCESSFULL)
{
emtLog << l_ERROR << "get reply is not success" <<
endl;
return false;
}



here i have also added the getReply() where i wait for a response after
sending any command and extracting the reply code from the response

int CFTP::GetReply(int Flag)
{//here Flag is 0
static char Tmp[4];
int Len = 0, Index = 0;
char *p = NULL;

do
{
memset(mResult, 0, MAX_FTPRESULT_LEN);
Index = 0;
while (1)
{
Len = mObjFtpSocket.Recv(&mResult[Index], 100,
Flag);
Index += Len;
if (mResult[Index - 2] == 13 && mResult[Index -
1] == 10)
{
break;
}
}

mResult[Index - 2] = '\0';

p = strrchr(mResult, '\n');
if (p == NULL)
{
p = mResult;
}
else
{
p++;
}

if (*(p + 3) == '-')
{
continue;
}
else
{
break;
}
} while (1);

strncpy(Tmp, p, 3);
Tmp[3] = '\0';

int RetCode = atoi(Tmp);
return RetCode;
}

This FTP is working in my office. But in my clients place, its giving
me this problem.
Please let me know if any one knows what the problem may be. Any
configuration needs to be changed ??
Please let me know it is very urgent.

Regards,
Deepthi. K.V

  Réponse avec citation
Vieux 22/03/2006, 12h40   #2
Angof
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FTP 221 reply for USER cmd

I think youve got your widgets, wotsits and doodads mixed up. If you replace
the 4th line in your code with a watchamacallit you'll be fine.

What the hell is this being posted to alt.guitar for?


<deepthi.kallahakalla@lntinfotech.com> wrote in message
news:1143027617.120991.43900@u72g2000cwu.googlegro ups.com...
> Hi All,
>
> We have written a FTP client code. using which we are trying to
> ftp to a server and transfer a file.
> First i am connecting to the server, by creating a new socket, then
> making it a reusable socket then connect using default FTP port.
> I am able to connect to the FTP server, and i get a reply "220 moon
> FTP server (SunOS 5.8) ready."
>
> Then i try to authenticate by sending USER command. The command i am
> sending is "USER ipbss\r\n"
> To this command i am getting a reply as "221 You could at least say
> goodbye."
> I am not getting 331 reply.
>
> I am not able to understand why FTP server is sending me 221 error code
> instead of 331.
>
>
> Here is my authenticate part of code.
>
> strcpy(mCmd, "USER ipbss\r\n");
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != 331)
> {
> emtLog << l_ERROR <<
> "CFTP::Authenticate : Authentication failed, as
> error code returned is not 331..possible connection lost"
> << endl;
> return false;
> }
>
> SetCommand("PASS ", Password);
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != LOGIN_SUCCESSFULL)
> {
> emtLog << l_ERROR << "get reply is not success" <<
> endl;
> return false;
> }
>
>
>
> here i have also added the getReply() where i wait for a response after
> sending any command and extracting the reply code from the response
>
> int CFTP::GetReply(int Flag)
> {//here Flag is 0
> static char Tmp[4];
> int Len = 0, Index = 0;
> char *p = NULL;
>
> do
> {
> memset(mResult, 0, MAX_FTPRESULT_LEN);
> Index = 0;
> while (1)
> {
> Len = mObjFtpSocket.Recv(&mResult[Index], 100,
> Flag);
> Index += Len;
> if (mResult[Index - 2] == 13 && mResult[Index -
> 1] == 10)
> {
> break;
> }
> }
>
> mResult[Index - 2] = '\0';
>
> p = strrchr(mResult, '\n');
> if (p == NULL)
> {
> p = mResult;
> }
> else
> {
> p++;
> }
>
> if (*(p + 3) == '-')
> {
> continue;
> }
> else
> {
> break;
> }
> } while (1);
>
> strncpy(Tmp, p, 3);
> Tmp[3] = '\0';
>
> int RetCode = atoi(Tmp);
> return RetCode;
> }
>
> This FTP is working in my office. But in my clients place, its giving
> me this problem.
> Please let me know if any one knows what the problem may be. Any
> configuration needs to be changed ??
> Please let me know it is very urgent.
>
> Regards,
> Deepthi. K.V
>



  Réponse avec citation
Vieux 22/03/2006, 15h54   #3
RichCI
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FTP 221 reply for USER cmd


deepthi.kallahakalla@lntinfotech.com wrote:
> Hi All,
>
> We have written a FTP client code. using which we are trying to
> ftp to a server and transfer a file.
> First i am connecting to the server, by creating a new socket, then
> making it a reusable socket then connect using default FTP port.
> I am able to connect to the FTP server, and i get a reply "220 moon
> FTP server (SunOS 5.8) ready."
>
> Then i try to authenticate by sending USER command. The command i am
> sending is "USER ipbss\r\n"
> To this command i am getting a reply as "221 You could at least say
> goodbye."
> I am not getting 331 reply.
>
> I am not able to understand why FTP server is sending me 221 error code
> instead of 331.
>
>
> Here is my authenticate part of code.
>
> strcpy(mCmd, "USER ipbss\r\n");
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != 331)
> {
> emtLog << l_ERROR <<
> "CFTP::Authenticate : Authentication failed, as
> error code returned is not 331..possible connection lost"
> << endl;
> return false;
> }
>
> SetCommand("PASS ", Password);
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != LOGIN_SUCCESSFULL)
> {
> emtLog << l_ERROR << "get reply is not success" <<
> endl;
> return false;
> }
>
>
>
> here i have also added the getReply() where i wait for a response after
> sending any command and extracting the reply code from the response
>
> int CFTP::GetReply(int Flag)
> {//here Flag is 0
> static char Tmp[4];
> int Len = 0, Index = 0;
> char *p = NULL;
>
> do
> {
> memset(mResult, 0, MAX_FTPRESULT_LEN);
> Index = 0;
> while (1)
> {
> Len = mObjFtpSocket.Recv(&mResult[Index], 100,
> Flag);
> Index += Len;
> if (mResult[Index - 2] == 13 && mResult[Index -
> 1] == 10)
> {
> break;
> }
> }
>
> mResult[Index - 2] = '\0';
>
> p = strrchr(mResult, '\n');
> if (p == NULL)
> {
> p = mResult;
> }
> else
> {
> p++;
> }
>
> if (*(p + 3) == '-')
> {
> continue;
> }
> else
> {
> break;
> }
> } while (1);
>
> strncpy(Tmp, p, 3);
> Tmp[3] = '\0';
>
> int RetCode = atoi(Tmp);
> return RetCode;
> }
>
> This FTP is working in my office. But in my clients place, its giving
> me this problem.
> Please let me know if any one knows what the problem may be. Any
> configuration needs to be changed ??
> Please let me know it is very urgent.
>
> Regards,
> Deepthi. K.V



Digital isn't quite there yet; if you want good tone, build it with
vacuum tubes. For the RetCode, I would use a 5U4G instead of the atoi.

  Réponse avec citation
Vieux 23/03/2006, 07h32   #4
Andy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FTP 221 reply for USER cmd

deepthi.kallahakalla@lntinfotech.com wrote:
> Hi All,
>
> We have written a FTP client code. using which we are trying to
> ftp to a server and transfer a file.
> First i am connecting to the server, by creating a new socket, then
> making it a reusable socket then connect using default FTP port.
> I am able to connect to the FTP server, and i get a reply "220 moon
> FTP server (SunOS 5.8) ready."
>
> Then i try to authenticate by sending USER command. The command i am
> sending is "USER ipbss\r\n"
> To this command i am getting a reply as "221 You could at least say
> goodbye."
> I am not getting 331 reply.
>
> I am not able to understand why FTP server is sending me 221 error code
> instead of 331.
>
>
> Here is my authenticate part of code.
>
> strcpy(mCmd, "USER ipbss\r\n");
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != 331)
> {
> emtLog << l_ERROR <<
> "CFTP::Authenticate : Authentication failed, as
> error code returned is not 331..possible connection lost"
> << endl;
> return false;
> }
>
> SetCommand("PASS ", Password);
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != LOGIN_SUCCESSFULL)
> {
> emtLog << l_ERROR << "get reply is not success" <<
> endl;
> return false;
> }
>
>
>
> here i have also added the getReply() where i wait for a response after
> sending any command and extracting the reply code from the response
>
> int CFTP::GetReply(int Flag)
> {//here Flag is 0
> static char Tmp[4];
> int Len = 0, Index = 0;
> char *p = NULL;
>
> do
> {
> memset(mResult, 0, MAX_FTPRESULT_LEN);
> Index = 0;
> while (1)
> {
> Len = mObjFtpSocket.Recv(&mResult[Index], 100,
> Flag);
> Index += Len;
> if (mResult[Index - 2] == 13 && mResult[Index -
> 1] == 10)
> {
> break;
> }
> }
>
> mResult[Index - 2] = '\0';
>
> p = strrchr(mResult, '\n');
> if (p == NULL)
> {
> p = mResult;
> }
> else
> {
> p++;
> }
>
> if (*(p + 3) == '-')
> {
> continue;
> }
> else
> {
> break;
> }
> } while (1);
>
> strncpy(Tmp, p, 3);
> Tmp[3] = '\0';
>
> int RetCode = atoi(Tmp);
> return RetCode;
> }
>
> This FTP is working in my office. But in my clients place, its giving
> me this problem.
> Please let me know if any one knows what the problem may be. Any
> configuration needs to be changed ??
> Please let me know it is very urgent.
>
> Regards,
> Deepthi. K.V
>


I would suggest that before delving into writing FTP client code, that
you learn the basics like:

turning your computer on and off

Microsoft office basics

Windows for dummies

and...

*how to use a newsreader client*.

HTH,

Andy.

  Réponse avec citation
Vieux 23/03/2006, 09h32   #5
deepthi.kallahakalla@lntinfotech.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FTP 221 reply for USER cmd

If you can answer to the question....reply...
dont wate your time writting some rubbish...
No one is great in this world...

  Réponse avec citation
Vieux 23/03/2006, 13h15   #6
briggs@encompasserve.org
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FTP 221 reply for USER cmd

In article <1143104544.647365.272670@i40g2000cwc.googlegroups .com>, "deepthi.kallahakalla@lntinfotech.com" <deepthi.kallahakalla@lntinfotech.com> writes:
> If you can answer to the question....reply...
> dont wate your time writting some rubbish...
> No one is great in this world...


Rule of thumb...

If you ask for free advice about a TCP/IP problem and accidentally
cross-post to alt.guitar, you'll probably get better results by
apologizing for your error rather than by sending a complaint that
the folks on alt.guitar will never see.

If it were me, I'd be thinking about getting a packet capture so that
I could see why the server thought a 331 response was appropriate.
And then I'd be looking at my code to see why I was generating the
output that made that response appropriate.

If you get deep enough into a problem that you're posting code for other
people to analyze, chances are the code isn't doing what you think it's
doing and it's a good idea to try to see what it actually is doing.
  Réponse avec citation
Vieux 23/03/2006, 13h24   #7
Larry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FTP 221 reply for USER cmd

I think your server needs a Neck adjustment. Try tightening the truss-rod
1/4 turn.

-Larry

<deepthi.kallahakalla@lntinfotech.com> wrote in message
news:1143027617.120991.43900@u72g2000cwu.googlegro ups.com...
> Hi All,
>
> We have written a FTP client code. using which we are trying to
> ftp to a server and transfer a file.
> First i am connecting to the server, by creating a new socket, then
> making it a reusable socket then connect using default FTP port.
> I am able to connect to the FTP server, and i get a reply "220 moon
> FTP server (SunOS 5.8) ready."
>
> Then i try to authenticate by sending USER command. The command i am
> sending is "USER ipbss\r\n"
> To this command i am getting a reply as "221 You could at least say
> goodbye."
> I am not getting 331 reply.
>
> I am not able to understand why FTP server is sending me 221 error code
> instead of 331.
>
>
> Here is my authenticate part of code.
>
> strcpy(mCmd, "USER ipbss\r\n");
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != 331)
> {
> emtLog << l_ERROR <<
> "CFTP::Authenticate : Authentication failed, as
> error code returned is not 331..possible connection lost"
> << endl;
> return false;
> }
>
> SetCommand("PASS ", Password);
> mObjFtpSocket.Send(mCmd, strlen(mCmd));
> if (GetReply() != LOGIN_SUCCESSFULL)
> {
> emtLog << l_ERROR << "get reply is not success" <<
> endl;
> return false;
> }
>
>
>
> here i have also added the getReply() where i wait for a response after
> sending any command and extracting the reply code from the response
>
> int CFTP::GetReply(int Flag)
> {//here Flag is 0
> static char Tmp[4];
> int Len = 0, Index = 0;
> char *p = NULL;
>
> do
> {
> memset(mResult, 0, MAX_FTPRESULT_LEN);
> Index = 0;
> while (1)
> {
> Len = mObjFtpSocket.Recv(&mResult[Index], 100,
> Flag);
> Index += Len;
> if (mResult[Index - 2] == 13 && mResult[Index -
> 1] == 10)
> {
> break;
> }
> }
>
> mResult[Index - 2] = '\0';
>
> p = strrchr(mResult, '\n');
> if (p == NULL)
> {
> p = mResult;
> }
> else
> {
> p++;
> }
>
> if (*(p + 3) == '-')
> {
> continue;
> }
> else
> {
> break;
> }
> } while (1);
>
> strncpy(Tmp, p, 3);
> Tmp[3] = '\0';
>
> int RetCode = atoi(Tmp);
> return RetCode;
> }
>
> This FTP is working in my office. But in my clients place, its giving
> me this problem.
> Please let me know if any one knows what the problem may be. Any
> configuration needs to be changed ??
> Please let me know it is very urgent.
>
> Regards,
> Deepthi. K.V
>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h36.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,21633 seconds with 15 queries