Explorar o código

fixed heavy-load reply processing bug

Jiri Kuthan %!s(int64=23) %!d(string=hai) anos
pai
achega
e8793b5040
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      modules/tm/t_reply.c

+ 2 - 2
modules/tm/t_reply.c

@@ -176,6 +176,7 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
 	rb = & trans->uas.response;
 	rb = & trans->uas.response;
 	rb->activ_type=code;
 	rb->activ_type=code;
 
 
+	trans->uas.status = code;
 	buf_len = rb->buffer ? len : len + REPLY_OVERBUFFER_LEN;
 	buf_len = rb->buffer ? len : len + REPLY_OVERBUFFER_LEN;
 	rb->buffer = (char*)shm_resize( rb->buffer, buf_len );
 	rb->buffer = (char*)shm_resize( rb->buffer, buf_len );
 	/* puts the reply's buffer to uas.response */
 	/* puts the reply's buffer to uas.response */
@@ -185,7 +186,6 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
 	}
 	}
 	rb->buffer_len = len ;
 	rb->buffer_len = len ;
 	memcpy( rb->buffer , buf , len );
 	memcpy( rb->buffer , buf , len );
-	trans->uas.status = code;
 	/* needs to be protected too because what timers are set depends
 	/* needs to be protected too because what timers are set depends
 	   on current transactions status */
 	   on current transactions status */
 	/* t_update_timers_after_sending_reply( rb ); */
 	/* t_update_timers_after_sending_reply( rb ); */
@@ -422,12 +422,12 @@ error02:
 		t->uac[branch].reply = NULL;	
 		t->uac[branch].reply = NULL;	
 	}
 	}
 error01:
 error01:
+	t_reply_unsafe( t, t->uas.request, 500, "Reply processing error" );
 	UNLOCK_REPLIES(t);
 	UNLOCK_REPLIES(t);
 	if (t->is_invite) cancel_uacs( t, *cancel_bitmap );
 	if (t->is_invite) cancel_uacs( t, *cancel_bitmap );
 	/* a serious error occured -- attempt to send an error reply;
 	/* a serious error occured -- attempt to send an error reply;
 	   it will take care of clean-ups 
 	   it will take care of clean-ups 
 	*/
 	*/
-	t_reply( t, t->uas.request, 500, "Reply processing error" );
 
 
 	/* failure */
 	/* failure */
 	return RPS_ERROR;
 	return RPS_ERROR;