Overview
Comment: | the idead of moving out array values to they own tables was good at saving disk space but very bad at speed, reverted all of that |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
bde51dc0c7f885e36dffe60df2cfe597 |
User & Date: | c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 on 2010-08-26 19:49:47.000 |
Other Links: | branch diff | manifest | tags |
Context
2010-08-30
| ||
08:32 | fixed field naming after database upgrade check-in: 8a8515f5c4 user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
2010-08-26
| ||
19:49 | the idead of moving out array values to they own tables was good at saving disk space but very bad at speed, reverted all of that check-in: bde51dc0c7 user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
2010-08-13
| ||
14:53 | new script which can dump squidguard database to compatible format check-in: 1a367d050d user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
Changes
Modified database.sql
from [c2d74124ad]
to [952aeefe4b].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
|
︙ | |||
129 130 131 132 133 134 135 | 84 85 86 87 88 89 90 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | pair := string_to_array(site[x], ':'); splitted[0 - pair[2]::integer] := pair[1]; x := x - 1; end loop; return array_to_string(splitted, '.'); end; $_$; |
Modified squid-tagger.py
from [c46e709b29]
to [08a021606d].
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | - + - + - - - - - - - + + + + - - + + - + - + - + + | def check(self, site, ip_address): if self._check_stmt == None: self._check_stmt = self._db.prepare("select redirect_url, regexp from site_rule where site <@ tripdomain($1) and netmask >> $2::text::inet order by array_length(site, 1) desc") return(self._check_stmt(site, ip_address)) def dump(self): |
︙ | |||
100 101 102 103 104 105 106 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + | self._log.info("can't compile regexp") else: reply = row[0].format(url_path) break self.writeline('{} {}\n'.format(id, reply)) def check(self, line): |
︙ | |||
236 237 238 239 240 241 242 243 244 245 246 247 248 249 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | + | # don't wait for more data, start processing timeout = 0 # detect end of stream and exit if possible if kev.flags >> 15 == 1: self._kq.control([self._select.kevent(sys.stdin, self._select.KQ_FILTER_READ, self._select.KQ_EV_DELETE)], 0) eof = True #timeout = 0 if len(kevs) == 0: if len(self._queue) > 0: # get one request and process it req = self._queue.pop(0) Checker.process(self, req[0], req[1], req[2], req[3]) if len(self._queue) == 0: |
︙ | |||
284 285 286 287 288 289 290 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | - - - | default = '/usr/local/etc/squid-tagger.conf') parser.add_option('-d', '--dump', dest = 'dump', help = 'dump database', action = 'store_true', metavar = 'bool', default = False) parser.add_option('-f', '--flush-database', dest = 'flush_db', help = 'flush previous database on load', default = False, action = 'store_true', metavar = 'bool') |
︙ | |||
330 331 332 333 334 335 336 | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - + - - - - + - - - - - - + + + + - - - - + + - - - + + + - + | # initializing and reading in config file config = Config() if config.options.dump or config.options.load or config.options.dump_conf or config.options.load_conf: import csv tagdb = tagDB() |