Changeset 1030 for pjproject/trunk/pjlib-util/src/pjlib-util/stun_msg.c
- Timestamp:
- Mar 1, 2007 11:39:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/stun_msg.c
r1021 r1030 989 989 990 990 /* Check that struct size is valid */ 991 pj_assert(sizeof(pj_stun_msg_integrity_attr)== STUN_MSG_INTEGRITY_LEN);991 pj_assert(sizeof(pj_stun_msg_integrity_attr)==ATTR_LEN); 992 992 993 993 /* Create attribute */ … … 1857 1857 for (i=0; i<msg->attr_count; ++i) { 1858 1858 const struct attr_desc *adesc; 1859 const pj_stun_attr_hdr *attr_hdr; 1860 1861 attr_hdr = msg->attr[i]; 1859 const pj_stun_attr_hdr *attr_hdr = msg->attr[i]; 1862 1860 1863 1861 if (attr_hdr->type == PJ_STUN_ATTR_MESSAGE_INTEGRITY) { … … 1890 1888 buf += printed; 1891 1889 buf_size -= printed; 1890 } 1891 1892 /* We may have stopped printing attribute because we found 1893 * MESSAGE-INTEGRITY or FINGERPRINT. Scan the rest of the 1894 * attributes. 1895 */ 1896 for ( ++i; i<msg->attr_count; ++i) { 1897 const pj_stun_attr_hdr *attr_hdr = msg->attr[i]; 1898 1899 /* There mustn't any attribute after FINGERPRINT */ 1900 PJ_ASSERT_RETURN(afingerprint == NULL, PJLIB_UTIL_ESTUNFINGERPOS); 1901 1902 if (attr_hdr->type == PJ_STUN_ATTR_MESSAGE_INTEGRITY) { 1903 /* There mustn't be MESSAGE-INTEGRITY before */ 1904 PJ_ASSERT_RETURN(amsg_integrity == NULL, 1905 PJLIB_UTIL_ESTUNMSGINTPOS); 1906 amsg_integrity = (pj_stun_msg_integrity_attr*) attr_hdr; 1907 1908 } else if (attr_hdr->type == PJ_STUN_ATTR_FINGERPRINT) { 1909 afingerprint = (pj_stun_fingerprint_attr*) attr_hdr; 1910 } 1892 1911 } 1893 1912 … … 1922 1941 /* Should not happen for message generated by us */ 1923 1942 pj_assert(PJ_FALSE); 1924 return PJLIB_UTIL_ESTUNMSGINT ;1943 return PJLIB_UTIL_ESTUNMSGINTPOS; 1925 1944 1926 1945 } else if (i == msg->attr_count-2) { … … 1928 1947 /* Should not happen for message generated by us */ 1929 1948 pj_assert(PJ_FALSE); 1930 return PJLIB_UTIL_ESTUNMSGINT ;1949 return PJLIB_UTIL_ESTUNMSGINTPOS; 1931 1950 } else { 1932 1951 afingerprint = (pj_stun_fingerprint_attr*) msg->attr[i+1];
Note: See TracChangeset
for help on using the changeset viewer.