Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / apps / JAWS2 / HTTP_10_Read.cpp
blob26a8dce820df90ba527f2e2a816c836face4b344
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"
9 // --------------- READ TASK ----------------------
11 JAWS_HTTP_10_Read_Task::JAWS_HTTP_10_Read_Task ()
15 JAWS_HTTP_10_Read_Task::~JAWS_HTTP_10_Read_Task ()
19 int
20 JAWS_HTTP_10_Read_Task::handle_put (JAWS_Data_Block *data, ACE_Time_Value *)
22 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put");
24 JAWS_IO_Handler *handler = data->io_handler ();
25 JAWS_Dispatch_Policy *policy = this->policy ();
26 if (policy == 0) policy = data->policy ();
28 JAWS_IO *io = policy->io ();
30 if (data->length () > 0)
32 if (data->rd_ptr ()[0] != '\0')
34 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put, have data");
35 return 0;
38 data->rd_ptr (data->wr_ptr ());
39 data->crunch ();
41 io->read (handler, data, data->size ());
42 switch (handler->status ())
44 case JAWS_IO_Handler::READ_OK:
46 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put, READ_OK");
47 return 0;
49 break;
50 case JAWS_IO_Handler::READ_ERROR:
51 case JAWS_IO_Handler::READ_ERROR_A:
53 JAWS_TRACE ("JAWS_HTTP_10_Read_Task::handle_put, READ_ERROR");
54 return -1;
56 default:
57 break;
60 return 1;