14821
Progress Journals & Experimental Routines / Re: ADARQ's journal
« on: April 17, 2012, 05:10:52 am »
Spent a few hours debugging, trying to figure out why my bot would zombie, even though I had a SIGALRM hook & alarm() set, also waitpid'n etc.. it was blocking in write(), because it writes to a pipe that was getting full on certain tests.
Cleaned environ when passed to ^guile, was resulting in info leaks, need to protect LD_PRELOAD/LD_LIBRARY_PATH variables.
Added fake environment variable, bot_t { dlist_t *dl_environ; }
Added something to build "argv[]" for my ^alias trigger, for example:
"dns" alias example:
05:03 < n9> ^a(get) dns|^e
05:03 < vkx> ^e|^guile (display (gethost "$$2"))
using it:
05:03 < n9> ^a dns adarq.org
05:03 < vkx> #(adarq.org () 2 4 (3351378795))
$$0-$$9 = argv[0]=argv[9] .. argv[0] = ^a, argv[1] = dns, argv[2] = first argument
Tomorrow I need to make it parse strings properly, instead of just tokenizing everything into words based on spaces.. for eample
:
^a blah one two three four <-- it only works on this
^a blah one "two three" four <-- it doesn't work on this, $$3 would be "two, $$4 would be three".. need to parse it into one arg
v, ie, $$3 = two three
Finally I need to add $$@0-9, ie, $$@0 = every argument.. $$@1 = every argument except the 0th. and so on
im crazy tired today, but got alot done.. 1 week on 5 hours sleep per night, max.
pC
Cleaned environ when passed to ^guile, was resulting in info leaks, need to protect LD_PRELOAD/LD_LIBRARY_PATH variables.
Added fake environment variable, bot_t { dlist_t *dl_environ; }
Added something to build "argv[]" for my ^alias trigger, for example:
"dns" alias example:
05:03 < n9> ^a(get) dns|^e
05:03 < vkx> ^e|^guile (display (gethost "$$2"))
using it:
05:03 < n9> ^a dns adarq.org
05:03 < vkx> #(adarq.org () 2 4 (3351378795))
$$0-$$9 = argv[0]=argv[9] .. argv[0] = ^a, argv[1] = dns, argv[2] = first argument
Tomorrow I need to make it parse strings properly, instead of just tokenizing everything into words based on spaces.. for eample
:
^a blah one two three four <-- it only works on this
^a blah one "two three" four <-- it doesn't work on this, $$3 would be "two, $$4 would be three".. need to parse it into one arg
v, ie, $$3 = two three
Finally I need to add $$@0-9, ie, $$@0 = every argument.. $$@1 = every argument except the 0th. and so on
im crazy tired today, but got alot done.. 1 week on 5 hours sleep per night, max.
pC