Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/ftp_site.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by hirohitohigashi, Fri Feb 27 14:32:54 2009 UTC revision 29 by hirohitohigashi, Sat Feb 28 12:48:31 2009 UTC
# Line 38  Line 38 
38  int ftp_site( LIBOFTP *ftp, const char *cmdline )  int ftp_site( LIBOFTP *ftp, const char *cmdline )
39  {  {
40      char str1[512];      char str1[512];
41      int ret;      int res;
42    
43      /*      /*
44       * send SITE command       * send SITE command
# Line 46  int ftp_site( LIBOFTP *ftp, const char * Line 46  int ftp_site( LIBOFTP *ftp, const char *
46      snprintf( str1, sizeof(str1)-1, "SITE %s\r\n", cmdline );      snprintf( str1, sizeof(str1)-1, "SITE %s\r\n", cmdline );
47      if( ftp_send_command( ftp, str1 ) < 0 ) {      if( ftp_send_command( ftp, str1 ) < 0 ) {
48          DEBUGPRINT1( "site: command sending error. %s\n", str1 );          DEBUGPRINT1( "site: command sending error. %s\n", str1 );
49          return -1;          return LIBOFTP_ERROR_OS;
50      }      }
51    
52      if( (ret = ftp_receive_response( ftp, str1, sizeof(str1) )) != 200 ) {      /* 200: Command okay. */      res = ftp_receive_response( ftp, ftp->error_message, sizeof(ftp->error_message)-1 );
53          DEBUGPRINT1( "site: command response error. %d\n", ret );      if( res != 200 ) {                                          /* 200: Command okay. */
54          return -2;          DEBUGPRINT1( "command response error. %d\n", res );
55            return res < 0? res: LIBOFTP_ERROR_PROTOCOL;
56      }      }
57    
58      return 0;      return LIBOFTP_NOERROR;
59  }  }

Legend:
Removed from v.23  
changed lines
  Added in v.29

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26