Commit Graph

10 Commits

Author SHA1 Message Date
rofl0r
74d9d965bb proxywatchd: always use a new mysql obj
could prevent memleaks, also helps thread-ownership issues.
2019-01-05 18:14:52 +00:00
mickael
cb342c3818 sqlite: use executemany
avoid loop inserting the whole list in a single query
2019-01-05 17:42:57 +00:00
rofl0r
af8f82924f fix logic so threads do an orderly shutdown
basically the issue was that the main loop received the SIGINT
and therefore broke out before reaching the parts of the code
that care about bringing down the child threads.

therefore there's now a finish() method that needs to be called
after stop().

because sqlite dbs insists to be used from the thread that created
the object, the DB cleanup operation are done from the thread
that controls it.

for standalone operation, in order to keep the main thread alive,
an additional run() method is used. this is not necessary when
used via ppf.py.
2019-01-05 17:17:27 +00:00
rofl0r
47221bae94 properly clean submitted job list after db write 2019-01-05 16:44:31 +00:00
rofl0r
42f35855ea use a variable for the min number of jobs to collect
this variable determines after how many results the db is written to.
with a low value, it is written often and could more lock issues
if 2 threads concur for the db.
2019-01-05 16:39:58 +00:00
rofl0r
f45cd1190c fix performance issue in proxywatchd 2019-01-05 06:58:46 +00:00
rofl0r
9ac3ed45d6 rewrite threading code in jobwatchd
now it distributes the tasks properly among all threads,
and it can be used as a standalone program.
there are some minor performance issues which will be fixed shortly.
2019-01-05 06:35:41 +00:00
rofl0r
ffbe450aee outsource configuration to external module 2019-01-05 03:47:03 +00:00
mickael
6df8fac96e fix: don't re-test all protos every time
all protos (http, socks4, socks5) were tested even for working proxies (whose protocol has been saved..)
also, don't save dummy 'http' protocol for non working proxies..
2019-01-05 01:04:50 +00:00
mickael
85043d8e8a move includes in root directory 2019-01-05 00:22:28 +00:00