Develop and Download Open Source Software

Browse Subversion Repository

Contents of /tags/REL-2.2/ftp_quit.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (show annotations) (download) (as text)
Sat Feb 28 13:03:02 2009 UTC (15 years, 1 month ago) by hirohitohigashi
Original Path: trunk/ftp_quit.c
File MIME type: text/x-csrc
File size: 1985 byte(s)
revised comments.

1 /*
2 liboftp: this is an FTP library to simplify the work to a Developer
3 who want to work with FTP servers (RFC 959).
4
5 Copyright (c) 2009 hirohito higashi. All rights reserved.
6 This file is distributed under BSD license.
7 */
8
9
10 /***** Feature test switches ************************************************/
11 /***** System headers *******************************************************/
12 #include <stdio.h>
13 #include <string.h>
14
15
16 /***** Local headers ********************************************************/
17 #include "liboftp.h"
18 #include "sub.h"
19
20
21 /***** Constat values *******************************************************/
22 /***** Macros ***************************************************************/
23 /***** Typedefs *************************************************************/
24 /***** Function prototypes **************************************************/
25 /***** Local variables ******************************************************/
26 /***** Global variables *****************************************************/
27 /***** Signal catching functions ********************************************/
28 /***** Local functions ******************************************************/
29 /***** Global functions *****************************************************/
30
31 /****************************************************************************/
32 /*! QUIT������������
33 *
34 *@param ftp LIBOFTP���������������������
35 *@retval int ������������������
36 *@note
37 */
38 int ftp_quit( LIBOFTP *ftp )
39 {
40 char str1[] = "QUIT\r\n";
41 int res;
42
43 /*
44 * send QUIT command
45 */
46 if( ftp_send_command( ftp, str1 ) < 0 ) {
47 DEBUGPRINT1( "command sending error. %s\n", str1 );
48 return LIBOFTP_ERROR_OS;
49 }
50
51 res = ftp_receive_response( ftp, ftp->error_message, sizeof(ftp->error_message)-1 );
52 if( res != 221 ) { /* 221: Service closing control connection. */
53 DEBUGPRINT1( "command response error. %d\n", res );
54 return res < 0? res: LIBOFTP_ERROR_PROTOCOL;
55 }
56
57 return 0;
58 }

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