Develop and Download Open Source Software

Browse Subversion Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 20 - (hide annotations) (download) (as text)
Fri Feb 27 11:30:10 2009 UTC (15 years, 1 month ago) by hirohitohigashi
Original Path: trunk/ftp_quit.c
File MIME type: text/x-csrc
File size: 1905 byte(s)
supported active mode. 

1 hirohitohigashi 18 /*
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 ret;
42    
43     /*
44     * send QUIT command
45     */
46 hirohitohigashi 20 if( ftp_send_command( ftp, str1 ) < 0 ) {
47 hirohitohigashi 18 DEBUGPRINT1( "quit: command sending error. %s\n", str1 );
48     return -1;
49     }
50    
51     if( (ret = ftp_receive_response( ftp, 0, 0 )) != 221 ) { /* 221: Service closing control connection. */
52     DEBUGPRINT1( "quit: command response error. %d\n", ret );
53     return -2;
54     }
55    
56     return 0;
57     }

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