Changeset 1877 for pjproject/trunk/pjnath/src/pjnath/ice_session.c
- Timestamp:
- Mar 19, 2008 11:00:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_session.c
r1731 r1877 121 121 const pj_uint8_t *pkt, 122 122 unsigned pkt_len, 123 const pj_stun_ msg *msg,123 const pj_stun_rx_data *rdata, 124 124 const pj_sockaddr_t *src_addr, 125 125 unsigned src_addr_len); … … 148 148 pj_str_t *username, 149 149 pj_str_t *nonce, 150 int*data_type,150 pj_stun_passwd_type *data_type, 151 151 pj_str_t *data); 152 152 static pj_status_t stun_auth_get_password(const pj_stun_msg *msg, … … 155 155 const pj_str_t *username, 156 156 pj_pool_t *pool, 157 int*data_type,157 pj_stun_passwd_type *data_type, 158 158 pj_str_t *data); 159 159 … … 233 233 auth_cred.data.dyn_cred.get_password = &stun_auth_get_password; 234 234 auth_cred.data.dyn_cred.user_data = comp->stun_sess; 235 pj_stun_session_set_credential(comp->stun_sess, &auth_cred); 235 pj_stun_session_set_credential(comp->stun_sess, PJ_STUN_AUTH_SHORT_TERM, 236 &auth_cred); 236 237 237 238 return PJ_SUCCESS; … … 447 448 pj_str_t *username, 448 449 pj_str_t *nonce, 449 int*data_type,450 pj_stun_passwd_type *data_type, 450 451 pj_str_t *data) 451 452 { … … 462 463 */ 463 464 *username = ice->rx_uname; 464 *data_type = 0;465 *data_type = PJ_STUN_PASSWD_PLAIN; 465 466 *data = ice->rx_pass; 466 467 } 467 468 else { 468 469 *username = ice->tx_uname; 469 *data_type = 0;470 *data_type = PJ_STUN_PASSWD_PLAIN; 470 471 *data = ice->tx_pass; 471 472 } … … 480 481 const pj_str_t *username, 481 482 pj_pool_t *pool, 482 int*data_type,483 pj_stun_passwd_type *data_type, 483 484 pj_str_t *data) 484 485 { … … 497 498 if (pj_strcmp(username, &ice->tx_uname) != 0) 498 499 return PJ_STATUS_FROM_STUN_CODE(PJ_STUN_SC_UNAUTHORIZED); 499 *data_type = 0;500 *data_type = PJ_STUN_PASSWD_PLAIN; 500 501 *data = ice->tx_pass; 501 502 … … 522 523 return PJ_STATUS_FROM_STUN_CODE(PJ_STUN_SC_UNAUTHORIZED); 523 524 524 *data_type = 0;525 *data_type = PJ_STUN_PASSWD_PLAIN; 525 526 *data = ice->rx_pass; 526 527 … … 1904 1905 const pj_uint8_t *pkt, 1905 1906 unsigned pkt_len, 1906 const pj_stun_ msg *msg,1907 const pj_stun_rx_data *rdata, 1907 1908 const pj_sockaddr_t *src_addr, 1908 1909 unsigned src_addr_len) 1909 1910 { 1910 1911 stun_data *sd; 1912 const pj_stun_msg *msg = rdata->msg; 1911 1913 pj_ice_sess *ice; 1912 1914 pj_stun_priority_attr *prio_attr; … … 1922 1924 /* Reject any requests except Binding request */ 1923 1925 if (msg->hdr.type != PJ_STUN_BINDING_REQUEST) { 1924 status = pj_stun_session_create_res(sess, msg,1926 status = pj_stun_session_create_res(sess, rdata, 1925 1927 PJ_STUN_SC_BAD_REQUEST, 1926 1928 NULL, &tdata); … … 1993 1995 } else { 1994 1996 /* Generate 487 response */ 1995 status = pj_stun_session_create_res(sess, msg,1997 status = pj_stun_session_create_res(sess, rdata, 1996 1998 PJ_STUN_SC_ROLE_CONFLICT, 1997 1999 NULL, &tdata); … … 2009 2011 if (pj_cmp_timestamp(&ice->tie_breaker, &role_attr->value) < 0) { 2010 2012 /* Generate 487 response */ 2011 status = pj_stun_session_create_res(sess, msg,2013 status = pj_stun_session_create_res(sess, rdata, 2012 2014 PJ_STUN_SC_ROLE_CONFLICT, 2013 2015 NULL, &tdata); … … 2029 2031 * First send response to this request 2030 2032 */ 2031 status = pj_stun_session_create_res(sess, msg, 0, NULL, &tdata);2033 status = pj_stun_session_create_res(sess, rdata, 0, NULL, &tdata); 2032 2034 if (status != PJ_SUCCESS) { 2033 2035 pj_mutex_unlock(ice->mutex);
Note: See TracChangeset
for help on using the changeset viewer.