Changeset 1275 for pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
- Timestamp:
- May 15, 2007 10:42:56 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
r1266 r1275 79 79 pj_stun_session *default_session; 80 80 pj_hash_table_t *client_htable; 81 pj_stun_auth_cred *cred; 81 82 82 83 unsigned max_bw_kbps; … … 222 223 } 223 224 225 return PJ_SUCCESS; 226 } 227 228 229 PJ_DEF(pj_status_t) pj_stun_turn_usage_set_credential(pj_stun_usage *turn, 230 const pj_stun_auth_cred *c) 231 { 232 struct turn_usage *tu; 233 tu = (struct turn_usage*) pj_stun_usage_get_user_data(turn); 234 235 tu->cred = PJ_POOL_ZALLOC_T(tu->pool, pj_stun_auth_cred); 236 pj_stun_auth_cred_dup(tu->pool, tu->cred, c); 237 pj_stun_session_set_credential(tu->default_session, tu->cred); 224 238 return PJ_SUCCESS; 225 239 } … … 442 456 } else if (msg->hdr.type != PJ_STUN_ALLOCATE_REQUEST) { 443 457 if (PJ_STUN_IS_REQUEST(msg->hdr.type)) { 444 status = pj_stun_session_create_res ponse(sess, msg,445 446 458 status = pj_stun_session_create_res(sess, msg, 459 PJ_STUN_SC_NO_BINDING, 460 NULL, &tdata); 447 461 if (status==PJ_SUCCESS) { 448 462 status = pj_stun_session_send_msg(sess, PJ_FALSE, … … 631 645 } 632 646 647 if (tu->cred) 648 pj_stun_session_set_credential(client->session, tu->cred); 649 633 650 sd = PJ_POOL_ZALLOC_T(pool, struct session_data); 634 651 sd->tu = tu; … … 864 881 pj_cstr(&err_msg, custom_msg), p_err_msg = &err_msg; 865 882 866 status = pj_stun_session_create_res ponse(client->session, msg,867 868 883 status = pj_stun_session_create_res(client->session, msg, 884 err_code, p_err_msg, 885 &response); 869 886 if (status == PJ_SUCCESS) 870 887 status = pj_stun_session_send_msg(client->session, PJ_TRUE, … … 1015 1032 1016 1033 /* Done successfully, create and send success response */ 1017 status = pj_stun_session_create_res ponse(client->session, msg,1018 1034 status = pj_stun_session_create_res(client->session, msg, 1035 0, NULL, &response); 1019 1036 if (status != PJ_SUCCESS) { 1020 1037 return status; … … 1063 1080 1064 1081 /* Create response */ 1065 status = pj_stun_session_create_res ponse(session, msg, 0, NULL,1066 1082 status = pj_stun_session_create_res(session, msg, 0, NULL, 1083 &tdata); 1067 1084 if (status != PJ_SUCCESS) 1068 1085 return status;
Note: See TracChangeset
for help on using the changeset viewer.