Lines Matching full:if
187 if (!isOpen()) { in hasPendingDataToRead()
195 if (r == -1) { in hasPendingDataToRead()
197 if (errno_copy == THRIFT_EINTR && (retries++ < maxRecvRetries_)) { in hasPendingDataToRead()
211 if (!isOpen()) { in peek()
214 if (interruptListener_) { in peek()
224 if (ret < 0) { in peek()
226 if (errno_copy == THRIFT_EINTR && (retries++ < maxRecvRetries_)) { in peek()
231 } else if (ret > 0) { in peek()
233 if (fds[1].revents & THRIFT_POLLIN) { in peek()
245 // Check to see if data is available or if the remote side closed in peek()
248 if (r == -1) { in peek()
250 #if defined __FreeBSD__ || defined __MACH__ in peek()
252 * freebsd returns -1 and THRIFT_ECONNRESET if socket was closed by in peek()
255 if (errno_copy == THRIFT_ECONNRESET) { in peek()
267 if (isOpen()) { in openConnection()
271 if (isUnixDomainSocket()) { in openConnection()
277 if (socket_ == THRIFT_INVALID_SOCKET) { in openConnection()
284 if (sendTimeout_ > 0) { in openConnection()
289 if (recvTimeout_ > 0) { in openConnection()
293 if (keepAlive_) { in openConnection()
310 // Uses a low min RTO if asked to. in openConnection()
312 if (getUseLowMinRto()) { in openConnection()
318 // Set the socket to be non blocking for connect if a timeout exists in openConnection()
320 if (connTimeout_ > 0) { in openConnection()
321 if (-1 == THRIFT_FCNTL(socket_, THRIFT_F_SETFL, flags | THRIFT_O_NONBLOCK)) { in openConnection()
327 if (-1 == THRIFT_FCNTL(socket_, THRIFT_F_SETFL, flags & ~THRIFT_O_NONBLOCK)) { in openConnection()
336 if (isUnixDomainSocket()) { in openConnection()
339 #if (!defined(_WIN32) || defined(HAVE_AF_UNIX_H)) in openConnection()
354 if (ret == 0) { in openConnection()
358 if ((THRIFT_GET_SOCKET_ERROR != THRIFT_EINPROGRESS) in openConnection()
371 if (ret > 0) { in openConnection()
377 if (ret2 == -1) { in openConnection()
383 if (val == 0) { in openConnection()
389 } else if (ret == 0) { in openConnection()
403 if (-1 == THRIFT_FCNTL(socket_, THRIFT_F_SETFL, flags)) { in openConnection()
409 if (!isUnixDomainSocket()) { in openConnection()
415 if (isOpen()) { in open()
418 if (isUnixDomainSocket()) { in open()
426 if (isUnixDomainSocket()) { in unix_open()
438 if (isOpen()) { in local_open()
443 if (port_ < 0 || port_ > 0xFFFF) { in local_open()
460 if ( in local_open()
471 if (error) { in local_open()
487 if (res->ai_next) { in local_open()
502 if (socket_ != THRIFT_INVALID_SOCKET) { in close()
510 if (socket_ != THRIFT_INVALID_SOCKET) { in setSocketFD()
518 if (socket_ == THRIFT_INVALID_SOCKET) { in read()
529 if (recvTimeout_) { in read()
530 // if a readTimeout is specified along with a max number of recv retries, then in read()
539 if (recvTimeout_ > 0) { in read()
542 // if there is no read timeout we don't need the TOD to determine whether in read()
549 if (interruptListener_) { in read()
559 if (ret < 0) { in read()
561 if (errno_copy == THRIFT_EINTR && (retries++ < maxRecvRetries_)) { in read()
566 } else if (ret > 0) { in read()
568 if (fds[1].revents & THRIFT_POLLIN) { in read()
584 if (got < 0) { in read()
585 if (errno_copy == THRIFT_EAGAIN) { in read()
586 // if no timeout we can assume that resource exhaustion has occurred. in read()
587 if (recvTimeout_ == 0) { in read()
591 // check if this is the lack of resources or timeout case in read()
597 if (!eagainThresholdMicros || (readElapsedMicros < eagainThresholdMicros)) { in read()
598 if (retries++ < maxRecvRetries_) { in read()
611 // If interrupted, try again in read()
612 if (errno_copy == THRIFT_EINTR && retries++ < maxRecvRetries_) { in read()
616 if (errno_copy == THRIFT_ECONNRESET) { in read()
621 if (errno_copy == THRIFT_ENOTCONN) { in read()
626 if (errno_copy == THRIFT_ETIMEDOUT) { in read()
645 if (b == 0) { in write()
646 // This should only happen if the timeout set with SO_SNDTIMEO expired. in write()
655 if (socket_ == THRIFT_INVALID_SOCKET) { in write_partial()
670 if (b < 0) { in write_partial()
671 if (THRIFT_GET_SOCKET_ERROR == THRIFT_EWOULDBLOCK || THRIFT_GET_SOCKET_ERROR == THRIFT_EAGAIN) { in write_partial()
678 if (errno_copy == THRIFT_EPIPE || errno_copy == THRIFT_ECONNRESET in write_partial()
687 if (b == 0) { in write_partial()
724 if (socket_ == THRIFT_INVALID_SOCKET) { in setLinger()
735 if (ret == -1) { in setLinger()
744 if (socket_ == THRIFT_INVALID_SOCKET || isUnixDomainSocket()) { in setNoDelay()
751 if (ret == -1) { in setNoDelay()
763 if (timeout_ms < 0) { in setGenericTimeout()
770 if (s == THRIFT_INVALID_SOCKET) { in setGenericTimeout()
781 if (ret == -1) { in setGenericTimeout()
801 if (socket_ == THRIFT_INVALID_SOCKET) { in setKeepAlive()
806 if (isUnixDomainSocket()) { in setKeepAlive()
816 if (ret == -1) { in setKeepAlive()
829 if (!isUnixDomainSocket()) { in getSocketInfo()
830 if (host_.empty() || port_ == 0) { in getSocketInfo()
839 if (!fmt_path_.empty() && fmt_path_[0] == '\0') in getSocketInfo()
847 if (peerHost_.empty() && !isUnixDomainSocket()) { in getPeerHost()
852 if (socket_ == THRIFT_INVALID_SOCKET) { in getPeerHost()
858 if (addrPtr == nullptr) { in getPeerHost()
860 if (getpeername(socket_, (sockaddr*)&addr, &addrLen) != 0) { in getPeerHost()
885 if (peerAddress_.empty() && !isUnixDomainSocket()) { in getPeerAddress()
890 if (socket_ == THRIFT_INVALID_SOCKET) { in getPeerAddress()
896 if (addrPtr == nullptr) { in getPeerAddress()
898 if (getpeername(socket_, (sockaddr*)&addr, &addrLen) != 0) { in getPeerAddress()
929 if (isUnixDomainSocket()) { in setCachedAddress()
935 if (len == sizeof(sockaddr_in)) { in setCachedAddress()
941 if (len == sizeof(sockaddr_in6)) { in setCachedAddress()