Lines Matching defs:msg

46  * Allocate a new sip msg struct.
106 * Free a sip msg struct.
118 * Hold a sip msg struct.
220 _sip_msg_t *msg;
228 msg = (_sip_msg_t *)sip_msg;
229 (void) pthread_mutex_lock(&msg->sip_msg_mutex);
230 msgstr = sip_msg_to_msgbuf(msg, error);
231 (void) pthread_mutex_unlock(&msg->sip_msg_mutex);
240 sip_msg_to_msgbuf(_sip_msg_t *msg, int *error)
255 if (msg == NULL) {
261 assert(mutex_held(&msg->sip_msg_mutex));
264 p = (char *)malloc(msg->sip_msg_len + 1);
275 if (msg->sip_msg_start_line != NULL) {
276 len = msg->sip_msg_start_line->sip_hdr_end -
277 msg->sip_msg_start_line->sip_hdr_start;
278 (void) strncpy(e, msg->sip_msg_start_line->sip_hdr_start, len);
284 header = sip_search_for_header(msg, NULL, NULL);
297 assert(tlen <= msg->sip_msg_len);
300 header = sip_search_for_header(msg, NULL, header);
303 sip_content = msg->sip_msg_content;
309 assert(clen <= msg->sip_msg_content_len);
311 assert(tlen <= msg->sip_msg_len);
317 p[msg->sip_msg_len] = '\0';
326 sip_adjust_msgbuf(_sip_msg_t *msg)
335 if (msg == NULL)
338 (void) pthread_mutex_lock(&msg->sip_msg_mutex);
339 if ((msg->sip_msg_buf != NULL) && (!msg->sip_msg_modified)) {
344 (void) pthread_mutex_unlock(&msg->sip_msg_mutex);
355 assert(msg->sip_msg_old_buf == NULL);
356 msg->sip_msg_old_buf = msg->sip_msg_buf;
361 header = sip_search_for_header(msg, SIP_CONTENT_LENGTH, NULL);
370 (void) pthread_mutex_unlock(&msg->sip_msg_mutex);
371 ret = sip_add_content_length(msg, msg->sip_msg_content_len);
373 (void) pthread_mutex_unlock(&msg->sip_msg_mutex);
376 (void) pthread_mutex_lock(&msg->sip_msg_mutex);
377 msg->sip_msg_modified = B_FALSE;
379 msg->sip_msg_buf = sip_msg_to_msgbuf((sip_msg_t)msg, &ret);
380 if (msg->sip_msg_buf == NULL) {
381 (void) pthread_mutex_unlock(&msg->sip_msg_mutex);
388 msg->sip_msg_cannot_be_modified = B_TRUE;
390 (void) pthread_mutex_unlock(&msg->sip_msg_mutex);