rem: { #ifdef WITH_OPENSSL if (soap->ssl) { if (soap_valid_socket(soap->socket) && FD_ISSET(soap->socket, &sfd)) { char buf = '\0'; if (SSL_peek(soap->ssl, &buf, 1) <= 0) return SOAP_EOF; return SOAP_OK; } } else #endif if (soap_valid_socket(soap->socket) && FD_ISSET(soap->socket, &sfd))
add: { if (soap_valid_socket(soap->socket) && FD_ISSET((SOAP_SOCKET)soap->socket, &sfd) && (!FD_ISSET((SOAP_SOCKET)soap->socket, &rfd) || recv((SOAP_SOCKET)soap->socket, soap->tmpbuf, 1, MSG_PEEK) > 0))
context: soap_poll(struct soap *soap){ #ifndef WITH_LEAN  struct timeval timeout;  fd_set sfd, xfd;  int r;  timeout.tv_sec = 0;  timeout.tv_usec = 0;  FD_ZERO(&sfd);  FD_ZERO(&xfd);  if (soap_valid_socket(soap->socket))  { FD_SET(soap->socket, &sfd);    FD_SET(soap->socket, &xfd);    r = select(soap->socket + 1, NULL, &sfd, &xfd, &timeout);    if (r > 0 && FD_ISSET(soap->socket, &xfd))      r = -1;  }  else if (soap_valid_socket(soap->master))  { FD_SET(soap->master, &sfd);    r = select(soap->master + 1, NULL, &sfd, NULL, &timeout);  }  else    return SOAP_OK;  if (r > 0)  {#ifdef WITH_OPENSSL    if (soap->ssl)    { if (soap_valid_socket(soap->socket) && FD_ISSET(soap->socket, &sfd))      { char buf = '\0';	if (SSL_peek(soap->ssl, &buf, 1) <= 0)  	  return SOAP_EOF;        return SOAP_OK;      }    }    else#endif       if (soap_valid_socket(soap->socket) && FD_ISSET(soap->socket, &sfd))      return SOAP_OK;    return SOAP_EOF;  }  if (r < 0)  { soap->errnum = soap_socket_errno;    if ((soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) && soap_socket_errno != SOAP_EINTR)    { soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_poll()", SOAP_TCP_ERROR);      return soap->error = SOAP_TCP_ERROR;    }  }  else    soap->errnum = 0;  return SOAP_EOF;#else  return SOAP_OK;#endif}