Browse code

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

Jiri Kuthan authored on 11/02/2004 06:44:51
Showing 1 changed files
... ...
@@ -27,6 +27,7 @@
27 27
  * History:
28 28
  * --------
29 29
  *  2003-12-03 : fifo_callback() updated for changes in tm callbacks (bogdan)
30
+ *  2004-02-11: fix: TM callback writes to fifo changed to non-blocking (jiri)
30 31
  */
31 32
 
32 33
 #include <string.h>
... ...
@@ -560,12 +561,11 @@ static void fifo_callback( struct cell *t, int type, struct tmcb_params *ps )
560 560
 		text.s = ps->rpl->first_line.u.reply.reason.s;
561 561
 		text.len = ps->rpl->first_line.u.reply.reason.len;
562 562
 
563
-		f = fopen(filename, "wt");
564
-		if (!f) goto done;
565
-		fprintf(f, "%d %.*s\n", ps->rpl->first_line.u.reply.statuscode,
566
-			text.len, text.s);
567
-		print_uris(f, ps->rpl);
568
-		fprintf(f, "%s\n", ps->rpl->headers->name.s);
563
+		f = open_reply_pipe(filename);
564
+		if (!f) return;
565
+		fprintf(f, "%d %.*s\n", reply->first_line.u.reply.statuscode, text.len, text.s);
566
+		print_uris(f, reply);
567
+		fprintf(f, "%s\n", reply->headers->name.s);
569 568
 		fclose(f);
570 569
 	}
571 570
 	DBG("DEBUG: fifo_callback sucesssfuly completed\n");