Check-in [b357796ad5]
Overview
Comment:Updated to be more careful about closing files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b357796ad55a4ce3989c07efb91c02adc66b7772
User & Date: rkeene on 2015-10-14 17:47:51
Other Links: manifest | tags
Context
2015-10-14
17:48
Updated to set resource limits for number of open files at startup, if possible check-in: ea36882e15 user: rkeene tags: trunk
17:47
Updated to be more careful about closing files check-in: b357796ad5 user: rkeene tags: trunk
17:47
Changed mount options to remove "direct_io", which breaks mmap and performed additional cleanups check-in: 1c47ca9097 user: rkeene tags: trunk
Changes

Modified appfsd.tcl from [e7e131fd9c] to [9efbb291d1].

337
338
339
340
341
342
343

344








345


346
347
348
349
350
351
352
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







+

+
+
+
+
+
+
+
+

+
+







		}

		if {![_verifySignatureAndCertificate $hostname $indexhashcert $indexhashsig $indexhash]} {
			return -code error "Invalid signature or certificate from $hostname"
		}

		set file [download $hostname $indexhash]
		catch {
		set fd [open $file]
		}

		if {![info exists fd]} {
			return -code error "Unable to download or open $file"
		}

		unset -nocomplain data
		catch {
		set data [read $fd]
		}

		close $fd

		set curr_packages [list]
		foreach line [split $data "\n"] {
			set line [string trim $line]

			if {[string match "*/*" $line]} {
420
421
422
423
424
425
426


427







428


429
430
431
432
433
434
435
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457







+
+

+
+
+
+
+
+
+

+
+







		}

		if {![_isHash $package_sha1]} {
			return FAIL
		}

		set file [download $hostname $package_sha1]

		catch {
		set fd [open $file]
		}

		if {![info exists fd]} {
			return -code error "Unable to download or open $file"
		}

		catch {
		set pkgdata [read $fd]
		}

		close $fd

		db transaction {
			foreach line [split $pkgdata "\n"] {
				set line [string trim $line]

				if {$line == ""} {