mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
Thrift fixes for Exceptions and TServerSocket
Summary: TServerSocket detected file des. 0 as an invalid file des. This has been fixed. Reviewed By: Steve Revert Plan: Revertible Notes: git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664969 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f23cfd810c
commit
10640d8935
@ -106,7 +106,7 @@ void TServerSocket::listen() {
|
||||
}
|
||||
|
||||
shared_ptr<TTransport> TServerSocket::acceptImpl() {
|
||||
if (serverSocket_ <= 0) {
|
||||
if (serverSocket_ < 0) {
|
||||
throw TTransportException(TTX_NOT_OPEN, "TServerSocket not listening");
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_
|
||||
#define _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_ 1
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace facebook { namespace thrift { namespace transport {
|
||||
@ -54,6 +55,15 @@ class TTransportException : public facebook::thrift::TException {
|
||||
return type_;
|
||||
}
|
||||
|
||||
virtual const char* what() const throw() {
|
||||
if (message_.empty()) {
|
||||
return (std::string("Default Transport Exception: ") +
|
||||
boost::lexical_cast<std::string>(type_)).c_str();
|
||||
} else {
|
||||
return message_.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
/** Error code */
|
||||
TTransportExceptionType type_;
|
||||
|
Loading…
Reference in New Issue
Block a user