Does it make sense to implement Server Side Includes by changing RpHSReadFileStatus and editing the data in pFileReq->io_request->buffer before blessing the file read? If so, am I allowed to realloc the buffer to the new size? Where is the buffer size kept? I’ve found the current byte count in RPFS_BUFFER_T * pFileReq, but not the size of the buffer pointed to by pFileReq->io_request->buffer. Or is there a better way? Thanks, Larry Martin www.GlueLogix.com
Followup:Per gdb and image.map, pFileReq->io_request->buffer is in static allocated memory labeled gRpData belonging to AsGlobal.o. Also per gdb, RpHSReadFile param theByteCount is always 0x1000. That number is suspiciously round, and NOT equal to the file size. So, seems reasonable that the file data buffers are static allocated, with size 0x1000. I should therefore be able to change the data in buffer and adjust pFileReq->io_request->bytes_transferred before releasing the read (i.e. returning good status from RpHSReadFileStatus), and everything should work out Ok. Anybody want to weigh in? Using NetOS6.0e on Digi ConnectMe.
I’m not sure exactly what you want to do, but maybe this is an alternative. You can use the RpIdentifier and RpUseIdentifier to share common page information between pages. I use this method to define page header footer and other things in one file. The different sections in this file is maked by RpIdentifier. Then on all other pages i refer to the definitions by using the RpUseIdentifier. This way all these things are only included once in the generated code.
Followup 2: That works, sort of. The text substitution works, but the HTTP Content-Length is still the size of the file as it sits on disk. I can’t patch that unless the file is less than 4k (0x1000), the size of the file data buffer. Larry Martin www.GlueLogix.com
Nope, can’t patch it at all. Digi tech support says there is no way to change HTTP Content-Length before sending the message. So I am padding my HTML files with a bunch of spaces at the end, and just letting the browser truncate that.
Thanks for the info, but I don’t want to use Rp* at all. My goal is to finish the firmware and forget about it. My customer should be able to manage their own web pages on disk without recompiling the app. What’s got to happen eventually is a new web server. Larry.