In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the source code to analyze FileZilla, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
FileZilla is a fast and reliable FTP client and server-side open source program with a variety of features and intuitive interfaces. This article will give you an analysis of the FileZilla source code.
FileZilla is an open source FTP server written in C++. Through the analysis of its source code, you can master C++ network programming and the design of a highly concurrent server.
FileZilla is a project on http://sourceforge.net, and the home page is http://sourceforge.net/projects/filezilla. The version we want to study is: FileZilla Server 099.18. In fact, FileZilla also includes client software.
Install after download, choose to install source during installation, that is, install the source code.
After the installation is completed, you can directly open the FileZilla server.sln that comes with the project. This is the vs 2003.net project, which contains three project.
FZS Interface: this is the setting and monitoring interface of the FTP server
Service: this is the core FTP server part
GFtp: I can't open it. I don't know what it's for, but foreigners can be so careless.
Direct compilation is error-prone, mainly because FileZilla relies on two third-party packages: zlib (compression algorithm package) and regexp (regular expression package)
Finish zlib first, download http://www.winimage.com/zLibDll/zlib123.zip
Unlock it, generate the directory zlib123, and open zlib123\ projects\ visualc6\ zlib.dsw with .net 2003.
Open build | configuration Manager, set the active solution configuration to: DLL Release, compile and generate the project zlib, and generate zlib1.lib and zlib1.dll in the directory Win32_DLL_Release after success
Then, regexp uses the boost third-party package, which has many common C++ components, download address:
Http://internap.dl.sourceforge.net/sourceforge/boost/boost_1_33_1.zip
After unraveling, under cmd
* * step: need to compile bjm, which is the compiler for compiling boost.
Cd boost_1_33_1\ tools\ build\ jam_src
Build.bat
In the current bin.ntx86 directory, the bjam.exe file is generated.
Step 2: compile boost
Cd boost_1_33_1
Copy the bjam.exe you just generated.
Set VC7_ROOT= "C:\ Program Files\ Microsoft Visual Studio.NET 2003\ Vc7"
Bjam "- sTOOLS=vc7" install
This step took a long time, and at that time we only used the regexp package inside, so we should be able to compile only this package, but I didn't study it in detail.
After the compilation is completed, the boost directory is generated under the root directory of the C disk, which will be used by the .net project under this directory.
In the. Net project, tools | options | Project | VC++ directory, add
Executable file: zlib123\ projects\ visualc6\ Win32_DLL_Release
Include files: zlib123 directory and c:\ Boost\ include\ boost-1_33_1
Library files: zlib123\ projects\ visualc6\ Win32_DLL_Release and c:\ Boost\ lib
At this point, the FZS Interface project should be able to compile successfully, and after compilation, FileZilla Server Interface.exe will be generated in the Debug directory.
When you generate a Service project, you need to adjust the project settings:
Language setting: open the project property page and configure the properties | General, select the character set as "use Unicode character set", otherwise there will be errors in compilation. Unicode must use the
Link settings: open the project property page, configure properties | linker, change the input zlib.lib to zlib1.lib (because the zlib123 project generates zlib1.lib)
Let's generate it. It should be all right. The "FileZilla Server FTP server" service is installed automatically when the Service generation project is completed, or you can install the service manually:
Cd FileZilla_Server\ Debug
"FileZilla server.exe" install auto
You can try the FTP server, run FileZilla_Server\ interface\ Debug\ FileZilla Server Interface.exe, which is the configuration monitor of the FTP server, try to add a few user, set up home dir, and then try to connect with the FTP client.
The above is how to use the source code to analyze FileZilla, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.