# HG changeset patch # User mirkol # Date 1007321564 0 # Node ID 0eaf9399717052461c3dc17dfc1831fa87f871a5 # Parent 81277bc2c26441dcbe64a5a6c22182627b4ed4df [svn] generate MessageID with pid and index number, not with random number. diff -r 81277bc2c264 -r 0eaf93997170 src/protocol.c --- a/src/protocol.c Sun Dec 02 19:31:48 2001 +0000 +++ b/src/protocol.c Sun Dec 02 19:32:44 2001 +0000 @@ -1,7 +1,7 @@ /* protocol.c - $Id: protocol.c 316 2001-10-31 11:44:53Z bears $ + $Id: protocol.c 340 2001-12-02 19:32:44Z mirkol $ */ #if HAVE_CONFIG_H @@ -307,21 +307,12 @@ { Str domain, date; time_t t; - static Bool randSeeded = FALSE; + static long count = 0; - if ( ! randSeeded ) - { - struct timeval tv; - struct timezone tz; - - if ( gettimeofday( &tv, &tz ) == 0 ) - srand( (unsigned int) tv.tv_usec ); - randSeeded = TRUE; - } getDomain( domain, from ); time( &t ); strftime( date, MAXCHAR, "%Y%m%d%H%M%S", gmtime( &t ) ); - snprintf( msgId, MAXCHAR, "<%s.%X.%s@%s>", date, rand(), suffix, domain ); + snprintf( msgId, MAXCHAR, "<%s.%X.%lx.%s@%s>", date, getpid(), count++ ,suffix, domain ); ASSERT( Prt_isValidMsgId( msgId ) ); }