2
0
Эх сурвалжийг харах

fix: TM callback writes to fifo are changed to non-blocking

Jiri Kuthan 21 жил өмнө
parent
commit
08a8252934
1 өөрчлөгдсөн 6 нэмэгдсэн , 6 устгасан
  1. 6 6
      modules/tm/uac_fifo.c

+ 6 - 6
modules/tm/uac_fifo.c

@@ -27,6 +27,7 @@
  * History:
  * --------
  *  2003-12-03 : fifo_callback() updated for changes in tm callbacks (bogdan)
+ *  2004-02-11: fix: TM callback writes to fifo changed to non-blocking (jiri)
  */
 
 #include <string.h>
@@ -560,12 +561,11 @@ static void fifo_callback( struct cell *t, int type, struct tmcb_params *ps )
 		text.s = ps->rpl->first_line.u.reply.reason.s;
 		text.len = ps->rpl->first_line.u.reply.reason.len;
 
-		f = fopen(filename, "wt");
-		if (!f) goto done;
-		fprintf(f, "%d %.*s\n", ps->rpl->first_line.u.reply.statuscode,
-			text.len, text.s);
-		print_uris(f, ps->rpl);
-		fprintf(f, "%s\n", ps->rpl->headers->name.s);
+		f = open_reply_pipe(filename);
+		if (!f) return;
+		fprintf(f, "%d %.*s\n", reply->first_line.u.reply.statuscode, text.len, text.s);
+		print_uris(f, reply);
+		fprintf(f, "%s\n", reply->headers->name.s);
 		fclose(f);
 	}
 	DBG("DEBUG: fifo_callback sucesssfuly completed\n");