⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csprotocol.txt

📁 Rsync 3.0.5 source code
💻 TXT
字号:
This is kind of informal and may be wrong, but it helped me.  It'sbasically a summary of clientserver.c and authenticate.c. -- Martin Pool <mbp@samba.org>This is the protocol used for rsync --daemon; i.e. connections to port873 rather than invocations over a remote shell.When the server accepts a connection, it prints a greeting  @RSYNCD: <version>.<subprotocol>where <version> is the numeric version (see PROTOCOL_VERSION in rsync.h)'.' is a literal period, and <subprotocol> is the numeric subprotocolversion (see SUBPROTOCOL_VERSION -- it will be 0 for final releases).Protocols prior to 30 only output <version> alone.  The daemon expectsto see a similar greeting back from the client.  For protocols prior to30, an absent ".<subprotocol>" value is assumed to be 0.  For protocol30, an absent value is a fatal error.  The daemon then follows this linewith a free-format text message-of-the-day (if any is defined).The server is now in the connected state.  The client can either sendthe command  #listto get a listing of modules, or the name of a module.  After this, theconnection is now bound to a particular module.  Access per host forthis module is now checked, as is per-module connection limits.If authentication is required to use this module, the server will say  @RSYNCD: AUTHREQD <challenge>where <challenge> is a random string of base64 characters.  The clientmust respond with  <user> <response>where <user> is the username they claim to be, and <response> is thebase64 form of the MD4 hash of challenge+password.At this point the server applies all remaining constraints beforehanding control to the client, including switching uid/gid, setting upinclude and exclude lists, moving to the root of the module, and doingchroot.If the login is acceptable, then the server will respond with  @RSYNCD: OKThe client now writes some rsync options, as if it were remotelyexecuting the command.  The server parses these arguments as if it hadjust been invoked with them, but they're added to the existing state.So if the client specifies a list of files to be included or excluded,they'll defer to existing limits specified in the serverconfiguration.At this point the client and server both switch to using amultiplexing layer across the socket.  The main point of this is toallow the server to asynchronously pass errors back, while stillallowing streamed and pipelined data.Unfortunately, the multiplex protocol is not used at every stage.  Westart up in plain socket mode and then change over by callingio_start_buffering.  Of course both the client and the server have todo this at the same point.The server then talks to the client as normal across the socket,passing checksums, file lists and so on.  For documentation of that,stay tuned (or write it yourself!).------------Protocol version changes30	(2007-10-04, 3.0.0pre1)	The use of a ".<subprotocol>" number was added to	@RSYNCD: <version>.<subprotocol>25	(2001-08-20, 2.4.7pre2) 	Send an explicit "@RSYNC EXIT" command at the end of the	module listing.  We never intentionally end the transmission	by just closing the socket anymore.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -