5 #include "JAWS/IO_Handler.h"
6 #include "JAWS/Policy.h"
8 #include "HTTP_10_Request.h"
11 // --------------- PARSE TASK ----------------------
13 JAWS_HTTP_10_Parse_Task::JAWS_HTTP_10_Parse_Task ()
17 JAWS_HTTP_10_Parse_Task::~JAWS_HTTP_10_Parse_Task ()
22 JAWS_HTTP_10_Parse_Task::handle_put (JAWS_Data_Block
*data
, ACE_Time_Value
*)
24 JAWS_TRACE ("JAWS_HTTP_10_Parse_Task::handle_put");
26 JAWS_IO_Handler
*handler
= data
->io_handler ();
27 JAWS_Dispatch_Policy
*policy
= this->policy ();
28 if (policy
== 0) policy
= data
->policy ();
29 JAWS_IO
*io
= policy
->io ();
31 JAWS_HTTP_10_Request
*info
;
34 info
= reinterpret_cast<JAWS_HTTP_10_Request
*> (data
->payload ());
37 info
= new JAWS_HTTP_10_Request
;
40 ACE_ERROR ((LM_ERROR
, "%p\n", "JAWS_HTTP_10_Parse_Task::handle_put"));
43 data
->payload (static_cast<void *> (info
));
46 while (info
->receive (*(ACE_Message_Block
*)data
) == 0)
48 int next_read_size
= data
->space ();
50 if (next_read_size
== 0)
52 // Set payload to reflect "request too long"
56 io
->read (handler
, data
, next_read_size
);
57 switch (handler
->status ())
59 case JAWS_IO_Handler::READ_OK
:
60 // Behaved synchronously, reiterate
62 case JAWS_IO_Handler::READ_ERROR
:
63 case JAWS_IO_Handler::READ_ERROR_A
:
66 // This needs to be a value that tells the framework that
67 // the call is asynchronous, but that we should remain in
68 // the current task state.
73 // request completely parsed