updates.
[silc.git] / lib / silcutil / unix / silcunixsockconn.c
index 4a55d5553729baaec2a1c75fb002cd4ed3546faf..330bab2dafa8631610875b698a913bc08dd36c5d 100644 (file)
@@ -33,6 +33,9 @@ int silc_socket_write(SilcSocketConnection sock)
   int fd = sock->sock;
   SilcBuffer src = sock->outbuf;
 
+  if (SILC_IS_DISABLED(sock))
+    return -1;
+
   SILC_LOG_DEBUG(("Writing data to socket %d", fd));
 
   if (src->len > 0) {
@@ -65,6 +68,9 @@ int silc_socket_read(SilcSocketConnection sock)
   unsigned char buf[SILC_SOCKET_READ_SIZE];
   int fd = sock->sock;
 
+  if (SILC_IS_DISABLED(sock))
+    return -1;
+
   SILC_LOG_DEBUG(("Reading data from socket %d", fd));
 
   /* Read the data from the socket. */