Browse code

fixed heavy-load reply processing bug

Jiri Kuthan authored on 16/08/2002 23:21:32
Showing 1 changed files
... ...
@@ -176,6 +176,7 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
176 176
 	rb = & trans->uas.response;
177 177
 	rb->activ_type=code;
178 178
 
179
+	trans->uas.status = code;
179 180
 	buf_len = rb->buffer ? len : len + REPLY_OVERBUFFER_LEN;
180 181
 	rb->buffer = (char*)shm_resize( rb->buffer, buf_len );
181 182
 	/* puts the reply's buffer to uas.response */
... ...
@@ -185,7 +186,6 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
185 186
 	}
186 187
 	rb->buffer_len = len ;
187 188
 	memcpy( rb->buffer , buf , len );
188
-	trans->uas.status = code;
189 189
 	/* needs to be protected too because what timers are set depends
190 190
 	   on current transactions status */
191 191
 	/* t_update_timers_after_sending_reply( rb ); */
... ...
@@ -422,12 +422,12 @@ error02:
422 422
 		t->uac[branch].reply = NULL;	
423 423
 	}
424 424
 error01:
425
+	t_reply_unsafe( t, t->uas.request, 500, "Reply processing error" );
425 426
 	UNLOCK_REPLIES(t);
426 427
 	if (t->is_invite) cancel_uacs( t, *cancel_bitmap );
427 428
 	/* a serious error occured -- attempt to send an error reply;
428 429
 	   it will take care of clean-ups 
429 430
 	*/
430
-	t_reply( t, t->uas.request, 500, "Reply processing error" );
431 431
 
432 432
 	/* failure */
433 433
 	return RPS_ERROR;