Browse Subversion Repository
Diff of /trunk/ftp_put_buffer.c
Parent Directory
| Revision Log
| Patch
| 47 |
{ |
{ |
| 48 |
int data_socket; |
int data_socket; |
| 49 |
char *p = buf; |
char *p = buf; |
| 50 |
int n; |
int n, res; |
| 51 |
|
|
| 52 |
/* |
/* |
| 53 |
* 送信準備 |
* 送信準備 |
| 72 |
n = sendn( data_socket, p, len, 0 ); |
n = sendn( data_socket, p, len, 0 ); |
| 73 |
DEBUGPRINT1( "SEND: n=%d\n", n ); |
DEBUGPRINT1( "SEND: n=%d\n", n ); |
| 74 |
if( n < 0 ) { |
if( n < 0 ) { |
| 75 |
|
DEBUGPRINT1( "recv error. %s\n", strerror(errno) ); |
| 76 |
|
copy_strerror(); |
| 77 |
close( data_socket ); |
close( data_socket ); |
| 78 |
return -1; |
return LIBOFTP_ERROR_OS; |
| 79 |
} |
} |
| 80 |
|
|
| 81 |
p += n; |
p += n; |
| 89 |
/* |
/* |
| 90 |
* receive response. |
* receive response. |
| 91 |
*/ |
*/ |
| 92 |
if( ftp_receive_response( ftp, 0, 0 ) != 226 ) { /* 226: Closing data connection. */ |
res = ftp_receive_response( ftp, ftp->error_message, sizeof(ftp->error_message)-1 ); |
| 93 |
return -2; |
if( res != 226 ) { /* 226: Closing data connection. */ |
| 94 |
|
DEBUGPRINT1( "got illegal response %d\n", res ); |
| 95 |
|
return res < 0? res: LIBOFTP_ERROR_PROTOCOL; |
| 96 |
} |
} |
| 97 |
|
|
| 98 |
return 0; |
return LIBOFTP_NOERROR; |
| 99 |
} |
} |
| 100 |
|
|
| 101 |
|
|
|
|
Legend:
| Removed from v.28 |
|
| changed lines |
| |
Added in v.29 |
|
|
| |