[SVN-NetXMS] revision 3388

From: NetXMS.org SVN Server <svn_at_DOMAIN_REMOVED>
Date: Mon, 21 Jul 2008 20:55:07 +0300

* { font-family: Consolas, Lucida Console, Courier New; font-size: 100%; }
h1 { font-size: 150%; }
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 100%; width: 100%; }
.highlight span { width: 100%; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; }
body { background: #ffffff; }
body .c { color: #999988; font-style: italic } /* Comment */
body .err { color: #a61717; background-color: #e3d2d2 } /* Error */
body .k { font-weight: bold } /* Keyword */
body .o { font-weight: bold } /* Operator */
body .cm { color: #999988; font-style: italic } /* Comment.Multiline */
body .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
body .c1 { color: #999988; font-style: italic } /* Comment.Single */
body .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
body .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
body .ge { font-style: italic } /* Generic.Emph */
body .gr { color: #aa0000 } /* Generic.Error */
body .gh { color: #999999 } /* Generic.Heading */
body .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
body .go { color: #888888 } /* Generic.Output */
body .gp { color: #555555 } /* Generic.Prompt */
body .gs { font-weight: bold } /* Generic.Strong */
body .gu { color: #aaaaaa } /* Generic.Subheading */
body .gt { color: #aa0000 } /* Generic.Traceback */
body .kc { font-weight: bold } /* Keyword.Constant */
body .kd { font-weight: bold } /* Keyword.Declaration */
body .kp { font-weight: bold } /* Keyword.Pseudo */
body .kr { font-weight: bold } /* Keyword.Reserved */
body .kt { color: #445588; font-weight: bold } /* Keyword.Type */
body .m { color: #009999 } /* Literal.Number */
body .s { color: #bb8844 } /* Literal.String */
body .na { color: #008080 } /* Name.Attribute */
body .nb { color: #999999 } /* Name.Builtin */
body .nc { color: #445588; font-weight: bold } /* Name.Class */
body .no { color: #008080 } /* Name.Constant */
body .ni { color: #800080 } /* Name.Entity */
body .ne { color: #990000; font-weight: bold } /* Name.Exception */
body .nf { color: #990000; font-weight: bold } /* Name.Function */
body .nn { color: #555555 } /* Name.Namespace */
body .nt { color: #000080 } /* Name.Tag */
body .nv { color: #008080 } /* Name.Variable */
body .ow { font-weight: bold } /* Operator.Word */
body .w { color: #bbbbbb } /* Text.Whitespace */
body .mf { color: #009999 } /* Literal.Number.Float */
body .mh { color: #009999 } /* Literal.Number.Hex */
body .mi { color: #009999 } /* Literal.Number.Integer */
body .mo { color: #009999 } /* Literal.Number.Oct */
body .sb { color: #bb8844 } /* Literal.String.Backtick */
body .sc { color: #bb8844 } /* Literal.String.Char */
body .sd { color: #bb8844 } /* Literal.String.Doc */
body .s2 { color: #bb8844 } /* Literal.String.Double */
body .se { color: #bb8844 } /* Literal.String.Escape */
body .sh { color: #bb8844 } /* Literal.String.Heredoc */
body .si { color: #bb8844 } /* Literal.String.Interpol */
body .sx { color: #bb8844 } /* Literal.String.Other */
body .sr { color: #808000 } /* Literal.String.Regex */
body .s1 { color: #bb8844 } /* Literal.String.Single */
body .ss { color: #bb8844 } /* Literal.String.Symbol */
body .bp { color: #999999 } /* Name.Builtin.Pseudo */
body .vc { color: #008080 } /* Name.Variable.Class */
body .vg { color: #008080 } /* Name.Variable.Global */
body .vi { color: #008080 } /* Name.Variable.Instance */
body .il { color: #009999 } /* Literal.Number.Integer.Long */

Info

Revision:3388
Author:victor

Date:2008-07-21 20:55:07 +0300 (Mon, 21 Jul 2008)

Comment:non-blocking sockets used in AgentConnection

Changes
U trunk/configure.ac
U trunk/include/netxms-version.h
U trunk/include/nms_common.h
U trunk/src/server/libnxsrv/agent.cpp

Diff
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2008-07-21 16:35:10 UTC (rev 3387)
+++ trunk/configure.ac 2008-07-21 17:55:07 UTC (rev 3388)
@@ -4,7 +4,7 @@
 # Configure script
 #
 
-AC_INIT([NetXMS], [0.2.22-rc1], [NetXMS Team &lt;bugs_at_netxms.org&gt;])
+AC_INIT([NetXMS], [0.2.22-rc3], [NetXMS Team &lt;bugs_at_netxms.org&gt;])
 AC_CONFIG_AUX_DIR(config)
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE

Modified: trunk/include/netxms-version.h
===================================================================
--- trunk/include/netxms-version.h 2008-07-21 16:35:10 UTC (rev 3387)
+++ trunk/include/netxms-version.h 2008-07-21 17:55:07 UTC (rev 3388)
@@ -33,7 +33,7 @@
 #define NETXMS_VERSION_MINOR 2
 #define NETXMS_VERSION_BUILD 22
 #define NETXMS_VERSION_HOTFIX 0
-#define NETXMS_VERSION_STRING _T(&quot;0.2.22-rc1&quot;)
+#define NETXMS_VERSION_STRING _T(&quot;0.2.22-rc3&quot;)
 
 
 //

Modified: trunk/include/nms_common.h
===================================================================
--- trunk/include/nms_common.h 2008-07-21 16:35:10 UTC (rev 3387)
+++ trunk/include/nms_common.h 2008-07-21 17:55:07 UTC (rev 3388)
@@ -150,6 +150,10 @@
 
 #define SetSocketReuseFlag(sd)
 #define SELECT_NFDS(x) ((int)(x))
+#define SetSocketNonBlocking(s) { \
+ u_long one = 1; \
+ ioctlsocket(s, FIONBIO, &amp;one); \
+}
 
 #ifdef UNDER_CE
 #define O_RDONLY 0x0004
@@ -232,13 +236,17 @@
 #define WSAEINTR EINTR
 #define INVALID_SOCKET (-1)
 
-//#define SetSocketReuseFlag(sd)
 #define SetSocketReuseFlag(sd) { \
         int nVal = 1; \
         setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (const void *)&amp;nVal, \
                         (socklen_t)sizeof(nVal)); \
 }
 
+#define SetSocketNonBlocking(s) { \
+ int f = fcntl(s, F_GETFL); \
+ if (f != -1) fcntl(s, F_SETFL, f | O_NONBLOCK); \
+}
+
 #define SELECT_NFDS(x) (x)
 
 #else /* not _WIN32 and not _NETWARE */
@@ -388,6 +396,11 @@
                         (socklen_t)sizeof(nVal)); \
 }
 
+#define SetSocketNonBlocking(s) { \
+ int f = fcntl(s, F_GETFL); \
+ if (f != -1) fcntl(s, F_SETFL, f | O_NONBLOCK); \
+}
+
 #define SELECT_NFDS(x) (x)
 
 #if !(HAVE_SOCKLEN_T) &amp;&amp; !defined(_USE_GNU_PTH)

Modified: trunk/src/server/libnxsrv/agent.cpp
===================================================================
--- trunk/src/server/libnxsrv/agent.cpp 2008-07-21 16:35:10 UTC (rev 3387)
+++ trunk/src/server/libnxsrv/agent.cpp 2008-07-21 17:55:07 UTC (rev 3388)
@@ -385,6 +385,9 @@
       goto connect_cleanup;
    }
 
+ // Set non-blocking mode
+ SetSocketNonBlocking(m_hSocket);
+
    if (!NXCPGetPeerProtocolVersion(m_hSocket, &amp;m_nProtocolVersion))
    {
       dwError = ERR_INTERNAL_ERROR;
Received on Mon Jul 21 2008 - 20:55:07 EEST

This archive was generated by hypermail 2.2.0 : Mon Jul 21 2008 - 18:53:17 EEST