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 50 by hirohitohigashi, Wed Dec 2 15:13:30 2009 UTC
# Line 32  Line 32 
32   *   *
33   *@param        ftp     LIBOFTPへのポインタ。   *@param        ftp     LIBOFTPへのポインタ。
34   *@param        cmdline コマンドライン   *@param        cmdline コマンドライン
35   *@retval       int     マイナス値ならエラー   *@retval       int     エラーコード
36   *@note   *@note
37   */   */
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        if( ftp->socket < 0 ) return LIBOFTP_ERROR;
44    
45      /*      /*
46       * send SITE command       * send SITE command
# Line 46  int ftp_site( LIBOFTP *ftp, const char * Line 48  int ftp_site( LIBOFTP *ftp, const char *
48      snprintf( str1, sizeof(str1)-1, "SITE %s\r\n", cmdline );      snprintf( str1, sizeof(str1)-1, "SITE %s\r\n", cmdline );
49      if( ftp_send_command( ftp, str1 ) < 0 ) {      if( ftp_send_command( ftp, str1 ) < 0 ) {
50          DEBUGPRINT1( "site: command sending error. %s\n", str1 );          DEBUGPRINT1( "site: command sending error. %s\n", str1 );
51          return -1;          return LIBOFTP_ERROR_OS;
52      }      }
53    
54      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 );
55          DEBUGPRINT1( "site: command response error. %d\n", ret );      if( res != 200 ) {                                          /* 200: Command okay. */
56          return -2;          DEBUGPRINT1( "command response error. %d\n", res );
57            return res < 0? res: LIBOFTP_ERROR_PROTOCOL;
58      }      }
59    
60      return 0;      return LIBOFTP_NOERROR;
61  }  }

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

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