aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-08-29 11:46:53 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-08-29 11:46:53 +0800
commit5df01b29a27cb04e3fcb350cd70e59135e04849c (patch)
treeda121622a6bcf84ffcb3523e9368c82c7ddf43db /camel
parent1bde941413965ff017d373d6018835afec288734 (diff)
downloadgsoc2013-evolution-5df01b29a27cb04e3fcb350cd70e59135e04849c.tar.gz
gsoc2013-evolution-5df01b29a27cb04e3fcb350cd70e59135e04849c.tar.zst
gsoc2013-evolution-5df01b29a27cb04e3fcb350cd70e59135e04849c.zip
Fixed `set' to hold the correct value when setting the flags.
2002-08-28 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-openssl.c (stream_setsockopt): Fixed `set' to hold the correct value when setting the flags. svn path=/trunk/; revision=17913
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog3
-rw-r--r--camel/camel-tcp-stream-openssl.c16
2 files changed, 11 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 606363c027..5175ad3b4f 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,8 @@
2002-08-28 Jeffrey Stedfast <fejj@ximian.com>
+ * camel-tcp-stream-openssl.c (stream_setsockopt): Fixed `set' to
+ hold the correct value when setting the flags.
+
* camel-tcp-stream-raw.c (stream_setsockopt): Fixed `set' to hold
the correct value when setting the flags.
diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c
index 324e58dd08..abd2e5d9c0 100644
--- a/camel/camel-tcp-stream-openssl.c
+++ b/camel/camel-tcp-stream-openssl.c
@@ -832,16 +832,16 @@ stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
int flags;
- flags = fcntl (((CamelTcpStreamSSL *)stream)->priv->sockfd, F_GETFL);
+ flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
if (flags == -1)
return -1;
- data->value.non_blocking = flags & O_NONBLOCK;
+ data->value.non_blocking = flags & O_NONBLOCK ? TRUE : FALSE;
return 0;
}
- return getsockopt (((CamelTcpStreamSSL *)stream)->priv->sockfd,
+ return getsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
get_sockopt_level (data),
optname,
(void *) &data->value,
@@ -859,20 +859,20 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
int flags, set;
- flags = fcntl (((CamelTcpStreamSSL *)stream)->priv->sockfd, F_GETFL);
+ flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
if (flags == -1)
return -1;
- set = data->value.non_blocking ? 1 : 0;
- flags = (flags & ~O_NONBLOCK) | (set & O_NONBLOCK);
+ set = data->value.non_blocking ? O_NONBLOCK : 0;
+ flags = (flags & ~O_NONBLOCK) | set;
- if (fcntl (((CamelTcpStreamSSL *)stream)->priv->sockfd, F_SETFL, flags) == -1)
+ if (fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_SETFL, flags) == -1)
return -1;
return 0;
}
- return setsockopt (((CamelTcpStreamSSL *)stream)->priv->sockfd,
+ return setsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
get_sockopt_level (data),
optname,
(void *) &data->value,