freebsd-ports/net/nocatsplash/files/patch-src::http.c
Bruce M Simpson 4a0e773f1b Rename NoCatSplash to nocatsplash from rev 1.1.
Add IGNORE line for OSVERSION < 500000 due to security/pf dependency.

Requested by:	kris
2004-01-03 06:28:36 +00:00

35 lines
869 B
C

--- src/http.c.orig Wed Nov 19 16:26:07 2003
+++ src/http.c Wed Nov 19 16:29:22 2003
@@ -1,8 +1,10 @@
-# include <glib.h>
-# include <fcntl.h>
-# include <sys/stat.h>
+# include <sys/param.h>
# include <sys/types.h>
+# include <sys/stat.h>
# include <sys/socket.h>
+# include <netinet/in.h>
+# include <glib.h>
+# include <fcntl.h>
# include <arpa/inet.h>
# include <unistd.h>
# include <errno.h>
@@ -17,9 +19,6 @@
# define BUF_SIZ 16384
# endif
-// not portable, apparently
-# include <sys/sendfile.h>
-
GIOChannel *http_bind_socket( const char *ip, int port, int queue ) {
struct sockaddr_in addr;
int fd, r, n = 1;
@@ -354,7 +353,7 @@
return -1;
}
- r = sendfile( out_fd, in_fd, &len, s.st_size );
+ r = sendfile(in_fd, out_fd, 0, s.st_size, NULL, &len, 0);
if (r == -1) {
g_warning("http_sendfile send: %m");
return -1;