svn rev #22053: tools/gssmonger/trunk/gssmaggot/
raeburn@MIT.EDU
raeburn at MIT.EDU
Mon Feb 23 21:00:31 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22053
Commit By: raeburn
Log Message:
Move setnolinger,setnodelay to netutil.c and use in one more case.
Changed Files:
U tools/gssmonger/trunk/gssmaggot/netrw.c
U tools/gssmonger/trunk/gssmaggot/netutil.c
Modified: tools/gssmonger/trunk/gssmaggot/netrw.c
===================================================================
--- tools/gssmonger/trunk/gssmaggot/netrw.c 2009-02-24 00:12:35 UTC (rev 22052)
+++ tools/gssmonger/trunk/gssmaggot/netrw.c 2009-02-24 02:00:31 UTC (rev 22053)
@@ -116,20 +116,6 @@
#define PF_NAME(x) ((x) == PF_INET ? "INET" : ((x) == PF_INET6 ? "INET6" : "Unknown"))
-int
-setnolinger(SOCKET s)
-{
- static const struct linger ling = { 0, 0 };
- return setsockopt(s, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
-}
-#include <netinet/tcp.h>
-int
-setnodelay(SOCKET s)
-{
- static const int one = 1;
- return setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
-}
-
/*++**************************************************************
NAME: MakeSocket
Modified: tools/gssmonger/trunk/gssmaggot/netutil.c
===================================================================
--- tools/gssmonger/trunk/gssmaggot/netutil.c 2009-02-24 00:12:35 UTC (rev 22052)
+++ tools/gssmonger/trunk/gssmaggot/netutil.c 2009-02-24 02:00:31 UTC (rev 22053)
@@ -113,6 +113,25 @@
}
+int
+setnolinger(SOCKET s)
+{
+ static const struct linger ling = { 0, 0 };
+ return setsockopt(s, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
+}
+/* This is a hack. It causes us to send lots of tiny packets. Better
+ would be to do some buffering in this program, and leave this
+ socket options disabled. */
+#ifndef _WIN32
+#include <netinet/tcp.h>
+#endif
+int
+setnodelay(SOCKET s)
+{
+ static const int one = 1;
+ return setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
+}
+
#ifdef HAVE_NETIO
/* Under NT, we just want the netio headers for
@@ -735,7 +754,6 @@
**************************************************************--*/
-
BOOL
ConnectToPeer( IN SOCKET Peer,
IN USHORT HostPort,
@@ -771,6 +789,9 @@
using the channel already setup. */
SS_PORT(&addr) = htons( HostPort );
+
+ setnodelay(sock);
+ setnolinger(sock);
/* Now, call the peer. */
More information about the cvs-krb5
mailing list