From: William T. M. <wt...@du...> - 2002-11-10 19:04:51
|
On Sun, Nov 10, 2002 at 03:14:37AM -0800, Christian Hammond wrote: > > Basically, I need to be able to read in x amount of bytes, then say, > "Okay, you get 'y' many bytes and stick it in the file, and then call > me back when you're done and we'll continue this after I rest a bit." You're right, there's no easy way to do that using the current API. I was hoping that no sane protocol would break up a file and send headers in the middle, since it's not necessary over TCP. Apparently that was a bad assumption. :-( It shouldn't be too hard to allow what you want (I'm thinking just add another parameter to transfer_in_do() specifying the number of bytes to _actually_ read). But yes, an API change is necessary if this is what you need. > Oh, and while I'm here... the fprintf and fscanf calls in ft_callback > seem... unnecessary. I'm tired, so please forgive any errors that may > cause an endless loop of kernel panics, but wouldn't these be better? > > read(xfer->file, buf, remain); Yes, I'm aware that this would be much better than calling fscanf for every byte, but as I mentioned I'm afraid making major changes to ft.c would conflict with the GUI work. Unless Sean says this wouldn't be a problem? -- Wil |