D4R issues
Malcolm Hussain-Gambles (1596) 811 posts |
Looks like version 0.01a was a botch! |
Rick Murray (539) 13840 posts |
You too huh? ;-) The way I do this now is to embed a magic name that is used for debugging, in my case something like http://azumi/blahblah... Edit: just remembered if I use “azumi.home” the router will DNS that to the PC that’s running the server. Or “raspberrypi.home” for the Pi, “kiseki.home” should be the iPad (not sure this one works), and “akirei.home” ought to be this phone on the network unless it does something dumb like identify itself as “samsung.home” or the like. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’ve just eaten, but a quick google search turned up this |
Malcolm Hussain-Gambles (1596) 811 posts |
OK I’ve uploaded version 0.02a – essentially the same except I’m not setting the default value as my internal test server! |
Malcolm Hussain-Gambles (1596) 811 posts |
I think I’m having a really bad night. The Download_WindowHandle is being set correctly, the icon number is 4 and nothing happens and there is no error trapped. My thoughts are that it should work and there is possibly a buffer overflow being caused somewhere resulting in some “undefined” behaviour? |
Richard Walker (2090) 431 posts |
A long time ago, I wrote a couple of simple C applications using OSLib and OSLibSupport (for Toolbox). I thought it was pretty good. From what I remember, OSLib maps all the SWIs to easy-to-use C functions. So it’s not so much the OSLib Help that will tell what you need… more likely the regular SWI documentation in various StrongHelps and the PRMs. |
Malcolm Hussain-Gambles (1596) 811 posts |
I’m using toolbox for most of my stuff, not OSLib |
WPB (1391) 352 posts |
Malcolm, did you fix your problem yet? Can’t see the issue myself atm. Have you tried doing a button_get_value on the same window/component to see if you get what you’d expect back? Might shed some light… Just on the subject of OSLib, I definitely recommend you switch from RISC_OSLib and the Acorn toolbox library to OSLib. IMHO, it’s much, much better. |
Chris Johnson (125) 825 posts |
Yes. OSLib has very comprehensive support for the Toolbox (the official Toolbox – there isn’t any support for third party releases such as Tabs, but then I assume the Acorn toolbox library is the same). |
Richard Walker (2090) 431 posts |
Malcolm: What are you using? You complained about OSLib, but then said ‘Toolbox’. I’m confused. |
Malcolm Hussain-Gambles (1596) 811 posts |
You’re confused, that makes two of us ;-) |
Chris Johnson (125) 825 posts |
I have given your second version a quick test. Tried a zip and a jpeg from my own (remote) web site. It did not error in the same way as before. However, in both cases it just hourglassed for a long time (mins). It did create an empty file on the hard drive, ‘apparently’ 16384 bytes long. The only way out in the end was Alt-break, when the file reverted to zero length. The activity lights on the ethernet switch showed very little activity, so I do not think any downloading occurred at all. Netsurf downloaded the same zip in a couple of seconds. Not much help I am afraid. |
WPB (1391) 352 posts |
I think Malcolm is using the C stubs provided as part of the DDE, and referenced in the Toolbox manual itself. I don’t know if it’s classed as part of RISC_OSLib or not, but I expect that’s what he’s using. OSLib’s interface is of course almost identical, but there are subtle differences, and IMHO, OSLib’s overall coverage is more consistent and logical. |
Andrew Rawnsley (492) 1445 posts |
I think there may be some confusion here between the different library names. RISC_OSlib is different to OS_Lib – the former is was Acorn’s first attempt at a “slightly higher level” WIMP library (amongst other things), whilst the latter provides friendly C veneers to almost all RISC OS swis with sensible types/structs etc defined. It’s “close to the metal” but makes for friendlier code. As such, it’s entirely practical to code toolbox apps using OSlib as a veneer to swis (including the toolbox swis themselves) using as much or as little of Acorn’s Toolbox support libraries as you desire. |
Malcolm Hussain-Gambles (1596) 811 posts |
mmmm. This is an example of my “testing” *SDFS::HardDisc0.$.Programming.!D4R.D4R download.fedoraproject.org /pub/fedora/linux/releases/21/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-21-5.iso This doesn’t really work as it returns headers in the file, which contain the Location: Header like so: HTTP/1.1 302 Found but if you then change it to the download location in the Location: Header….e.g. *SDFS::HardDisc0.$.Programming.!D4R.D4R mirror.sov.uk.goscomb.net /fedora/linux/releases/21/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-21-5.iso SDFS::HardDisc0.$.test/iso This works OK for me, so I’m guessing your input values are wrong. The first argument is the dns name The hourglass issue, can only be either a DNS issue or a problem connecting to your server. Given the fact that the link you are using works using netsurf I’m guessing you’re passing something “funny” to D4R. Could you send me the params you are using and I’ll take a look. malcolm at paymentlabs dot com ;-) Another thought, my d4r binray is 33504 bytes. |
Steve Pampling (1551) 8170 posts |
For a particular definition of “interesting” :) |
Malcolm Hussain-Gambles (1596) 811 posts |
My problem there is writing the resolver code looks fairly straight forward, but the module side of things I’m struggling with. |
Steve Pampling (1551) 8170 posts |
The module shell that Rick put up the other week in reply to a query would probably provide your wrapper. |
Rick Murray (539) 13840 posts |
Module wrapper → https://www.riscosopen.org/forum/forums/3/topics/3073#posts-39049 Steve’s tweaks → https://www.riscosopen.org/forum/forums/3/topics/3073#posts-39056
It isn’t unreasonable for a person to think that the http fetcher would follow the redirect itself (perhaps spitting a message to the user to tell them this). [from the other thread]
Umm… YouTube? I’d expect an entire movie-length video (SD-res) for that sort of file size! Or are you using an ancient codec like MPEG2? |
Chris Johnson (125) 825 posts |
This is getting a bit confusing with two threads being used almost alternately 8) OK. I’ll give it another go tomorrow. I am pretty sure I was setting up the command line correctly, but I will doubly check next time. The d4r binary is indeed 33504 bytes, so I guess I am using the correct one. I was doing this on the Panda. Maybe I’ll try on different hardware if I still do not get any success. |
Chris Johnson (125) 825 posts |
Update. Have just tried it on the Iyonix and it seems to be working correctly on that. Strange. I’ll check on the Panda again tomorrow. |
Chris Johnson (125) 825 posts |
OK. Gave the Panda a full reboot (normally on 24/7) and things are hunky dory. (Was chasing a nasty little bug a day or so ago which was trashing memory in one of my apps I was developing – must have done more than just in-app damage). Tried a few zips from remote sites – it is very fast compared with Netsurf as you say, and is probably being limited by my relatively slow connection – only syncing at about 4 Mb/s so max transfer will be stuck at about 330 MB/s (and this is on the edge of Edinburgh!). I’ll try some batch downloads via an obey file later just for the hell of it. |
Malcolm Hussain-Gambles (1596) 811 posts |
RISC OS is a nightmare for things like this. Sockets etc. seem to be the worst for trashing things badly. @Rick 302’s will be handled, the videos are designed to be played on KinoAmp, so are mpeg 1 or 2. The videos are around 1-1.5 hours long. A base module isn’t my problem, debugging it is. (another abort on data transfer/filecore in use…) |
Steve Pampling (1551) 8170 posts |
Bit of a grand description for a line defining a SWI as a number at the start and a semicolon at the end as a reminder that the “END” needs a following carriage return. It would be a bit better if the SWI definition was replaced with where a sub-directory called header had a file called SWIS-all which was a list of all the SWIs in the system defined in the same form sort like:
|
Malcolm Hussain-Gambles (1596) 811 posts |
Well the good news is I’ve managed to get a working version of a dns client in around 2 hours. The licence is amusing, but it’s definately worth a beer! |