[patch] kHTTPd::sock_send_actor() 2.3.30-6

Mike Galbraith (mikeg@weiden.de)
Sun, 5 Dec 1999 10:33:05 +0100 (CET)


Hi,

A few kernel releases ago, I noticed that kHTTPd ceased to function.
Looking into it just now, it seems to only need a simple update to
sock_send_actor(). Stealing a new set of innards cured the problem.

-Mike

--- ./net/khttpd/datasending.c.org Sun Dec 5 08:44:39 1999
+++ ./net/khttpd/datasending.c Sun Dec 5 08:55:29 1999
@@ -55,16 +55,23 @@
It sends the data to the socket indicated by desc->buf.

*/
-static int sock_send_actor(read_descriptor_t * desc, const char *area, unsigned long size)
+static int sock_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size)
{
int written;
+ unsigned long kaddr;
unsigned long count = desc->count;
struct socket *sock = (struct socket *) desc->buf;
+ mm_segment_t old_fs;

if (size > count)
size = count;
- written = SendBuffer_async(sock,(char *)area,size);
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);

+ kaddr = kmap(page);
+ written = SendBuffer_async(sock,(char *)kaddr + offset,size);
+ kunmap(page);
+ set_fs(old_fs);
if (written < 0) {
desc->error = written;
written = 0;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/