- Timestamp:
- Apr 27, 2009 2:30:10 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
r2394 r2651 128 128 return PJ_FALSE; 129 129 } 130 #el se130 #elif 0 131 131 pjsip_msg *msg; 132 132 … … 139 139 return PJ_FALSE; 140 140 } 141 #else 142 /* Ticket #693: allow incoming MESSAGE without message body */ 143 PJ_UNUSED_ARG(rdata); 144 PJ_UNUSED_ARG(p_accept_hdr); 141 145 #endif 142 146 … … 155 159 pjsip_msg_body *body = rdata->msg_info.msg->body; 156 160 161 #if 0 162 /* Ticket #693: allow incoming MESSAGE without message body */ 157 163 /* Body MUST have been checked before */ 158 164 pj_assert(body != NULL); 165 #endif 159 166 160 167 … … 173 180 } 174 181 175 if ( pj_stricmp(&body->content_type.type, &STR_MIME_APP)==0 &&182 if (body && pj_stricmp(&body->content_type.type, &STR_MIME_APP)==0 && 176 183 pj_stricmp(&body->content_type.subtype, &STR_MIME_ISCOMPOSING)==0) 177 184 { … … 215 222 216 223 /* Save text body */ 217 text_body.ptr = (char*)rdata->msg_info.msg->body->data; 218 text_body.slen = rdata->msg_info.msg->body->len; 219 220 /* Get mime type */ 221 m = &rdata->msg_info.msg->body->content_type; 222 mime_type.ptr = buf; 223 mime_type.slen = pj_ansi_snprintf(buf, sizeof(buf), 224 "%.*s/%.*s", 225 (int)m->type.slen, 226 m->type.ptr, 227 (int)m->subtype.slen, 228 m->subtype.ptr); 229 if (mime_type.slen < 1) 230 mime_type.slen = 0; 224 if (body) { 225 text_body.ptr = (char*)rdata->msg_info.msg->body->data; 226 text_body.slen = rdata->msg_info.msg->body->len; 227 228 /* Get mime type */ 229 m = &rdata->msg_info.msg->body->content_type; 230 mime_type.ptr = buf; 231 mime_type.slen = pj_ansi_snprintf(buf, sizeof(buf), 232 "%.*s/%.*s", 233 (int)m->type.slen, 234 m->type.ptr, 235 (int)m->subtype.slen, 236 m->subtype.ptr); 237 if (mime_type.slen < 1) 238 mime_type.slen = 0; 239 240 241 } else { 242 text_body.ptr = mime_type.ptr = ""; 243 text_body.slen = mime_type.slen = 0; 244 } 231 245 232 246 if (pjsua_var.ua_cfg.cb.on_pager) {
Note: See TracChangeset
for help on using the changeset viewer.