rem: soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
add: soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
context: soap_accept(struct soap *soap){ /* WR[ */#ifdef WITH_IPV6  struct sockaddr_storage sockaddr;#else /* WITH_IPV6 *//* ]WR */  struct sockaddr_in sockaddr;/* WR[ */#endif/* ]WR */  int n = (int)sizeof(sockaddr);#ifndef WITH_LEAN  int len = SOAP_BUFLEN;  int set = 1;#endif  soap->error = SOAP_OK;  memset((void*)&sockaddr, 0, sizeof(sockaddr));  soap->socket = SOAP_INVALID_SOCKET;  soap->errmode = 0;  if (soap_valid_socket(soap->master))  { for (;;)    { #ifndef WITH_LEAN      if (soap->accept_timeout)      { struct timeval timeout;        fd_set fd;        if (soap->accept_timeout > 0)        { timeout.tv_sec = soap->accept_timeout;          timeout.tv_usec = 0;        }        else        { timeout.tv_sec = -soap->accept_timeout/1000000;          timeout.tv_usec = -soap->accept_timeout%1000000;        }        FD_ZERO(&fd);        FD_SET((SOAP_SOCKET)soap->master, &fd);        for (;;)        { int r = select((SOAP_SOCKET)(soap->master + 1), &fd, &fd, NULL, &timeout);          if (r > 0)            break;          if (!r)          { soap->errnum = 0;            soap_set_receiver_error(soap, "Timeout", "TCP accept failed in soap_accept()", SOAP_TCP_ERROR);            return SOAP_INVALID_SOCKET;          }          if (soap_socket_errno != SOAP_EINTR)          { soap->errnum = soap_socket_errno;            soap_closesock(soap);            soap_set_sender_error(soap, tcp_error(soap), "TCP accept failed in soap_accept()", SOAP_TCP_ERROR);            return SOAP_INVALID_SOCKET;          }        }#if defined(WIN32)	{ u_long nonblocking = 1;          ioctlsocket((SOAP_SOCKET)soap->master, FIONBIO, &nonblocking);        }#elif defined(VXWORKS)        { vx_nonblocking = TRUE;          ioctl((SOAP_SOCKET)soap->master, FIONBIO, (int)(&vx_nonblocking));        }#else        fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL)|O_NONBLOCK);#endif      }      else#if defined(WIN32)      { u_long blocking = 0;        ioctlsocket((SOAP_SOCKET)soap->master, FIONBIO, &blocking);      }/* WR[ */#elif defined(VXWORKS)      { vx_nonblocking = FALSE;        ioctl((SOAP_SOCKET)soap->master, FIONBIO, (int)(&vx_nonblocking));      }/* ]WR */#else        fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL)&~O_NONBLOCK);#endif#endif      soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*)&sockaddr, &n);      if (soap_valid_socket(soap->socket))      {/* WR[ */#ifdef WITH_IPV6/* Use soap->host to store the numeric form of the remote host */        getnameinfo((struct sockaddr*)&sockaddr, n, soap->host, sizeof(soap->host), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV);         DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket %d from %s\n", soap->socket, soap->host));        soap->ip = 0; /* info stored in soap->host */        soap->port = 0; /* info stored in soap->host */#else /* WITH_IPV6 *//* ]WR */        soap->ip = ntohl(sockaddr.sin_addr.s_addr);        soap->port = (int)ntohs(sockaddr.sin_port); /* does not return port number on some systems */        DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket %d at port %d from IP %d.%d.%d.%d\n", soap->socket, soap->port, (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF));/* WR[ */#endif /* WITH_IPV6 *//* ]WR */        soap->keep_alive = ((soap->imode & SOAP_IO_KEEPALIVE) != 0);#ifndef WITH_LEAN	if (soap->accept_flags & SO_LINGER)        { struct linger linger;          memset((void*)&linger, 0, sizeof(linger));          linger.l_onoff = 1;          linger.l_linger = 0;	  if (setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))          { soap->errnum = soap_socket_errno;	    soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR);            return SOAP_INVALID_SOCKET;	  }        }        if ((soap->accept_flags & ~SO_LINGER) && setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, soap->accept_flags & ~SO_LINGER, (char*)&set, sizeof(int)))        { soap->errnum = soap_socket_errno;          soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt failed in soap_accept()", SOAP_TCP_ERROR);          return SOAP_INVALID_SOCKET;        }        if (soap->keep_alive && setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))        { soap->errnum = soap_socket_errno;          soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);          return SOAP_INVALID_SOCKET;        }        if (setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))        { soap->errnum = soap_socket_errno;          soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);          return SOAP_INVALID_SOCKET;        }        if (setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))        { soap->errnum = soap_socket_errno;          soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);          return SOAP_INVALID_SOCKET;        }#ifdef TCP_NODELAY        if (setsockopt((SOAP_SOCKET)soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))        { soap->errnum = soap_socket_errno;          soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR);          return SOAP_INVALID_SOCKET;        }#endif#endif        if (soap->accept_timeout)        {#if defined(WIN32)          u_long blocking = 0;          ioctlsocket((SOAP_SOCKET)soap->master, FIONBIO, &blocking);          ioctlsocket((SOAP_SOCKET)soap->socket, FIONBIO, &blocking);/* WR[ */#elif defined(VXWORKS)          vx_nonblocking = FALSE;          ioctl((SOAP_SOCKET)soap->master, FIONBIO, (int)(&vx_nonblocking));          ioctl((SOAP_SOCKET)soap->socket, FIONBIO, (int)(&vx_nonblocking));/* ]WR */#elif defined(PALM)          fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL,0)&~O_NONBLOCK);          fcntl((SOAP_SOCKET)soap->socket, F_SETFL, fcntl((SOAP_SOCKET)soap->socket, F_GETFL,0)&~O_NONBLOCK);#elif defined(SYMBIAN)          long blocking = 0;          ioctl((SOAP_SOCKET)soap->master, 0/*FIONBIO*/, &blocking);#else          fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL)&~O_NONBLOCK);          fcntl((SOAP_SOCKET)soap->socket, F_SETFL, fcntl((SOAP_SOCKET)soap->socket, F_GETFL)&~O_NONBLOCK);#endif	}        return soap->socket;      }      if (soap_socket_errno != SOAP_EINTR && soap_socket_errno != SOAP_EAGAIN)      { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));        soap->errnum = soap_socket_errno;        soap_set_receiver_error(soap, tcp_error(soap), "TCP accept failed in soap_accept()", SOAP_TCP_ERROR);        return SOAP_INVALID_SOCKET;      }    }  }  else  { soap->errnum = 0;    soap_set_receiver_error(soap, tcp_error(soap), "TCP no master socket in soap_accept()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }}