Project

General

Profile

Bug #2036 ยป lighttpd-1.4.x-freebsd-sendfile.patch

peto, 2009-07-21 20:04

View differences:

network_freebsd_sendfile.c (working copy)
35 35
	chunk *c;
36 36
	size_t chunks_written = 0;
37 37

  
38
	{
39
		/*
40
		 * FreeBSD sendfile() is broken for UNIX sockets, at least in 7.1.
41
		 *
42
		 * http://redmine.lighttpd.net/issues/2036
43
		 * http://redmine.lighttpd.net/boards/2/topics/show/141
44
		 */
45
		struct sockaddr addr;
46
		socklen_t size = sizeof(addr);
47

  
48
		int ret = getsockname(fd, &addr, &size);
49
		if(ret != -1 && addr.sa_family == AF_UNIX)
50
			return network_write_chunkqueue_writev(srv, con, fd, cq);
51
	}
52

  
38 53
	for(c = cq->first; c; c = c->next, chunks_written++) {
39 54
		int chunk_finished = 0;
40 55

  
    (1-1/1)