Filezilla FTP Server Source Code Analysis 1

Source: Internet
Author: User
Tags ftp client filezilla filezilla ftp

Filezilla is an open-source FTP server written in C ++. By analyzing its source code, you can master the design of C ++ network programming and high-concurrency servers.
Filezilla isHttp://sourceforge.netThe project on the home page isHttp://sourceforge.net/projects/filezillaThe version we want to study is: filezilla server 0_9_18. In fact, filezilla also includes client software.

After downloading and installing, select "Install source" to install the source code.

After the installation is complete, you can directly open the filezilla server. sln that comes with the project. This is the vs 2003.net Project, which contains three projects,
Fzs interface: set and monitor the FTP server.
Service: This is part of the core FTP server.
Gftp: it cannot be opened. I don't know what it is for. Will foreigners be so careless?

Directly compiling is prone to errors. filezilla depends on two third-party packages: zlib (compression algorithm package) and Regexp (Regular Expression package)

Get zlib first, downloadHttp://www.winimage.com/zLibDll/zlib123.zip
Undo it, generate the directory zlib123, and use. NET 2003 to open zlib123/projects/visualc6/zlib. DSW
Open generate | Configuration Manager, set the active solution configuration to DLL release, compile and generate the zlib project, and then generate zlib1.lib and zlib1.dll under win32_dll_release.

Then, Regexp uses the boost third-party package, which has many common C ++ components ,:
Http://internap.dl.sourceforge.net/sourceforge/boost/boost_1_33_1.zip
After unlocking, in cmd,
Step 1: Compile BJM. This is the boost compiler.
CD boost_000033_1/tools/build/jam_src
Build. bat
The bjam.exe file is generated in the current bin.ntx86directory.
Step 2: Compile boost
CD boost_000033_1
Copy the just-generated bjam.exe file.
Set vc7_root = "C:/program files/Microsoft Visual Studio. NET 2003/vc7"
Bjam "-stools = vc7" Install
This step takes a long time. At that time, we only used the Regexp package in it. We should be able to compile only this package, but I did not study it carefully.
After compilation, the boost directory is generated under the root directory of the C drive. the. NET project under this directory will be used.

In the. NET project, add
Executable File: zlib123/projects/visualc6/win32_dll_release
Contains files: zlib123 directory and C:/Boost/include/boost-1_33_1
Library File: zlib123/projects/visualc6/win32_dll_release and C:/Boost/lib

The fzs interface project can be compiled successfully. After compilation, filezilla server interface.exe is generated in the DEBUG directory.

When generating a service project, you need to adjust the Project Settings:
Language settings: Open the project properties page and configure properties | General, select "use Unicode Character Set" as the character set, otherwise Unicode must be used during compilation;
Link settings: Open the project properties page, configure properties | linker, and change zlib. lib to zlib1.lib (because zlib123 project generates zlib1.lib)
The following code is generated. When the service project is generated, the "filezilla Server FTP server" service is automatically installed. You can also manually install the service:
CD filezilla_server/debug
"Filezilla server.exe" Install auto

You can try this ftp server and run filezilla_server/interface/debug/filezilla server interface.exe. This is the configuration monitoring program of the FTP server. add several users and set home dir, try again using the FTP client.

Next, we will analyze the implementation of this server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.