Log of #mupdf at irc.freenode.net.

 <<<Back 1 day (to 2019/05/14)20190515 
weckso howdy, is there a channel for mujs?03:32.22 
ator weckso: no, this is where the mujs developers hang out.08:22.31 
  Robin_Watts: how did you test the content-range stuff? casper isn't returning multi-part stuff...09:11.03 
Robin_Watts ator: probably with a local http server.09:41.04 
ator I can't get Apache, SimpleHTTP, or lighttpd to return a Content-Range without asking for one first...09:48.09 
  if I ask for headers, they all reply "Accept-Ranges: bytes"09:48.52 
  so maybe the range-fetching code needs to first query for "Accept-Ranges: bytes" before launching the request09:49.10 
  if I ask for a small range at the first request, I never get a content-length09:49.30 
Robin_Watts Can't you always request a range and cope if it doesn't work ?09:59.30 
ator I tried that, but if you do it doesn't tell you the total file length.09:59.45 
Robin_Watts ISTR that I fetch in 4K chunks or something.09:59.45 
ator you fetch 1Mb chunks09:59.57 
  1<<20 block size10:00.05 
Robin_Watts really? crumbs.10:00.12 
  oh, to keep the size of the index small.10:00.30 
ator Robin_Watts: okay, I have something cooked up that reads the header first to get the size then downloads chunks.10:31.39 
  I suspect bugs in either the fill_point/map handling or the linearized loading because pdf_obj_read gets stuck in an infinity loop looking for the same object over and over.10:32.18 
  that didn't happen when loading the file linearly only10:32.33 
  Robin_Watts: if you have time to look, the code is on tor/progressive-robin10:33.29 
Robin_Watts ator: Still mired in cluster, but I hope I'm getting closer.11:14.48 
ator Robin_Watts: Remove stray fz_var, Bug 700301 and 700505 LGTM. should I push those?11:47.44 
Robin_Watts go for it.11:47.58 
weckso ahh, hopefully someone can give me a clue. trying to pass around a class with "js_newuserdata" (jsState) and getting an error "TypeError: not a jsState" see : https://pastebin.com/Fi48c8TN13:06.21 
  the API docs are...sparse? :P anyway, is there something else I need here?13:06.48 
Robin_Watts ator: I'm going to stop the cluster testing of those git commits until I sort stuff out.13:21.49 
  ator: OK, without wanting to curse it, the cluster is looking healthier.14:31.45 
  Let's look at tor/progressive14:31.53 
  ator: Do you happen to know what version your system curl is?14:54.11 
ator Robin_Watts: I just pushed some new bits to tor/master and tor/progressive-robin15:22.27 
  Robin_Watts: curl 7.52.115:22.41 
Robin_Watts ator: OK.15:22.46 
weckso ator: when do the mujs devs usually show up?15:27.41 
ator when I'm around ;)15:27.57 
weckso ator: did you see my earlier question with pastebin link?15:28.37 
ator you get a TypeError if the object you're trying to do js_touserdata is not a userdata object with the appropriate tag15:29.37 
  creating it looks fine15:30.12 
  the --js call-- needs more context if I'm to say what's wrong15:30.32 
weckso sec15:30.40 
ator you're passing stack index 0 to js_touserdata -- that's the 'this' object15:30.50 
weckso here's a more complete excerpt : https://pastebin.com/quGxthz815:34.20 
ator weckso: what is the job_text string?15:35.09 
weckso just a String object being passed into the init method15:35.47 
ator weckso: you also never do anything with the userdata object after creating it15:35.47 
  it's just lying around on the stack up to nothing good.15:36.06 
weckso from the examples, it looked like that was enough to have the class persist through JS calls, apparently not15:36.47 
ator mujs's userdata objects are Objects that wrap a native C pointer. it's not a general way to stow away random stuff.15:36.48 
  there are no classes in javascript 515:37.06 
  if you mean you want to save the 'new jsState' somewhere to get it in your callbacks, use the js_setuserdata/getuserdata function.15:37.54 
weckso right, but I want to make the class (jsState) available to future C calls for persistence15:37.54 
  ok, I will check that out, thanks15:38.16 
ator but that's a single value associated with the js_State.15:38.18 
weckso jsState is just a class pointer, that's fine I think15:38.39 
ator I'm assuming your new jsState instance is a singleton context you want to be able to access from all C functions called from mujs scripts.15:38.45 
weckso correct15:38.56 
ator then js_set/getuserdata is what you want15:39.13 
weckso excellent, thanks15:39.22 
ator weckso: sorry, my memory is slipping. you want js_getcontext/setcontext15:39.50 
weckso ahh, well let me see if I can find some examples for those then15:40.13 
ator weckso: mupdf has a fairly complete example in http://git.ghostscript.com/?p=mupdf.git;a=blob;f=source/tools/murun.c;h=44b7d46b7814dea34f1586ecb6f541767ae8ed66;hb=HEAD15:40.52 
weckso great, thanks again15:42.24 
  working great!15:52.13 
 Forward 1 day (to 2019/05/16)>>> 
ghostscript.com #ghostscript