📄 wsp_server_session_states.def
字号:
S_ConfirmedPush_Req, 1, { /* Start new push transaction*/ WSPPushMachine *spm; spm = push_machine_create(sm, e->server_push_id); handle_push_event(sm, spm, current_event); }, CONNECTED)ROW(CONNECTED, Suspend_Event, !resume_enabled, { /* Session Resume facility disabled */ /* Abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Disconnect.ind(SUSPEND) */ indicate_disconnect(sm, WSP_ABORT_SUSPEND); }, NULL_SESSION)ROW(CONNECTED, Suspend_Event, resume_enabled, { /* Session Resume facility enabled */ /* Abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(CONNECTED, TR_Invoke_Ind, e->tcl == 2 && (pdu->type == Get || pdu->type == Post), { WSPMethodMachine *msm; WAPEvent *new_event; /* Start new method transaction */ msm = method_machine_create(sm, e->handle); /* Hand off the event to the new method machine */ handle_method_event(sm, msm, current_event, pdu); /* Release the new method transaction */ new_event = wap_event_create(Release_Event); handle_method_event(sm, msm, new_event, NULL); wap_event_destroy(new_event); }, CONNECTED)ROW(CONNECTED, TR_Invoke_Ind, e->tcl == 2 && pdu->type == Resume && !resume_enabled, { /* Resume facility disabled */ /* TR-Abort.req(DISCONNECT) the TR-Invoke */ send_abort(WSP_ABORT_DISCONNECT, e->handle); }, CONNECTED)ROW(CONNECTED, TR_Invoke_Ind, e->tcl == 2 && pdu->type == Resume && resume_enabled, { /* Resume facility enabled */ WAPEvent *wtp_event; List *new_headers; /* TR-Invoke.res */ wtp_event = wap_event_create(TR_Invoke_Res); wtp_event->u.TR_Invoke_Res.handle = e->handle; dispatch_to_wtp_resp(wtp_event); /* Abort(RESUME) all method and push transactions */ abort_methods(sm, WSP_ABORT_RESUME); /* S-Suspend.ind(RESUME) */ indicate_suspend(sm, WSP_ABORT_RESUME); /* S-Resume.ind */ new_headers = unpack_new_headers(sm, pdu->u.Resume.headers); indicate_resume(sm, e->addr_tuple, new_headers); http_destroy_headers(new_headers); sm->resume_handle = e->handle; }, RESUMING)ROW(CONNECTED, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Disconnect, { /* Abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(CONNECTED, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Suspend && resume_enabled, { /* Abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(CONNECTED, TR_Invoke_Cnf, 1, { /* See push state table*/ WSPPushMachine *spm; spm = find_push_machine(sm, e->handle); handle_push_event(sm, spm, current_event); }, CONNECTED)ROW(CONNECTED, TR_Result_Cnf, e->handle != sm->connect_handle, { WSPMethodMachine *msm; /* See method state table */ msm = find_method_machine(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); }, CONNECTED) /* * Event TR-Abort.ind has a separate flag telling is the indicator the * initiator or the responder. */ROW(CONNECTED, TR_Abort_Ind, e->handle != sm->connect_handle && e->ir_flag == RESPONDER_INDICATION, { WSPMethodMachine *msm; /* See method state table */ msm = find_method_machine(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); }, CONNECTED)ROW(CONNECTED, TR_Abort_Ind, e->handle != sm->connect_handle && e->ir_flag == INITIATOR_INDICATION, { WSPPushMachine *m; /* See push state table */ m = find_push_machine(sm, e->handle); handle_push_event(sm, m, current_event); }, CONNECTED)/* MISSING: SUSPENDED, S-Disconnect.req */ROW(SUSPENDED, Disconnect_Event, 1, { /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(SUSPENDED, TR_Invoke_Ind, e->tcl == 2 && (pdu->type == Get || pdu->type == Post), { /* TR-Abort.req(SUSPEND) the TR-Invoke */ send_abort(WSP_ABORT_SUSPEND, e->handle); }, SUSPENDED)ROW(SUSPENDED, TR_Invoke_Ind, e->tcl == 2 && pdu->type == Resume, { WAPEvent *wtp_event; List *new_headers; /* TR-Invoke.res */ wtp_event = wap_event_create(TR_Invoke_Res); wtp_event->u.TR_Invoke_Res.handle = e->handle; dispatch_to_wtp_resp(wtp_event); /* S-Resume.ind */ new_headers = unpack_new_headers(sm, pdu->u.Resume.headers); indicate_resume(sm, e->addr_tuple, new_headers); http_destroy_headers(new_headers); sm->resume_handle = e->handle; }, RESUMING)ROW(SUSPENDED, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Disconnect, { /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)/* MISSING: RESUMING, S-Disconnect.req */ROW(RESUMING, Disconnect_Event, 1, { /* TR-Abort.req(DISCONNECT) the Resume transaction */ send_abort(WSP_ABORT_DISCONNECT, sm->resume_handle); /* Abort(DISCONNECT) all method transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(RESUMING, S_Resume_Res, 1, { WAPEvent *wtp_event; Octstr *ospdu; /* Disconnect any other session for the peer address quadruplet */ disconnect_other_sessions(sm); /* Bind session to new peer address quadruplet */ /* this happens automatically XXX Not true */ /* TR-Result.req(Reply) */ if (e->server_headers == NULL) e->server_headers = http_create_empty_headers(); ospdu = make_resume_reply_pdu(sm, e->server_headers); wtp_event = wap_event_create(TR_Result_Req); wtp_event->u.TR_Result_Req.user_data = ospdu; wtp_event->u.TR_Result_Req.handle = sm->resume_handle; dispatch_to_wtp_resp(wtp_event); /* Release all method transactions in HOLDING state */ release_holding_methods(sm); }, RESUMING_2)ROW(RESUMING, Suspend_Event, 1, { /* TR-Abort.req(SUSPEND) the Resume transaction */ send_abort(WSP_ABORT_SUSPEND, sm->resume_handle); /* Abort(SUSPEND) all method transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(RESUMING, TR_Invoke_Ind, e->tcl == 2 && (pdu->type == Get || pdu->type == Post), { /* Start new method transaction (see method state table) */ WSPMethodMachine *msm; msm = method_machine_create(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); }, RESUMING)ROW(RESUMING, TR_Invoke_Ind, e->tcl == 2 && pdu->type == Resume, { WAPEvent *wtp_event; List *new_headers; /* TR-Invoke.res */ wtp_event = wap_event_create(TR_Invoke_Res); wtp_event->u.TR_Invoke_Res.handle = e->handle; dispatch_to_wtp_resp(wtp_event); /* TR-Abort.req(RESUME) the old Resume transaction */ send_abort(WSP_ABORT_RESUME, sm->resume_handle); /* Abort(RESUME) all method transactions */ abort_methods(sm, WSP_ABORT_RESUME); /* S-Suspend.ind(RESUME) */ indicate_suspend(sm, WSP_ABORT_RESUME); /* S-Resume.ind */ new_headers = unpack_new_headers(sm, pdu->u.Resume.headers); indicate_resume(sm, e->addr_tuple, new_headers); http_destroy_headers(new_headers); sm->resume_handle = e->handle; }, RESUMING)ROW(RESUMING, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Suspend, { /* TR-Abort.req(SUSPEND) the Resume transaction */ send_abort(WSP_ABORT_SUSPEND, sm->resume_handle); /* Abort(SUSPEND) all method transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(RESUMING, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Disconnect, { /* TR-Abort.req(DISCONNECT) the Resume transaction */ send_abort(WSP_ABORT_DISCONNECT, sm->resume_handle); /* Abort(DISCONNECT) all method transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(RESUMING, TR_Abort_Ind, e->handle == sm->resume_handle, { /* Abort(SUSPEND) all method transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(abort reason) */ indicate_suspend(sm, e->abort_code); }, SUSPENDED)/* MISSING: RESUMING_2, S-Disconnect.req */ROW(RESUMING_2, Disconnect_Event, 1, { /* TR-Abort.req(DISCONNECT) the Resume */ send_abort(WSP_ABORT_DISCONNECT, sm->resume_handle); /* Abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(RESUMING_2, S_MethodInvoke_Res, 1, { WSPMethodMachine *msm; /* See method state table */ msm = find_method_machine(sm, e->server_transaction_id); handle_method_event(sm, msm, current_event, pdu); }, RESUMING_2)ROW(RESUMING_2, S_MethodResult_Req, 1, { WSPMethodMachine *msm; /* See method state table */ msm = find_method_machine(sm, e->server_transaction_id); handle_method_event(sm, msm, current_event, pdu); }, RESUMING_2)ROW(RESUMING_2, S_Push_Req, 1, { WSP_PDU *pdu; pdu = make_push_pdu(current_event); send_invoke(sm, pdu, current_event, TRANSACTION_CLASS_0); }, RESUMING_2)ROW(RESUMING_2, S_ConfirmedPush_Req, 1, { /* Start new push transaction*/ WSPPushMachine *spm; spm = push_machine_create(sm, e->server_push_id); handle_push_event(sm, spm, current_event); }, RESUMING_2)ROW(RESUMING_2, Suspend_Event, 1, { /* TR-Abort.req(SUSPEND) the Resume transaction */ send_abort(WSP_ABORT_SUSPEND, sm->resume_handle); /* Abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(RESUMING_2, TR_Invoke_Ind, e->tcl == 2 && (pdu->type == Get || pdu->type == Post), { WSPMethodMachine *msm; WAPEvent *new_event; /* Start new method transaction (see method state table) */ msm = method_machine_create(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); /* Release the new method transaction */ new_event = wap_event_create(Release_Event); handle_method_event(sm, msm, new_event, NULL); wap_event_destroy(new_event); }, RESUMING_2)ROW(RESUMING_2, TR_Invoke_Ind, e->tcl == 2 && pdu->type == Resume, { WAPEvent *wtp_event; List *new_headers; /* TR-Invoke.res */ wtp_event = wap_event_create(TR_Invoke_Res); wtp_event->u.TR_Invoke_Res.handle = e->handle; dispatch_to_wtp_resp(wtp_event); /* TR-Abort.req(RESUME) the old Resume transaction*/ send_abort(WSP_ABORT_RESUME, sm->resume_handle); /* Abort(RESUME) all method and push transactions */ abort_methods(sm, WSP_ABORT_RESUME); /* S-Suspend.ind(RESUME) */ indicate_suspend(sm, WSP_ABORT_RESUME); /* S-Resume.ind */ new_headers = unpack_new_headers(sm, pdu->u.Resume.headers); indicate_resume(sm, e->addr_tuple, new_headers); http_destroy_headers(new_headers); sm->resume_handle = e->handle; }, RESUMING)ROW(RESUMING_2, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Suspend, { /* TR-Abort.req(SUSPEND) the Resume transaction */ send_abort(WSP_ABORT_SUSPEND, sm->resume_handle); /* Abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(RESUMING_2, TR_Invoke_Ind, e->tcl == 0 && pdu->type == Disconnect, { /* TR-Abort.req(DISCONNECT) the Resume */ send_abort(WSP_ABORT_DISCONNECT, sm->resume_handle); /* Abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(RESUMING_2, TR_Invoke_Cnf, 1, { /* See push state table*/ WSPPushMachine *spm; spm = find_push_machine(sm, e->handle); handle_push_event(sm, spm, current_event); }, RESUMING_2)ROW(RESUMING_2, TR_Result_Cnf, e->handle == sm->resume_handle, { }, CONNECTED)ROW(RESUMING_2, TR_Result_Cnf, e->handle != sm->resume_handle, { WSPMethodMachine *msm; /* See method state table */ msm = find_method_machine(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); }, RESUMING_2)ROW(RESUMING_2, TR_Abort_Ind, e->handle == sm->resume_handle, { /* Abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(abort reason) */ indicate_suspend(sm, e->abort_code); }, SUSPENDED)/* * A separate flag tells is the indicator the initiator or the responder */ROW(RESUMING_2, TR_Abort_Ind, e->handle != sm->resume_handle && e->ir_flag == RESPONDER_INDICATION, { WSPMethodMachine *msm; /* See method state table */ msm = find_method_machine(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); }, RESUMING_2)ROW(CONNECTING_2, TR_Abort_Ind, e->handle != sm->connect_handle && e->ir_flag == INITIATOR_INDICATION, { WSPPushMachine *m; /* See push state table */ m = find_push_machine(sm, e->handle); handle_push_event(sm, m, current_event); }, CONNECTING_2)#undef ROW#undef STATE_NAME
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -