Skip to main content
Home▸ Forums▸ 68kMLA▸ HTTP block device driver — #30
Post #30 by bbraun
Source Forum68kMLA
CategoryNetworking
Post DateWed, 24 Oct 2012 - 17:15
Original URLhttps://68kmla.org/bb/threads/http-block-device-driver.24359/
Post
HTTP Disk 0.5.cpt.hqx

I've refactored the write support just like the read stuff. I've re-enabled the read-only checkbox, marking it as enabled (read-only) by default. The control panel won't remember the state of the checkbox, it'll default to read-only every time.

One of the other changes I've done here is with HTTP header handling. As mentioned before, this is opening and closing a connection every time a request is made. This includes creating and releasing the MacTCP 'stream' object. A 'stream' can't be released until the connection has been closed by both sides. So if the server hasn't closed their side, but we've closed ours, the stream can't be released, which means no other disk read/write operations can occur. To help things out in this regard, I'm sending the 'Connection: close' HTTP header to tell the server to close the connection after our request, we aren't reusing it. This seems to help out reliability a bunch, at least on servers that honor it, and actually do close the connection promptly.

Anyway, what all this means is, I've had good success with both read and write doing this, at least on 7.6.1 with OpenTransport.

I haven't done any testing with actual MacTCP yet. I also know the Control Panel doesn't work in System 6. System 6 has all the control panels inside the one "Control Panel" desk accessory. System 7 has each control panel in its own window. This means all the UI elements in the dialog item list in System 6 are off by however many other UI elements are in the CP Desk Accessory (usually 2). I just need to update all my dialog item list indices to do the right thing here. Once I do that, this will hopefully work on System 6 with MacTCP as well.