Browse Subversion Repository
Diff of /trunk/ftp_site.c
Parent Directory
| Revision Log
| Patch
| 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 |
| 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 |
|
|
| |