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 29 - (hide annotations) (download) (as text)
Sat Feb 28 12:48:31 2009 UTC (15 years, 1 month ago) by hirohitohigashi
Original Path: trunk/ftp_quit.c
File MIME type: text/x-csrc
File size: 1997 byte(s)
changed error messageing system. and added ftp_timeout() function.

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 hirohitohigashi 29 int res;
42 hirohitohigashi 18
43     /*
44     * send QUIT command
45     */
46 hirohitohigashi 20 if( ftp_send_command( ftp, str1 ) < 0 ) {
47 hirohitohigashi 29 DEBUGPRINT1( "command sending error. %s\n", str1 );
48     return LIBOFTP_ERROR_OS;
49 hirohitohigashi 18 }
50    
51 hirohitohigashi 29 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 hirohitohigashi 18 }
56    
57     return 0;
58     }

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