On Wed, Mar 11, 2009 at 19:11, Ted Unangst <ted.unan...@gmail.com> wrote:
> On Wed, Mar 11, 2009 at 12:01 PM, Alexey Suslikov
> <alexey.susli...@gmail.com> wrote:
>> On Wed, Mar 11, 2009 at 17:56, Ted Unangst <ted.unan...@gmail.com> wrote:
>>> If using a 64-bit machine fixes it, then the type in question is not off_t.
>>>
>>
>> Maybe you should try to transfer (using stock httpd) at least 3Gb file
>> on i386?
>
> I didn't say it wasn't a problem, I said your diagnosis was incorrect.
>
>> Also, I have the following in my archives:
>>>
>>> http://marc.info/?t=121379382200010&r=1&w=2
>
> from that very thread, the problem is using long *instead* of off_t.
> Using off_t would fix the problem.
>
> http://marc.info/?l=openbsd-bugs&m=121379609212212&w=2
>

I can't recall exact code from httpd, but how about libexec/ftpd:

...
extern  off_t restart_point;
...
        if (restart_point) {
                if (type == TYPE_A) {
                        off_t i, n;
                        int c;

                        n = restart_point;
                        i = 0;
                        while (i++ < n) {
                                if ((c = getc(fin)) == EOF) {
                                        if (ferror(fin)) {
                                                perror_reply(550, name);
                                                goto done;
                                        } else
                                                break;
                                }
                                if (c == '\n')
                                        i++;
                        }
                } else if (lseek(fileno(fin), restart_point, SEEK_SET) < 0) {
                        perror_reply(550, name);
                        goto done;
                }
        }
...

Above code effectively results in inability to REST beyond 2Gb on
i386 however sequential read from position 0 will be ok.

Alexey

Reply via email to