Revision: 14677 Author: adrian.chadd Date: Wed May 19 20:29:09 2010 Log: Break out some more of the FTP private types into libsqftp/ .
http://code.google.com/p/lusca-cache/source/detail?r=14677 Added: /branches/LUSCA_HEAD/libsqftp/ftp_types.h Modified: /branches/LUSCA_HEAD/src/ftp.c ======================================= --- /dev/null +++ /branches/LUSCA_HEAD/libsqftp/ftp_types.h Wed May 19 20:29:09 2010 @@ -0,0 +1,59 @@ +#ifndef __LUSCA_FTPTYPES_H__ +#define __LUSCA_FTPTYPES_H__ + +#define FTP_LOGIN_ESCAPED 1 +#define FTP_LOGIN_NOT_ESCAPED 0 + +typedef enum { + BEGIN, + SENT_USER, + SENT_PASS, + SENT_TYPE, + SENT_MDTM, + SENT_SIZE, + SENT_PORT, + SENT_PASV, + SENT_CWD, + SENT_LIST, + SENT_NLST, + SENT_REST, + SENT_RETR, + SENT_STOR, + SENT_QUIT, + READING_DATA, + WRITING_DATA, + SENT_MKDIR +} ftp_state_t; + +struct _ftp_flags { + unsigned int isdir:1; + unsigned int pasv_supported:1; + unsigned int skip_whitespace:1; + unsigned int rest_supported:1; + unsigned int pasv_only:1; + unsigned int authenticated:1; + unsigned int http_header_sent:1; + unsigned int tried_nlst:1; + unsigned int use_base:1; + unsigned int dir_slash:1; + unsigned int root_dir:1; + unsigned int no_dotdot:1; + unsigned int html_header_sent:1; + unsigned int binary:1; + unsigned int try_slash_hack:1; + unsigned int put:1; + unsigned int put_mkdir:1; + unsigned int listformat_unknown:1; +}; + +typedef struct { + char type; + squid_off_t size; + char *date; + char *name; + char *showname; + char *link; +} ftpListParts; + + +#endif ======================================= --- /branches/LUSCA_HEAD/src/ftp.c Wed May 19 20:24:38 2010 +++ /branches/LUSCA_HEAD/src/ftp.c Wed May 19 20:29:09 2010 @@ -36,52 +36,11 @@ #include "squid.h" #include "../libsqftp/ftp_util.h" +#include "../libsqftp/ftp_types.h" static const char *const crlf = "\r\n"; static char cbuf[1024]; -typedef enum { - BEGIN, - SENT_USER, - SENT_PASS, - SENT_TYPE, - SENT_MDTM, - SENT_SIZE, - SENT_PORT, - SENT_PASV, - SENT_CWD, - SENT_LIST, - SENT_NLST, - SENT_REST, - SENT_RETR, - SENT_STOR, - SENT_QUIT, - READING_DATA, - WRITING_DATA, - SENT_MKDIR -} ftp_state_t; - -struct _ftp_flags { - unsigned int isdir:1; - unsigned int pasv_supported:1; - unsigned int skip_whitespace:1; - unsigned int rest_supported:1; - unsigned int pasv_only:1; - unsigned int authenticated:1; - unsigned int http_header_sent:1; - unsigned int tried_nlst:1; - unsigned int use_base:1; - unsigned int dir_slash:1; - unsigned int root_dir:1; - unsigned int no_dotdot:1; - unsigned int html_header_sent:1; - unsigned int binary:1; - unsigned int try_slash_hack:1; - unsigned int put:1; - unsigned int put_mkdir:1; - unsigned int listformat_unknown:1; -}; - typedef struct _Ftpdata { StoreEntry *entry; request_t *request; @@ -133,20 +92,8 @@ FwdState *fwd; } FtpStateData; -typedef struct { - char type; - squid_off_t size; - char *date; - char *name; - char *showname; - char *link; -} ftpListParts; - typedef void (FTPSM) (FtpStateData *); -#define FTP_LOGIN_ESCAPED 1 -#define FTP_LOGIN_NOT_ESCAPED 0 - /* Local functions */ static CNCB ftpPasvCallback; static PF ftpDataRead; -- You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en.
