1 #ifndef HTTPU_HTTP_BASE_H
2 #define HTTPU_HTTP_BASE_H
4 #include "ace/Message_Block.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #include "JAWS/Parse_Headers.h"
11 #include "HTTPU/http_export.h"
12 #include "HTTPU/http_status.h"
13 #include "HTTPU/http_headers.h"
15 class HTTPU_Export HTTP_Base
: public HTTP_SCode_Base
19 virtual ~HTTP_Base ();
21 virtual int receive (ACE_Message_Block
&mb
);
22 virtual int deliver (ACE_Message_Block
&mb
);
24 virtual int receive_payload (ACE_Message_Block
&mb
);
25 virtual int receive_payload (ACE_Message_Block
&mb
, long length
);
27 const char * payload ();
28 unsigned long payload_size ();
31 const char *line () const;
32 HTTP_Headers
*http_headers ();
33 JAWS_Headers
*headers ();
35 int build_headers (JAWS_Headers
*new_headers
);
36 // takes a set of new headers that will replace existing headers or
37 // be added to the header list if there is no corresponding one to replace.
42 virtual void parse_line () = 0;
43 // Hook into the receive function to do specialized parsing of initial line.
44 // Sets the status_ variable.
46 virtual int espouse_line () = 0;
47 // Hook into the deliver function to do specialized initial line creation.
48 // Returns 0 for success and -1 for failure.
50 int deliver_header_name (JAWS_Header_Data
*&data
);
51 // Returns the next deliver state
53 int deliver_header_value (JAWS_Header_Data
*&data
);
54 // Returns the next deliver state
56 virtual int extract_line (ACE_Message_Block
&mb
);
57 // The first line of a request or a response.
58 // Return 0 if more data needed.
59 // Return 1 if line successfully parsed.
67 JAWS_Header_Table_Iterator iter_
;
68 ACE_Message_Block
*mb_
;
69 ACE_Message_Block payload_
;
73 #if defined (ACE_HAS_INLINED_OSCALLS)
74 # if defined (ACE_INLINE)
76 # endif /* ACE_INLINE */
77 # define ACE_INLINE inline
78 # include "HTTPU/http_base.inl"
79 # endif /* ACE_HAS_INLINED_OSCALLS */
81 #endif /* !defined (HTTPU_HTTP_BASE_H) */