|
1 /* envServer.cpp |
|
2 Generated by gSOAP 2.7.6b from env.h |
|
3 Copyright (C) 2000-2005, Robert van Engelen, Genivia Inc. All Rights Reserved. |
|
4 This part of the software is released under one of the following licenses: |
|
5 GPL, the gSOAP public license, or Genivia's license for commercial use. |
|
6 */ |
|
7 #include "envH.h" |
|
8 |
|
9 SOAP_SOURCE_STAMP("@(#) envServer.cpp ver 2.7.6b 2005-09-27 12:23:39 GMT") |
|
10 |
|
11 |
|
12 SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap) |
|
13 { |
|
14 #ifndef WITH_FASTCGI |
|
15 unsigned int k = soap->max_keep_alive; |
|
16 #endif |
|
17 |
|
18 do |
|
19 { |
|
20 #ifdef WITH_FASTCGI |
|
21 if (FCGI_Accept() < 0) |
|
22 { |
|
23 soap->error = SOAP_EOF; |
|
24 return soap_send_fault(soap); |
|
25 } |
|
26 #endif |
|
27 |
|
28 soap_begin(soap); |
|
29 |
|
30 #ifndef WITH_FASTCGI |
|
31 if (!--k) |
|
32 soap->keep_alive = 0; |
|
33 #endif |
|
34 |
|
35 if (soap_begin_recv(soap)) |
|
36 { if (soap->error < SOAP_STOP) |
|
37 { |
|
38 #ifdef WITH_FASTCGI |
|
39 soap_send_fault(soap); |
|
40 #else |
|
41 return soap_send_fault(soap); |
|
42 #endif |
|
43 } |
|
44 soap_closesock(soap); |
|
45 |
|
46 continue; |
|
47 } |
|
48 |
|
49 if (soap_envelope_begin_in(soap) |
|
50 || soap_recv_header(soap) |
|
51 || soap_body_begin_in(soap) |
|
52 || soap_serve_request(soap) |
|
53 || (soap->fserveloop && soap->fserveloop(soap))) |
|
54 { |
|
55 #ifdef WITH_FASTCGI |
|
56 soap_send_fault(soap); |
|
57 #else |
|
58 return soap_send_fault(soap); |
|
59 #endif |
|
60 } |
|
61 |
|
62 #ifdef WITH_FASTCGI |
|
63 } while (1); |
|
64 #else |
|
65 } while (soap->keep_alive); |
|
66 #endif |
|
67 return SOAP_OK; |
|
68 } |
|
69 |
|
70 #ifndef WITH_NOSERVEREQUEST |
|
71 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap) |
|
72 { |
|
73 soap_peek_element(soap); |
|
74 return soap->error = SOAP_NO_METHOD; |
|
75 } |
|
76 #endif |
|
77 |
|
78 /* End of envServer.cpp */ |