summaryrefslogtreecommitdiffstats
path: root/src/libs/zbxsysinfo/common/net.c
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-04-14 06:21:53 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-04-14 06:21:53 +0000
commit9d8cf662472860e667de2265f64d0d9203b5ac93 (patch)
tree8a1809785bd2b7220533c8dd8494a7fa826909a0 /src/libs/zbxsysinfo/common/net.c
parentb297ca1c6f50e3659892112ea4bcd2a363981abc (diff)
downloadzabbix-9d8cf662472860e667de2265f64d0d9203b5ac93.tar.gz
zabbix-9d8cf662472860e667de2265f64d0d9203b5ac93.tar.xz
zabbix-9d8cf662472860e667de2265f64d0d9203b5ac93.zip
win2nix EOL corrected
git-svn-id: svn://svn.zabbix.com/trunk@4003 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/common/net.c')
-rw-r--r--src/libs/zbxsysinfo/common/net.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/libs/zbxsysinfo/common/net.c b/src/libs/zbxsysinfo/common/net.c
index f2736ddd..b4bcfc5f 100644
--- a/src/libs/zbxsysinfo/common/net.c
+++ b/src/libs/zbxsysinfo/common/net.c
@@ -30,13 +30,13 @@
* 0 - NOT OK
* 1 - OK
* */
-int tcp_expect(
- const char *host,
- unsigned short port,
- const char *request,
- const char *expect,
- const char *sendtoclose,
- int *value_int
+int tcp_expect(
+ const char *host,
+ unsigned short port,
+ const char *request,
+ const char *expect,
+ const char *sendtoclose,
+ int *value_int
)
{
zbx_sock_t s;
@@ -47,36 +47,36 @@ int tcp_expect(
*value_int = 0;
- if( SUCCEED == (ret = zbx_tcp_connect(&s, host, port)) )
- {
- if( SUCCEED == (ret = zbx_tcp_send_raw(&s, request)) )
- {
- if( NULL != expect )
- {
- if( SUCCEED == (ret = zbx_tcp_recv(&s, &buf)) )
- {
+ if( SUCCEED == (ret = zbx_tcp_connect(&s, host, port)) )
+ {
+ if( SUCCEED == (ret = zbx_tcp_send_raw(&s, request)) )
+ {
+ if( NULL != expect )
+ {
+ if( SUCCEED == (ret = zbx_tcp_recv(&s, &buf)) )
+ {
if( 0 == strncmp(buf, expect, strlen(expect)) )
{
*value_int = 1;
- }
- }
- }
- else
- {
- *value_int = 1;
+ }
+ }
+ }
+ else
+ {
+ *value_int = 1;
}
if(SUCCEED == ret && NULL != sendtoclose)
- {
+ {
/* ret = (skip errors) */ zbx_tcp_send_raw(&s, sendtoclose);
- }
- }
+ }
+ }
}
- zbx_tcp_close(&s);
-
- if( FAIL == ret )
- {
- zabbix_log(LOG_LEVEL_DEBUG, "TCP expect error: %s", zbx_tcp_strerror());
+ zbx_tcp_close(&s);
+
+ if( FAIL == ret )
+ {
+ zabbix_log(LOG_LEVEL_DEBUG, "TCP expect error: %s", zbx_tcp_strerror());
}
return SYSINFO_RET_OK;