Re: Linux 2.6.17-rc2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 19 Apr 2006, Linus Torvalds wrote:
On Wed, 19 Apr 2006, Diego Calleja wrote:

Could someone give a long high-level description of what splice() and tee()
are?

The _really_ high-level concept is that there is now a notion of a "random
kernel buffer" that is exposed to user space.

Suppose I am implementing hi performance HTTP (not caching) proxy that reads (part of?) HTTP header from A, decides where to send request from it, connects to the right host (B), sends (part of) HTTP header it already received and then wants to:

- make all further bytes from A be copied to B without using user space but no more than n bytes (n = request size it knows from header) or to the end of data (disconnect or something like that),

- make all bytes from B copied to A without using user space but no more than m bytes (m = response size from response header),

- stop both operations as soon as they copy enough data (assuming both sides are still connected) and then use sockets normally - to implement for example multiple requests per connection (keepalive).

Could it be done with splice() or tee() or some other kernel "accelerator"? Or should it be done in userspace by plain read and write?

And what if n or m is not known in advance but for example end of request is represented by <CR><LF><CR><LF> or something like that (common in some older protocols)?


Thanks in advance,

Grzegorz Kulewski

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux