rem: soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt TCP_NODELAY failed in soap_bind()", SOAP_TCP_ERROR);
add: soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_bind()", SOAP_TCP_ERROR);
context: soap_bind(struct soap *soap, const char *host, int port, int backlog){ struct sockaddr_in sockaddr;/* WR[ */#ifdef WITH_IPV6  struct addrinfo *addrinfo;  struct addrinfo hints;  struct addrinfo resaddr;  struct sockaddr_storage addrstorage;  int err;#endif /* WITH_IPV6 *//* ]WR */#ifndef WITH_LEAN  int len = SOAP_BUFLEN;  int set = 1;#endif  if (soap_valid_socket(soap->master))  { soap->fclosesocket(soap, (SOAP_SOCKET)soap->master);    soap->master = SOAP_INVALID_SOCKET;  }  soap->socket = SOAP_INVALID_SOCKET;  soap->errmode = 1;  if (tcp_init(soap))  { soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }/* WR[ */#ifdef WITH_IPV6  memset((void*)&hints, 0, sizeof(hints));  hints.ai_family = PF_UNSPEC;  hints.ai_socktype = SOCK_STREAM;  hints.ai_flags = AI_PASSIVE;  soap->errmode = 2;  if (host)    err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo);  else    err = getaddrinfo(NULL, soap_int2s(soap, port), &hints, &addrinfo);  if (NULL != addrinfo)  {    resaddr = *addrinfo;    addrstorage = *((struct sockaddr_storage *) addrinfo->ai_addr);    resaddr.ai_addr = (struct sockaddr *) &addrstorage;    freeaddrinfo(addrinfo);  }  if (err)  { soap_set_receiver_error(soap, gai_strerror(err), "TCP getaddrinfo failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }  soap->errmode = 0;  if ((soap->master = socket(resaddr.ai_family, resaddr.ai_socktype, resaddr.ai_protocol)) < 0)  { soap->errnum = soap_socket_errno;    soap_set_receiver_error(soap, tcp_error(soap), "TCP socket failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }#else /* WITH_IPV6 *//* ]WR */  soap->errmode = 0;  if ((soap->master = (int)socket(AF_INET, SOCK_STREAM, 0)) < 0)  { soap->errnum = soap_socket_errno;    soap_set_receiver_error(soap, tcp_error(soap), "TCP socket failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }/* WR[ */#endif /* WITH_IPV6 *//* ]WR */#ifdef SOCKET_CLOSE_ON_EXEC#ifdef WIN32#ifndef UNDER_CE  SetHandleInformation((HANDLE)soap->master, HANDLE_FLAG_INHERIT, 0);#endif#else  fcntl (soap->master, F_SETFD, 1);#endif#endif#ifndef WITH_LEAN  if (soap->bind_flags && setsockopt((SOAP_SOCKET)soap->master, SOL_SOCKET, soap->bind_flags, (char*)&set, sizeof(int)))  { soap->errnum = soap_socket_errno;    soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }  if (soap->keep_alive && setsockopt((SOAP_SOCKET)soap->master, 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_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }  if (setsockopt((SOAP_SOCKET)soap->master, 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_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }  if (setsockopt((SOAP_SOCKET)soap->master, 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_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }#ifdef TCP_NODELAY  if (setsockopt((SOAP_SOCKET)soap->master, 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_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }#endif#endif/* WR[ */#ifdef WITH_IPV6  soap->errmode = 0;  if (bind(soap->master, resaddr.ai_addr, resaddr.ai_addrlen) || listen(soap->master, backlog))  {     soap->errnum = soap_socket_errno;    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));    soap_closesock(soap);    soap_set_receiver_error(soap, tcp_error(soap), "TCP bind failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }  #else /* WITH_IPV6 *//* ]WR */  memset((void*)&sockaddr, 0, sizeof(sockaddr));  sockaddr.sin_family = AF_INET;  soap->errmode = 2;  if (host)  { if (soap->fresolve(soap, host, &sockaddr.sin_addr))    { soap_set_receiver_error(soap, tcp_error(soap), "TCP get host by name failed in soap_bind()", SOAP_TCP_ERROR);      return SOAP_INVALID_SOCKET;    }  }  else    sockaddr.sin_addr.s_addr = htonl(INADDR_ANY);  sockaddr.sin_port = htons((short)port);  soap->errmode = 0;  if (bind((SOAP_SOCKET)soap->master, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) || listen((SOAP_SOCKET)soap->master, backlog))  { soap->errnum = soap_socket_errno;    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));    soap_closesock(soap);    soap_set_receiver_error(soap, tcp_error(soap), "TCP bind failed in soap_bind()", SOAP_TCP_ERROR);    return SOAP_INVALID_SOCKET;  }  /* WR[ */#endif /* WITH_IPV6 *//* ]WR */#ifdef WITH_OPENSSL  if (!soap->ctx && (soap->error = soap->fsslauth(soap)))    return SOAP_INVALID_SOCKET;#endif  return soap->master;}