From 063f35263da2da9c4c5c405efceae6bfc7679b92 Mon Sep 17 00:00:00 2001 From: obiot Date: Tue, 27 Jan 2004 18:05:32 +0000 Subject: [PATCH] From Lars Ruoff: - use create_tempfile() to create the temporary files (causes temp files to be created at the same location as other Ethereal temp files). Changed temp filenames to "ether_rtp_dXXXXXX", where d is the stream direction. - fixed a bug with temp files not being removed git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9886 f5534014-38df-0310-8fa8-9805f1628bb7 --- gtk/rtp_analysis.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index cdf2917f56..ebaf6273b9 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -1,7 +1,7 @@ /* rtp_analysis.c * RTP analysis addition for ethereal * - * $Id: rtp_analysis.c,v 1.27 2004/01/25 21:55:11 guy Exp $ + * $Id: rtp_analysis.c,v 1.28 2004/01/27 18:05:32 obiot Exp $ * * Copyright 2003, Alcatel Business Systems * By Lars Ruoff @@ -44,6 +44,7 @@ #include "../graph/graph.h" #endif +#include "util.h" #include "epan/epan_dissect.h" #include "epan/filesystem.h" #include "tap.h" @@ -533,12 +534,6 @@ static int rtp_packet_add_info(GtkCList *clist, snprintf(status,40,"Wrong sequence nr."); color = COLOR_ERROR; } -/* - else if ((statinfo->flags & STAT_FLAG_PT_CHANGE) - && !(statinfo->flags & STAT_FLAG_FIRST) - && !(statinfo->flags & STAT_FLAG_PT_CN) - && !(statinfo->flags & STAT_FLAG_FOLLOW_PT_CN)) { -*/ else if (statinfo->flags & STAT_FLAG_REG_PT_CHANGE) { snprintf(status,40,"Payload changed to PT=%u", statinfo->pt); color = COLOR_WARNING; @@ -703,6 +698,7 @@ static void on_destroy(GtkWidget *win _U_, user_data_t *user_data _U_) fclose(user_data->forward.saveinfo.fp); if (user_data->reversed.saveinfo.fp != NULL) fclose(user_data->reversed.saveinfo.fp); + /*XXX: test for error **/ remove(user_data->f_tempname); remove(user_data->r_tempname); @@ -1745,9 +1741,11 @@ static gint rtp_sort_column(GtkCList *clist, gconstpointer ptr1, gconstpointer p case 3: f1=atof(text1); f2=atof(text2); - if (f1f2) return 1; - else return 0; + if (fabs(f1-f2)<0.0000005) + return 0; + if (f1ssrc_rev = ssrc_rev; /* file names for storing sound data */ - strncpy(user_data->f_tempname, "f_tempnameXXXXXX", TMPNAMSIZE); - strncpy(user_data->r_tempname, "r_tempnameXXXXXX", TMPNAMSIZE); - mkstemp(user_data->f_tempname); - mkstemp(user_data->r_tempname); + /*XXX: check for errors*/ + fd = create_tempfile(user_data->f_tempname, sizeof(user_data->f_tempname), + "ether_rtp_f"); + close(fd); + fd = create_tempfile(user_data->r_tempname, sizeof(user_data->r_tempname), + "ether_rtp_r"); + close(fd); user_data->forward.saveinfo.fp = NULL; user_data->reversed.saveinfo.fp = NULL; user_data->dlg.save_voice_as_w = NULL; -- 2.34.1