Browse Subversion Repository
Diff of /branches/RB-1.1/ftpget.c
Parent Directory
| Revision Log
| Patch
| 174 |
|
|
| 175 |
ftp_connection.sin_port = htons(data_port); |
ftp_connection.sin_port = htons(data_port); |
| 176 |
|
|
|
if ( (flags=fcntl(sock, F_GETFL,0)) < 0) { |
|
|
printf("--[ fcntl get flags error.\n"); |
|
|
exit(1); |
|
|
} |
|
|
|
|
|
flags |= O_NONBLOCK; |
|
|
|
|
|
if ( fcntl (sock, F_SETFL, flags ) < 0 ) { |
|
|
printf("--[ Non Blocking Socket Error.\n"); |
|
|
exit(1); |
|
|
} |
|
|
|
|
| 177 |
|
|
| 178 |
if ( (con_err = connect(sock, (struct sockaddr *)&ftp_connection, sizeof(struct sockaddr)) ) != 0) { |
if ( (con_err = connect(sock, (struct sockaddr *)&ftp_connection, sizeof(struct sockaddr)) ) != 0) { |
| 179 |
if (con_err == ECONNREFUSED) { |
if (con_err == ECONNREFUSED) { |
| 192 |
return -1; |
return -1; |
| 193 |
} |
} |
| 194 |
|
|
| 195 |
|
if ( (flags=fcntl(sock, F_GETFL,0)) < 0) { |
| 196 |
|
printf("--[ fcntl get flags error.\n"); |
| 197 |
|
exit(1); |
| 198 |
|
} |
| 199 |
|
|
| 200 |
|
flags |= O_NONBLOCK; |
| 201 |
|
|
| 202 |
|
if ( fcntl (sock, F_SETFL, flags ) < 0 ) { |
| 203 |
|
printf("--[ Non Blocking Socket Error.\n"); |
| 204 |
|
exit(1); |
| 205 |
|
} |
| 206 |
|
|
| 207 |
buff[4095] = '\0'; |
buff[4095] = '\0'; |
| 208 |
|
|
|
|
Legend:
| Removed from v.8 |
|
| changed lines |
| |
Added in v.9 |
|
|
| |