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

📄 x6334.htm

📁 Its a xmpp protocol book
💻 HTM
字号:
<HTML
><HEAD
><TITLE
>XML Stream Flow</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
"><LINK
REL="HOME"
TITLE="Programming Jabber"
HREF="book1.htm"><LINK
REL="UP"
TITLE="User Registration and Authorization"
HREF="c6313.htm"><LINK
REL="PREVIOUS"
TITLE="User Registration and Authorization"
HREF="c6313.htm"><LINK
REL="NEXT"
TITLE="User Registration"
HREF="x6351.htm"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Programming Jabber</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="c6313.htm"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 6. User Registration and Authorization</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x6351.htm"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="JABTDG-CH-6-SECT-5.1"
>XML Stream Flow</A
></H1
><P
>User registration and user authorization are two processes that take
place at the start of an XML stream, immediately following the XML
stream header exchange. The Jabber server is designed to check for 
and process any user registration request or authentication request
<I
CLASS="EMPHASIS"
>before</I
> anything else. </P
><P
>This makes sense, as outside of a session (a session is created for a
user when the authentication completes successfully) any other element
- a <TT
CLASS="LITERAL"
>&#60;message/&#62;</TT
> packet,
a <TT
CLASS="LITERAL"
>&#60;presence/&#62;</TT
> packet or an 
<TT
CLASS="LITERAL"
>&#60;iq/&#62;</TT
> packet that's not in the 
<TT
CLASS="LITERAL"
>jabber:iq:register</TT
> or <TT
CLASS="LITERAL"
>jabber:iq:auth</TT
>
namespaces - is invalid. So if any of these other elements are sent
<I
CLASS="EMPHASIS"
>before</I
> authentication has taken place, that is,
before a session has been created for that connection, they are queued,
and processed <I
CLASS="EMPHASIS"
>after</I
> authentication.</P
><P
><A
HREF="x6334.htm#JABTDG-CH-6-FIG-1"
>Figure 6-1</A
> shows the general flow within an 
XML stream, with regard to where the registration and / or authentication
steps happen.</P
><DIV
CLASS="FIGURE"
><A
NAME="JABTDG-CH-6-FIG-1"
></A
><P
><B
>Figure 6-1. XML Stream flow showing registration and authentication</B
></P
><PRE
CLASS="SCREEN"
>          +----------------------------+
 time     | XML Stream Header exchange |
  |       +----------------------------+
  |                     |
  v         +-----------------------+    step 1
            | any non-registration  |
            | or non-authorization  |
            | packets occurring at  |
            | this stage are queued |
            +-----------------------+
                        |
            +-----------------------+    step 2
            | user registration or  |
            | user authorization    | 
            | takes place           |
            +-----------------------+
                       |
            +-----------------------+    step 3
            | user session is       |
            | created on successful |
            | authentication        |
            +-----------------------+
                       |
            +-----------------------+    step 4
            | any queued packets    |
            | are processed at this |
            | stage                 |
            +-----------------------+
                       |
            +-----------------------+ 
            | normal user session   |
            | activity              |
            :                       :
            :                       :
            :                       :
            |                       |
            +-----------------------+
                       |
         +-----------------------------+
         | XML stream is ended by the  |
         | server or the client        |
         +-----------------------------+</PRE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="c6313.htm"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x6351.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>User Registration and Authorization</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c6313.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>User Registration</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

⌨️ 快捷键说明

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