parsav  Check-in [45a6e815b1]

Overview
Comment:various bug fixes, minor additions, more silliness
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 45a6e815b118e61e7f50ef7b2daac0efc5d9c42a59bf2dc408d0596a4437d4f0
User & Date: lexi on 2021-06-22 15:18:18
Other Links: manifest | tags
Context
2021-08-13
03:27
add svgcleaner hook check-in: c73063a9ac user: lexi tags: trunk
2021-06-22
15:18
various bug fixes, minor additions, more silliness check-in: 45a6e815b1 user: lexi tags: trunk
2021-01-29
21:14
rip out json-c, replace with mjson check-in: afae276b2f user: lexi tags: trunk
Changes

Modified makefile from [5b41282a82] to [85135e69dd].

    69     69   		-DMG_ENABLE_HTTP_WEBDAV=1 \
    70     70   		-DMG_ENABLE_HTTP_WEBSOCKET=0
    71     71   
    72     72   lib/mjson/mjson.o: lib/mjson/src/mjson.c lib/mjson/src/mjson.h lib/mjson
    73     73   	$(CC) -c $< -o lib/mjson/mjson.o \
    74     74   		-DMJSON_MAX_DEPTH=16 \
    75     75   		-DMJSON_ENABLE_BASE64=0 \
           76  +		-DMJSON_ENABLE_NEXT=1 \
    76     77   		-DMJSON_ENABLE_RPC=0
    77     78   
    78     79   lib/mbedtls/library/%.a: lib/mbedtls 
    79     80   	$(MAKE) -C lib/mbedtls/library $*.a
    80     81   
    81     82   ifeq ($(dl), git)
    82     83   clone = git clone --depth 1 # save time

