Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / apps / JAWS2 / HTTP_10_Read.cpp
blobb5fd077a2478e1c49b544764b923531ca3c98ca5
1 #include "HTTP_10.h"
3 #include "JAWS/JAWS.h"
4 #include "JAWS/IO.h"
5 #include "JAWS/IO_Handler.h"
6 #include "JAWS/Policy.h"
10 // --------------- READ TASK ----------------------
12 JAWS_HTTP_10_Read_Task::JAWS_HTTP_10_Read_Task (void)
16 JAWS_HTTP_10_Read_Task::~JAWS_HTTP_10_Read_Task (void)
20 int
21 JAWS_HTTP_10_Read_Task::handle_put (JAWS_Data_Block *data, ACE_Time_Value *)
23 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put");
25 JAWS_IO_Handler *handler = data->io_handler ();
26 JAWS_Dispatch_Policy *policy = this->policy ();
27 if (policy == 0) policy = data->policy ();
29 JAWS_IO *io = policy->io ();
31 if (data->length () > 0)
33 if (data->rd_ptr ()[0] != '\0')
35 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put, have data");
36 return 0;
39 data->rd_ptr (data->wr_ptr ());
40 data->crunch ();
42 io->read (handler, data, data->size ());
43 switch (handler->status ())
45 case JAWS_IO_Handler::READ_OK:
47 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put, READ_OK");
48 return 0;
50 break;
51 case JAWS_IO_Handler::READ_ERROR:
52 case JAWS_IO_Handler::READ_ERROR_A:
54 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put, READ_ERROR");
55 return -1;
57 default:
58 break;
61 return 1;