FileZillaIt is a fast and reliable FTP client and server-side open source code program with a variety of features and intuitive interfaces. This article analyzes the source code of FileZilla.
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 is a project on the http://sourceforge.net and the home page is http://sourceforge.net/projects/filezilla. the article 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, download http://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.
Through the complete description in this article, you should know the source code of FileZilla and hope to help you!
- FileZilla
- FileZilla: free server software
- New Version FileZilla 3.3.1.0 bug fixes
- Key Vulnerability in FileZilla FTP client hard-coded password Index
- FileZilla Server