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

📄 protocol

📁 subversion-1.4.3-1.tar.gz 配置svn的源码
💻
📖 第 1 页 / 共 2 页
字号:
This file documents version 2 of the svn protocol.1. Syntactic structure----------------------The Subversion protocol is specified in terms of the followingsyntactic elements, specified using ABNF [RFC 2234]:  item   = word / number / string / list  word   = ALPHA *(ALPHA / DIGIT / "-") space  number = 1*DIGIT space  string = 1*DIGIT ":" *OCTET space         ; digits give the byte count of the *OCTET portion  list   = "(" space *item ")" space  space  = 1*(SP / LF)Here is an example item showing each of the syntactic elements:  ( word 22 6:string ( sublist ) )All items end with mandatory whitespace.  (In the above example, anewline provides the terminating whitespace for the outer list.)  Itis possible to parse an item without knowing its type in advance.Lists are not constrained to contain items of the same type.  Listscan be used for tuples, optional tuples, or arrays.  A tuple is a listexpected to contain a fixed number of items, generally of differingtypes.  An optional value is a list containing either zero or a fixednumber of items.  An array is a list containing zero or more items ofthe same type.Words are used for enumerated protocol values, while strings are usedfor text or binary data of interest to the Subversion client orserver.  Words are case-sensitive.For convenience, this specification will define prototypes for dataitems using a syntax like:  example: ( literal [ rev:number ] ( data:string ... ) )A simple word such as "literal", with no colon, denotes a literalword.  A choice of words may be given in braces with "|" separatingthe choices.  "name:type" specifies a parameter with the given type.A type is "word", "number", "string", "list", or the name of anotherprototype.  Brackets denote an optional tuple.  Parentheses denote atuple, unless the parentheses contain ellipses, in which case theparentheses denote an array containing zero or more elements matchingthe prototype preceding the ellipses.  If a tuple has an optional partafter the fixed part, a '?' marks places where the tuple is allowed toend.  The following tuple could contain one, three, or four or moreitems:  example: ( fixed:string ? opt1:number opt2:string ? opt3:number )For extensibility, implementations must treat a list as matching aprototype's tuple even if the list contains extra elements.  The extraelements must be ignored.In some cases, a prototype may need to match two different kinds ofdata items.  This case will be written using "|" to separate thealternatives; for example:  example: ( first-kind rev:number )         | second-kindThe "command response" prototype is used in several contexts of thisspecification to indicate the success or failure of an operation.  Itis defined as follows:  command-response: ( success params:list )                  | ( failure ( err:error ... ) )  error: ( apr-err:number message:string file:string line:number )The interpretation of parameters in a successful command response iscontext-dependent.URLs and repository paths are represented as strings.  They should be incanonical form when sent over the protocol.  However, as a matter of inputvalidation, an implementation should always canonicalize received paths if itneeds them in canonicalized form.2. Connection establishment and protocol setup----------------------------------------------By default, the client connects to the server on port 3690.Upon receiving a connection, the server sends a greeting, using acommand response whose parameters match the prototype:  greeting: ( minver:number maxver:number mechs:list ( cap:word ... ) )minver and maxver give the minimum and maximum Subversion protocolversions supported by the server.  mechs is present for historicalreasons, and is ignored by the client.  The cap values give a list ofserver capabilities (see section 2.1).If the client does not support a protocol version within the specifiedrange, it closes the connection.  Otherwise, the client responds tothe greeting with an item matching the prototype:  response: ( version:number ( cap:word ... ) url:string )version gives the protocol version selected by the client.  The capvalues give a list of client capabilities (see section 2.1).  urlgives the URL the client is accessing.Upon receiving the client's response to the greeting, the server sendsan authentication request, which is a command response whose argumentsmatch the prototype:  auth-request: ( ( mech:word ... ) realm:string )The mech values give a list of SASL mechanisms supported by theserver.  The realm string is similar to an HTTP authentication realmas defined in [RFC 2617]; it allows the server to indicate which ofseveral protection spaces the server wishes to authenticate in.  Ifthe mechanism list is empty, then no authentication is required and nofurther action takes place as part of the authentication challenge;otherwise, the client responds with a tuple matching the prototype:  auth-response: ( mech:word [ token:string ] )mech specifies the SASL mechanism and token, if present, gives the"initial response" of the authentication exchange.  The client mayspecify an empty mechanism to decline authentication; otherwise, uponreceiving the client's auth-response, the server sends a series ofchallenges, each a tuple matching the prototype:  challenge: ( step ( token:string ) )           | ( failure ( message:string ) )           | ( success [ token:string ] )If the first word of the challenge is "step", then the token isinterpreted by the authentication mechanism, and the response tokentransmitted to the server as a string.  The server then proceeds withanother challenge.  If the client wishes to abort the authenticationexchange, it may do so by closing the connection.If the first word of the challenge is "success", the authentication issuccessful.  If a token is provided, it should be interpreted by theauthentication mechanism, but there is no response.If the first word of the challenge is "failure", the authenticationexchange is unsuccessful.  The client may then give up, or makeanother auth-response and restart the authentication process.RFC 2222 requires that a protocol profile define a service name forthe sake of the GSSAPI mechanism.  The service name for this protocolis "svn".After a successful authentication exchange, the server sends a commandresponse whose parameters match the prototype:  repos-info: ( uuid:string repos-url:string )uuid gives the universal unique identifier of the repository, andrepos-url gives the URL of the repository's root directory.  Theclient can now begin sending commands from the main command set.2.1 CapabilitiesThe following capabilities are currently defined:  edit-pipeline     If both the client and server present this                    capability, edit operations will use pipelining.                    See section 3.1.2.  svndiff1          If both the client and server support svndiff version                    1, this will be used as the on-the-wire format for svndiff                    instead of svndiff version 0.  absent-entries    If the remote end announces support for this capability,                    it will accept the absent-dir and absent-file editor                    commands.3. Commands-----------Commands match the prototypes:  command: ( command-name:word params:list )The interpretation of command parameters is different from command tocommand.Initially, the client initiates commands from the main command set,and the server responds.  Some commands in the main command set cantemporarily change the set of commands which may be issued, or changethe flow of control so that the server issues commands and the clientresponds.Here are some miscellaneous prototypes used by the command sets:  proplist:  ( ( name:string value:string ) ... )  propdelta: ( ( name: string [ value:string ] ) ... )  node-kind: none|file|dir|unknown  bool:      true|false  lockdesc:  ( path:string token:string owner:string [ comment:string ]               created:string [ expires:string ] )3.1. Command SetsThere are three command sets: the main command set, the editor commandset, and the report command set.  Initially, the protocol begins inthe main command set with the client sending commands; some commandscan change the command set and possibly the direction of control.3.1.1. Main Command SetThe main command set corresponds to the svn_ra interfaces.  After eachmain command is issued by the client, the server sends an auth-requestas described in section 2.  (If no new authentication is required, theauth-request contains an empty mechanism list, and the server proceedsimmediately to sending the command response.)  Some commands include asecond place for auth-request point as noted below.  reparent    params:   ( url:string )    response: ( )  get-latest-rev    params:   ( )    response: ( rev:number )  get-dated-rev    params:   ( date:string )    response: ( rev:number )  change-rev-prop    params:   ( rev:number name:string ? value:string )    response: ( )    If value is not specified, the rev-prop is removed.    (Originally the value was required; for minimum impact, it was     changed to be optional without creating an optional tuple for     that one parameter as we normally do.)  rev-proplist    params:   ( rev:number )    response: ( props:proplist )  rev-prop    params:   ( rev:number name:string )    response: ( [ value:string ] )  commit    params:   ( logmsg:string ? ( ( lock-path:string lock-token:string ) ... )                keep-locks:bool )    response: ( )    Upon receiving response, client switches to editor command set.    Upon successful completion of edit, server sends auth-request.    After auth exchange completes, server sends commit-info.    commit-info: ( new-rev:number date:string author:string                   ? ( post-commit-err:string ) )

⌨️ 快捷键说明

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