Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2001 03:55:13 +0200 (CEST)
From:      Anders Nordby <anders@fix.no>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/28214: Fix port: ftp/oftpd
Message-ID:  <20010617015513.2DE483C8E@totem.fix.no>

next in thread | raw e-mail | index | archive | help

>Number:         28214
>Category:       ports
>Synopsis:       Fix port: ftp/oftpd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 16 19:00:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anders Nordby
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Fluxpod Information eXchange
>Environment:

kern.osreldate: 430000 (4.3-STABLE from medio may)

>Description:

Sendfile code in oftpd isn't really working well, it's making oftpd eat
obnoxious amonts of CPU time while repeatedly calling sendfile(). I'm
prodding the author about it. But I'd like it disabled for now, until a
proper fix is ready.

>How-To-Repeat:

	<Code/input/activities to reproduce the problem (multiple lines)>

>Fix:

diff -Nur oftpd.old/files/patch-ftp_session.c oftpd/files/patch-ftp_session.c
--- oftpd.old/files/patch-ftp_session.c	Thu Jan  1 01:00:00 1970
+++ oftpd/files/patch-ftp_session.c	Sun Jun 17 03:46:42 2001
@@ -0,0 +1,29 @@
+--- src/ftp_session.c.orig	Sun Jun 17 03:45:08 2001
++++ src/ftp_session.c	Sun Jun 17 03:46:26 2001
+@@ -1165,7 +1165,7 @@
+         /* for sendfile(), we still have to use a loop to avoid 
+            having our watchdog time us out on large files - it does
+            allow us to avoid an extra copy to/from user space */
+-#ifdef HAVE_SENDFILE
++/* #ifdef HAVE_SENDFILE
+         offset = f->file_offset;
+         file_size = stat_buf.st_size - offset;
+         while (offset < stat_buf.st_size) {
+@@ -1200,7 +1200,7 @@
+ 
+ 	    watchdog_defer_watched(f->watched);
+         }
+-#else
++#else */
+         for (;;) {
+             read_ret = read(file_fd, buf, sizeof(buf));
+ 	    if (read_ret == -1) {
+@@ -1219,7 +1219,7 @@
+ 
+ 	    watchdog_defer_watched(f->watched);
+ 	}
+-#endif  /* HAVE_SENDFILE */
++/* #endif */ /* HAVE_SENDFILE */
+     }
+ 
+     /* disconnect */
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010617015513.2DE483C8E>