----------------------------------------------------------------------------- -- -- Onions Network Streams Library -- -- O N I O N S . I N S T R E A M S . C H A N N E L -- -- S p e c -- -- Copyright (C) 1997-1998 Regents of the University of California -- -- Onions is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation, with or without the single exception listed below; -- either version 2, or (at your option) any later version. Onions is -- distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -- without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -- PARTICULAR PURPOSE. See the GNU General Public License for more details. -- You should have received a copy of the GNU General Public License -- distributed with Onions; see the file COPYING. If not, write to the -- Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. -- -- As a special exception, if other files instantiate generics from this -- library, or you link this library with other files to produce an -- executable, this library does not by itself cause the resulting -- executable to be covered by the GNU General Public License. This -- exception does not however invalidate any other reasons why the -- executable file might be covered by the GNU General Public License. -- -- Created in 1997 by Roy T. Fielding and Kari Nies ----------------------------------------------------------------------------- -- -- The Channel Input Stream is a stream end that acts as a filter between -- the client and the connection established by the connection manager. -- This filter is needed so that the normal close, abort, and reset calls -- on the stream can be intercepted and handled by the connection manager, -- thus enabling multiple streams to use the same socket connection as -- in HTTP/1.1 persistent connections. A similar Mux filter could be -- used to implement HTTP-NG multiplexing. -- with Onions.Connections; package Onions.Instreams.Channel is type Channel_Input_Stream is new Input_Stream with private; type Channel_Input_Stream_Ptr is access all Channel_Input_Stream; --------------------------------------------- -- Dispatching Stream Control Operations -- --------------------------------------------- -- Free the storage associated with a stream object. -- procedure Free (SP : in out Channel_Input_Stream_Ptr); -- Bind the channel to a connection object. -- function Bind (Stream : in Channel_Input_Stream_Ptr; Connie : in Onions.Connections.A_Connection) return Input_Pipe; -- Close the channel by handing it back to the connection manager. -- procedure Close (Stream : in out Channel_Input_Stream); -- Abort_Stream should only be used if a stream is interrupted -- by the user, or an error occurs that makes the whole stream bad. -- procedure Abort_Stream (Stream : in out Channel_Input_Stream); -- Reset the channel to its original state without closing it. -- procedure Reset (Stream : in out Channel_Input_Stream); -- Name returns a string containing the currently open server address. -- function Name (Stream : in Channel_Input_Stream) return String; -- We inherit Drain, Process, Unprocess, and Ada.Streams Read. private type Channel_Input_Stream is new Input_Stream with record -- Channel Connection -- Conn : Onions.Connections.A_Connection; end record; end Onions.Instreams.Channel;