00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 PUSH_CLIENT_STATE_NAME(PUSH_CLIENT_NULL_STATE)
00067 PUSH_CLIENT_STATE_NAME(PUSH_CLIENT_RECEIVING)
00068
00069 ROW(PUSH_CLIENT_NULL_STATE,
00070 TR_Invoke_Ind,
00071 e->u.TR_Invoke_Ind.tcl == 1 && pdu->type == ConfirmedPush,
00072 {
00073 Octstr *push_body;
00074 List *push_headers;
00075
00076 if (pdu->u.ConfirmedPush.headers_len > 0)
00077 push_headers = wsp_headers_unpack(pdu->u.ConfirmedPush.headers, 0);
00078 else
00079 push_headers = NULL;
00080
00081 http_remove_hop_headers(push_headers);
00082 http_header_pack(push_headers);
00083 gw_assert(push_headers);
00084 cpm->push_headers = http_header_duplicate(push_headers);
00085 push_body = octstr_duplicate(pdu->u.ConfirmedPush.data);
00086
00087 http_destroy_headers(push_headers);
00088
00089
00090
00091
00092 indicate_confirmedpush(cpm, push_body);
00093 octstr_destroy(push_body);
00094
00095
00096
00097
00098 response_confirmedpush(cpm);
00099 },
00100 PUSH_CLIENT_RECEIVING)
00101
00102
00103 ROW(PUSH_CLIENT_RECEIVING,
00104 S_ConfirmedPush_Res,
00105 1,
00106 {
00107 response_responder_invoke(cpm);
00108 },
00109 PUSH_CLIENT_NULL_STATE)
00110
00111
00112 ROW(PUSH_CLIENT_RECEIVING,
00113 S_PushAbort_Req,
00114 1,
00115 {
00116 send_abort_to_responder(cpm, e->u.S_PushAbort_Req.reason);
00117 indicate_pushabort(cpm, e->u.S_PushAbort_Req.reason);
00118 },
00119 PUSH_CLIENT_NULL_STATE)
00120
00121 ROW(PUSH_CLIENT_RECEIVING,
00122 Abort_Event,
00123 1,
00124 {
00125 send_abort_to_responder(cpm, e->u.S_PushAbort_Req.reason);
00126 indicate_pushabort(cpm, WSP_ABORT_USERREQ);
00127 },
00128 PUSH_CLIENT_NULL_STATE)
00129
00130 ROW(PUSH_CLIENT_RECEIVING,
00131 TR_Abort_Ind,
00132 e->u.TR_Abort_Ind.abort_code == WSP_ABORT_DISCONNECT,
00133 {
00134 WAPEvent *wsp_event;
00135
00136 wsp_event = wap_event_create(Disconnect_Event);
00137 wsp_event->u.Disconnect_Event.session_handle = cpm->client_push_id;
00138 gwlist_append(push_client_queue, wsp_event);
00139 },
00140 PUSH_CLIENT_NULL_STATE)
00141
00142 ROW(PUSH_CLIENT_RECEIVING,
00143 TR_Abort_Ind,
00144 e->u.TR_Abort_Ind.abort_code == WSP_ABORT_SUSPEND,
00145 {
00146 WAPEvent *wsp_event;
00147
00148 wsp_event = wap_event_create(Suspend_Event);
00149 wsp_event->u.Suspend_Event.session_handle = cpm->client_push_id;
00150 gwlist_append(push_client_queue, wsp_event);
00151 },
00152 PUSH_CLIENT_NULL_STATE)
00153
00154 ROW(PUSH_CLIENT_RECEIVING,
00155 TR_Abort_Ind,
00156 e->u.TR_Abort_Ind.abort_code != WSP_ABORT_DISCONNECT &&
00157 e->u.TR_Abort_Ind.abort_code != WSP_ABORT_SUSPEND,
00158 {
00159 indicate_pushabort(cpm, e->u.S_PushAbort_Req.reason);
00160 },
00161 PUSH_CLIENT_NULL_STATE)
00162
00163 #undef PUSH_CLIENT_STATE_NAME
00164 #undef ROW
00165
00166
00167
00168
See file LICENSE for details about the license agreement for using,
modifying, copying or deriving work from this software.