Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: NTop: Misc
nprobe: make lockfile disable writing flows to file
 

Index | Next | Previous | View Flat


warwick at frogfoot

May 26, 2011, 2:21 PM


Views: 188
Permalink
nprobe: make lockfile disable writing flows to file

Hi

We're using nprobe_6.4.3_050511_pro with a command line along the lines
of

nprobe -n none -P <outputdir> -D t -C <lockfile>

and I'd like it not to write to <outputdir> if <lockfile> exists.

I've created the following patch that seems to do the job, will it have
any nasty side effects? I'm worried about skipping the free() calls
toward the end of exportBucket(), but my C isn't good enough to tell if
this will be a problem.

======================================================================
--- engine.c.orig 2011-05-26 22:23:45.000000000 +0200
+++ engine.c 2011-05-26 22:52:30.000000000 +0200
@@ -21,6 +21,7 @@
*/

#include "nprobe.h"
+#include "export.h"

extern u_int8_t dequeueBucketToExport_up;

@@ -1772,6 +1773,11 @@
lastTheTime = theTime;
}

+ if(is_locked_send()) {
+ pthread_rwlock_unlock(&readWriteGlobals->exportRwLock);
+ return;
+ }
+
if((readWriteGlobals->flowFd == NULL)
#ifdef HAVE_SQLITE
&& (readWriteGlobals->sqlite3Handler == NULL)
======================================================================

Regards
Warwick

--
Warwick Duncan
Frogfoot Networks ISP
http://www.frogfoot.com/
+27.21.448.7225
_______________________________________________
Ntop-misc mailing list
Ntop-misc [at] listgateway
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Subject User Time
nprobe: make lockfile disable writing flows to file warwick at frogfoot May 26, 2011, 2:21 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.