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
20 virtual ~HTTP_Base (void);
22 virtual int receive (ACE_Message_Block
&mb
);
23 virtual int deliver (ACE_Message_Block
&mb
);
25 virtual int receive_payload (ACE_Message_Block
&mb
);
26 virtual int receive_payload (ACE_Message_Block
&mb
, long length
);
28 const char * payload (void);
29 unsigned long payload_size (void);
31 int status (void) const;
32 const char *line (void) const;
33 HTTP_Headers
*http_headers (void);
34 JAWS_Headers
*headers (void);
36 int build_headers (JAWS_Headers
*new_headers
);
37 // takes a set of new headers that will replace existing headers or
38 // be added to the header list if there is no corresponding one to replace.
44 virtual void parse_line (void) = 0;
45 // Hook into the receive function to do specialized parsing of initial line.
46 // Sets the status_ variable.
48 virtual int espouse_line (void) = 0;
49 // Hook into the deliver function to do specialized initial line creation.
50 // Returns 0 for success and -1 for failure.
52 int deliver_header_name (JAWS_Header_Data
*&data
);
53 // Returns the next deliver state
55 int deliver_header_value (JAWS_Header_Data
*&data
);
56 // Returns the next deliver state
58 virtual int extract_line (ACE_Message_Block
&mb
);
59 // The first line of a request or a response.
60 // Return 0 if more data needed.
61 // Return 1 if line successfully parsed.
70 JAWS_Header_Table_Iterator iter_
;
71 ACE_Message_Block
*mb_
;
72 ACE_Message_Block payload_
;
77 #if defined (ACE_HAS_INLINED_OSCALLS)
78 # if defined (ACE_INLINE)
80 # endif /* ACE_INLINE */
81 # define ACE_INLINE inline
82 # include "HTTPU/http_base.inl"
83 # endif /* ACE_HAS_INLINED_OSCALLS */
85 #endif /* !defined (HTTPU_HTTP_BASE_H) */