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

📄 htpep.h

📁 www工具包. 这是W3C官方支持的www支撑库. 其中提供通用目的的客户端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
💻 H
字号:
/*  					W3C Sample Code Library libwww PEP Engine!  PEP Engine!*//***	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.*//*The PEP Manager is a registry for PEP Protocols that followthe generic syntax defined by the HTTP PEPprotocol headers. All PEP Protocols are registered at run-timein form of a PEP Module. A PEP Module consists of the following:      protocol      The name which is used to identify the protocol.      BEFORE Filter      When a new request is issued, the PEP Manager looks in the URL tree    to see if we have any PEP information for this particular request. The search    is based on the realm (if known) in which the request belongs and the URL    itself. If a record is found then the PEP Manager calls the PEP    Module in order to generate the PEP protocol headers.      AFTER Filter      After a request has terminated and the result was lack of required PEP protocol    headers, the request should normally be repeated with a new set of PEP protocol    headers. The AFTER filter is responsible for extracting the challenge from    the HTTP response and store it in the URL tree, so that we next time we request    the same URL we know that it is protected and we can ask the user for the    appropriate PRP protocol headers.      garbage collection      The PEP information is stored in a URL Tree but    as it doesn't know the format of the protocol specific parts, you must register    a garbage collector (gc). The gc is called when node is deleted in the tree.Note: The PEP Manager itself consists of BEFORE andan AFTER filter - just like the PEPModules. This means that any PEP Module also can be registereddirectly as a BEFORE and AFTERfilter by the Net Manager.The reason for having the two layer model is that the PEP Managermaintains a single URL tree for storing PEPinformation for all PEP Protocols.A PEP Module has three resources, it can use when creating PEP protocolheaders:	 	   o 	     Handle the PEP protocol headers send from the remote party (typically    in the form of a HTTP response.  o 	     Handle the PEP protocol headers which typically are to part of the    next request.  o 	     Add information to the URL Tree	 This module is implemented by HTPEP.c (get it?), andit is a part of the  W3C Sample CodeLibrary.*/#ifndef HTPEP_H#define HTPEP_H#include "HTList.h"#include "HTReq.h"#include "HTUTree.h"typedef struct _HTPEPModule HTPEPModule;/*.  PEP Module Registration.A PEP Protocol is registered by registering an PEP Module toin the PEP Manager.(  Add a PEP Module)You can add a PEP protocol by using the following method. Each of the callbackfunction must have the type as defined below.*/extern HTPEPModule * HTPEP_newModule(const char *	protocol,				     HTNetBefore *	before,			             HTNetAfter *	after,				     HTUTree_gc *	gc);/*(  Find a PEP Module)*/extern HTPEPModule * HTPEP_findModule (const char * protocol);/*(  Delete a PEP Module)*/extern BOOL HTPEP_deleteModule (const char * protocol);/*(  Delete ALL PEP modules)*/extern BOOL HTPEP_deleteAllModules (void);/*.  Handling the URL Tree.The PEP information is stored as URL Trees.  Theroot of a URL Tree is identified by a hostname and a port number.Each URL Tree contains a set of templates and realms which can be used topredict what information to use in a hierarchical tree.The URL trees are automatically collected after some time so the applicationdoes not have to worry about freeing the trees. When a node in a tree isfreed, the gc registered as part of the PEP Module is called.Server applications can have different PEP setups for each hostname and portnumber, they control. For example, a server with interfaces"www.foo.com" and "internal.foo.com" can have differentprotection setups for each interface.(  Add information to the Database)Add a PEP information node to the database. If the entry is already foundthen it is replaced with the new one. The template must follow normal URIsyntax but can include a wildcard Return YES if added (or replaced), elseNO*/extern HTPEPModule * HTPEP_findModule (const char * name);/*.  The PEP Manager Filters.As mentioned, the PEP Manager is itself a set offilters that can be registered by theNet manager.*/extern HTNetBefore HTPEP_beforeFilter;extern HTNetAfter  HTPEP_afterFilter;/**/#endif	/* NOT HTPEP_H *//*    @(#) $Id: HTPEP.html,v 2.5 1998/05/14 02:10:54 frystyk Exp $*/

⌨️ 快捷键说明

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