5 #include "JAWS/IO_Handler.h"
6 #include "JAWS/Policy.h"
8 #include "HTTP_10_Request.h"
12 // --------------- PARSE TASK ----------------------
14 JAWS_HTTP_10_Parse_Task::JAWS_HTTP_10_Parse_Task (void)
18 JAWS_HTTP_10_Parse_Task::~JAWS_HTTP_10_Parse_Task (void)
23 JAWS_HTTP_10_Parse_Task::handle_put (JAWS_Data_Block
*data
, ACE_Time_Value
*)
25 JAWS_TRACE ("JAWS_HTTP_10_Parse_Task::handle_put");
27 JAWS_IO_Handler
*handler
= data
->io_handler ();
28 JAWS_Dispatch_Policy
*policy
= this->policy ();
29 if (policy
== 0) policy
= data
->policy ();
30 JAWS_IO
*io
= policy
->io ();
32 JAWS_HTTP_10_Request
*info
;
35 info
= reinterpret_cast<JAWS_HTTP_10_Request
*> (data
->payload ());
38 info
= new JAWS_HTTP_10_Request
;
41 ACE_ERROR ((LM_ERROR
, "%p\n", "JAWS_HTTP_10_Parse_Task::handle_put"));
44 data
->payload (static_cast<void *> (info
));
47 while (info
->receive (*(ACE_Message_Block
*)data
) == 0)
49 int next_read_size
= data
->space ();
51 if (next_read_size
== 0)
53 // Set payload to reflect "request too long"
57 io
->read (handler
, data
, next_read_size
);
58 switch (handler
->status ())
60 case JAWS_IO_Handler::READ_OK
:
61 // Behaved synchronously, reiterate
63 case JAWS_IO_Handler::READ_ERROR
:
64 case JAWS_IO_Handler::READ_ERROR_A
:
67 // This needs to be a value that tells the framework that
68 // the call is asynchronous, but that we should remain in
69 // the current task state.
74 // request completely parsed