Modified mgtool.t from [f2643e6a8b] to [36fb1b8ec6].

   337    337   			srv:setup(cnf) 
   338    338   		elseif lib.str.cmp(mode.arglist(0),'conf') == 0 then
   339    339   			srv:setup(cnf) 
   340    340   			srv:conprep(lib.store.prepmode.conf)
   341    341   			var cfmode: lib.cmdparse {
   342    342   				help = {'h','display this list'};
   343    343   				no_notify = {'n', "don't instruct the server to refresh its configuration cache after making changes; useful for \"transactional\" configuration changes."};
          344  +				raw = {'r', 'print output suitable for use in scripting rather than human consumption'};
   344    345   			}
   345    346   			cfmode:parse(mode.arglist.ct, &mode.arglist(0))
   346    347   			if cfmode.help then
   347    348   				[ lib.emit(false, 1, 'usage: ', `argv[0], ' conf ', cfmode.type.helptxt.flags, ' <cmd> [<args>…]', cfmode.type.helptxt.opts, cmdhelp {
   348    349   					{ 'conf set <setting> <value>', 'add or a change a server configuration parameter to the database' };
   349    350   					{ 'conf get <setting>', 'report the value of a server setting' };
   350    351   					{ 'conf reset <setting>', 'reset a server setting to its default value' };
................................................................................
   365    366   				else goto cmderr end
   366    367   			elseif cfmode.arglist.ct == 2 and
   367    368   				lib.str.cmp(cfmode.arglist(0),'reset') == 0 or
   368    369   				lib.str.cmp(cfmode.arglist(0),'clear') == 0 or
   369    370   				lib.str.cmp(cfmode.arglist(0),'unset') == 0 then
   370    371   				dlg:conf_reset(cfmode.arglist(1))
   371    372   				lib.report('parameter cleared')
          373  +			elseif cfmode.arglist.ct == 2 and
          374  +				lib.str.cmp(cfmode.arglist(0),'get') == 0 then
          375  +				var val = dlg:conf(cfmode.arglist(1))
          376  +				if val:ref() then
          377  +					lib.report('parameter read')
          378  +					[ lib.emit(true, 1, `cfmode.arglist(1), ' = "', `{val.ptr,val.ct}, '"') ]
          379  +				else
          380  +					lib.warn('no such parameter present in configuration store')
          381  +				end
   372    382   			elseif cfmode.arglist.ct == 3 and
   373    383   				lib.str.cmp(cfmode.arglist(0),'set') == 0 then
   374    384   				dlg:conf_set(cfmode.arglist(1),cfmode.arglist(2))
   375    385   				lib.report('parameter set')
   376    386   			else goto cmderr end
   377    387   
   378    388   			-- successful commands fall through

Modified render/conf/users.t from [989226adbe] to [f3cbea2a5d].

    49     49   		hacker god master mistress slave rage freeze flayer
    50     50   		pirate ninja shadow fog mist misery glory bear
    51     51   		king queen empress emperor majesty space martian
    52     52   		winter fall monk katana 420 warrior banana demon
    53     53   		devil ghost wraith cuck legend hero heroine goblin
    54     54   		gremlin troll dragon evil overlord radiance slop
    55     55   		operator rage hog bog roach wizard steel madness
    56         -		reign
           56  +		reign cosmos fantasy night day terra luna sin
           57  +		grandpa grampa gramps mom dad daddy aunt uncle
    57     58   	]]
    58     59   	var adjs = splitwords [[
    59     60   		dark super supreme ultra ultimate total infinite
    60     61   		omnipotent crazy final deathless immortal elite
    61     62   		leet 1337 bloody fearless headless screaming insane
    62     63   		brutal legendary space frozen flaming burning lazy
    63     64   		mighty flayed hidden secret lost mystery glorious
    64     65   		nude naked bare first radiant martian fallen bog
    65     66   		wandering dank demonic satanic invisible based woke
    66     67   		deadly lethal heroic evil majestic luminous ethereal
    67     68   		perfect first fantastic special great steel insane
    68         -		royal imperial celestial cosmic mystic sublime
           69  +		royal imperial celestial cosmic mystic sublime lonely
           70  +		lonesome stellar reigning powerful russian spinning
           71  +		revolving rotating enlarged enormous gigantic huge
           72  +		nightly daily earthly lunar global
    69     73   	]]
    70     74   
    71     75   	if xXx then a:lpush('xXx_') end
    72     76   
    73     77   	if useadj then
    74     78   		var len = rnd(uint8,1,3) 
    75     79   		for i = 0, len do

Modified srv.t from [d3489f68a4] to [3858e9328c].

   675    675   terra srv:start(iname: rawstring)
   676    676   	self:conprep(lib.store.prepmode.full)
   677    677   	self.cfg:init(self)
   678    678   	self.pool:init(self.cfg.poolinitsz)
   679    679   	var dbbind = self:conf_get(&self.pool, 'bind')
   680    680   	if iname == nil then iname = lib.proc.getenv('parsav_instance') end
   681    681   	if iname == nil then
   682         -		self.id = self.cfg.instance.ptr;
          682  +		self.id = self.cfg.instance:cdup()
   683    683   		-- let this leak -- it'll be needed for the lifetime of the process anyway
   684    684   	else self.id = iname end 
   685    685   
   686    686   	if iname ~= nil then
   687    687   		lib.report('parsav instance "',iname,'" starting')
   688    688   	end
   689    689   
................................................................................
   774    774   	self.pol_reg = self:cfbool('policy-self-register', false)
   775    775   	self.pol_autoherald = self:cfbool('policy-self-herald', true)
   776    776   
   777    777   	do self.credmgd = false
   778    778   	var fr = self._pool:frame()
   779    779   	var sreg = self:cfstr('credential-store')
   780    780   	if sreg:ref() then
   781         -		if lib.str.cmp(sreg.ptr, 'managed') == 0
          781  +		if sreg:cmp('managed')
   782    782   			then self.credmgd = true
   783    783   			else self.credmgd = false
   784    784   		end
   785    785   		self._pool:reset(fr)
   786    786   	end end
   787    787   
   788    788   	self.maxupsz = self:cffsz('maximum-artifact-size', [1024 * 100]) -- 100 kilobyte default

Modified str.t from [bff3416286] to [37b9ad8a8d].

    48     48   		end
    49     49   		terra ty:pdup(p: &lib.mem.pool): strptr
    50     50   			if not @self then return strptr.null() end
    51     51   			if self.ct == 0 then self.ct = m.sz(self.ptr) end
    52     52   			var newstr = p:alloc(int8, self.ct)
    53     53   			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
    54     54   			return newstr
           55  +		end
           56  +		terra ty:pcdup(p: &lib.mem.pool): rawstring
           57  +			if not @self then return nil end
           58  +			if self.ct == 0 then self.ct = m.sz(self.ptr) end
           59  +			var newstr = p:alloc(int8, self.ct + 1)
           60  +			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
           61  +			newstr.ptr[self.ct] = 0
           62  +			return newstr.ptr
           63  +		end
           64  +		terra ty:cdup(): rawstring
           65  +			if not @self then return nil end
           66  +			if self.ct == 0 then self.ct = m.sz(self.ptr) end
           67  +			var newstr = lib.mem.heapa(int8, self.ct + 1)
           68  +			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
           69  +			newstr.ptr[self.ct] = 0
           70  +			return newstr.ptr
    55     71   		end
    56     72   		terra ty:cmp(other: ty)
    57     73   			if self.ptr == nil and other.ptr == nil then return true end
    58     74   			if self.ptr == nil or other.ptr == nil then return false end
    59     75   
    60     76   			var sz = lib.math.biggest(self.ct, other.ct)
    61     77   			for i = 0, sz do