diff options
author | David Reiss <dreiss@apache.org> | 2008-02-06 22:18:40 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2008-02-06 22:18:40 +0000 |
commit | 0c90f6f8af1d64ec9272bb2f6092336f3d0b8df8 (patch) | |
tree | 15245f459a76acc769d8fe99179176b4965bf66d /lib | |
parent | 3160971286aea0d5b28d5a7a87acaa8a12209ef8 (diff) | |
download | thrift-0c90f6f8af1d64ec9272bb2f6092336f3d0b8df8.tar.gz |
Thrift: Whitespace cleanup.
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.
Reviewed By: mcslee
Test Plan: git diff -b
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib')
155 files changed, 631 insertions, 631 deletions
diff --git a/lib/cocoa/src/TApplicationException.m b/lib/cocoa/src/TApplicationException.m index bace36066..918708786 100644 --- a/lib/cocoa/src/TApplicationException.m +++ b/lib/cocoa/src/TApplicationException.m @@ -48,21 +48,21 @@ [protocol readFieldBeginReturningName: NULL type: &fieldType fieldID: &fieldID]; - if (fieldType == TType_STOP) { + if (fieldType == TType_STOP) { break; } switch (fieldID) { case 1: if (fieldType == TType_STRING) { reason = [protocol readString]; - } else { + } else { [TProtocolUtil skipType: fieldType onProtocol: protocol]; } break; case 2: if (fieldType == TType_I32) { type = [protocol readI32]; - } else { + } else { [TProtocolUtil skipType: fieldType onProtocol: protocol]; } break; diff --git a/lib/cocoa/src/TException.m b/lib/cocoa/src/TException.m index 33ed7b588..48d90905e 100644 --- a/lib/cocoa/src/TException.m +++ b/lib/cocoa/src/TException.m @@ -37,7 +37,7 @@ if ([self userInfo] != nil) { [result appendFormat: @"\n userInfo = %@", [self userInfo]]; } - + return result; } diff --git a/lib/cocoa/src/protocol/TBinaryProtocol.h b/lib/cocoa/src/protocol/TBinaryProtocol.h index 7e288fa04..975af97b4 100644 --- a/lib/cocoa/src/protocol/TBinaryProtocol.h +++ b/lib/cocoa/src/protocol/TBinaryProtocol.h @@ -12,7 +12,7 @@ - (id) initWithTransport: (id <TTransport>) transport; -- (id) initWithTransport: (id <TTransport>) transport +- (id) initWithTransport: (id <TTransport>) transport strictRead: (BOOL) strictRead strictWrite: (BOOL) strictWrite; @@ -29,4 +29,4 @@ - (TBinaryProtocol *) newProtocolOnTransport: (id <TTransport>) transport; -@end
\ No newline at end of file +@end diff --git a/lib/cocoa/src/protocol/TBinaryProtocol.m b/lib/cocoa/src/protocol/TBinaryProtocol.m index 7564f5de6..e19613881 100644 --- a/lib/cocoa/src/protocol/TBinaryProtocol.m +++ b/lib/cocoa/src/protocol/TBinaryProtocol.m @@ -7,13 +7,13 @@ int32_t VERSION_MASK = 0xffff0000; static TBinaryProtocolFactory * gSharedFactory = nil; -@implementation TBinaryProtocolFactory +@implementation TBinaryProtocolFactory + (TBinaryProtocolFactory *) sharedFactory { if (gSharedFactory == nil) { gSharedFactory = [[TBinaryProtocolFactory alloc] init]; } - + return gSharedFactory; } @@ -32,7 +32,7 @@ static TBinaryProtocolFactory * gSharedFactory = nil; return [self initWithTransport: transport strictRead: NO strictWrite: NO]; } -- (id) initWithTransport: (id <TTransport>) transport +- (id) initWithTransport: (id <TTransport>) transport strictRead: (BOOL) strictRead strictWrite: (BOOL) strictWrite { @@ -109,7 +109,7 @@ static TBinaryProtocolFactory * gSharedFactory = nil; @throw [TProtocolException exceptionWithName: @"TProtocolException" reason: [NSString stringWithFormat: @"Message too big. Size limit is: %d Message size is: %d", mMessageSizeLimit, - size]]; + size]]; } NSString * messageName = [self readStringBody: size]; if (name != NULL) { @@ -151,7 +151,7 @@ static TBinaryProtocolFactory * gSharedFactory = nil; int ft = [self readByte]; if (fieldType != NULL) { *fieldType = ft; - } + } if (ft != TType_STOP) { int fid = [self readI16]; if (fieldID != NULL) { @@ -233,7 +233,7 @@ static TBinaryProtocolFactory * gSharedFactory = nil; int32_t size = [self readI32]; uint8_t * buff = malloc(size); if (buff == NULL) { - @throw [TProtocolException + @throw [TProtocolException exceptionWithName: @"TProtocolException" reason: [NSString stringWithFormat: @"Out of memory. Unable to allocate %d bytes trying to read binary data.", size]]; @@ -395,7 +395,7 @@ static TBinaryProtocolFactory * gSharedFactory = nil; } -- (void) writeBinary: (NSData *) data +- (void) writeBinary: (NSData *) data { [self writeI32: [data length]]; [mTransport write: [data bytes] offset: 0 length: [data length]]; diff --git a/lib/cocoa/src/server/TSocketServer.h b/lib/cocoa/src/server/TSocketServer.h index 4b8e8d078..2ab21c72c 100644 --- a/lib/cocoa/src/server/TSocketServer.h +++ b/lib/cocoa/src/server/TSocketServer.h @@ -7,7 +7,7 @@ NSSocketPort * mServerSocket; NSFileHandle * mSocketFileHandle; id <TProtocolFactory> mInputProtocolFactory; - id <TProtocolFactory> mOutputProtocolFactory; + id <TProtocolFactory> mOutputProtocolFactory; id <TProcessor> mProcessor; } diff --git a/lib/cocoa/src/server/TSocketServer.m b/lib/cocoa/src/server/TSocketServer.m index d9d24e110..1108428cb 100644 --- a/lib/cocoa/src/server/TSocketServer.m +++ b/lib/cocoa/src/server/TSocketServer.m @@ -16,12 +16,12 @@ mInputProtocolFactory = [protocolFactory retain]; mOutputProtocolFactory = [protocolFactory retain]; mProcessor = [processor retain]; - + // create a socket mServerSocket = [[NSSocketPort alloc] initWithTCPPort: port]; // FIXME - move this separate start method and add method to close // and cleanup any open ports - + if (mServerSocket == nil) { NSLog(@"Unable to listen on TCP port %d", port); } else { @@ -30,17 +30,17 @@ // wrap it in a file handle so we can get messages from it mSocketFileHandle = [[NSFileHandle alloc] initWithFileDescriptor: [mServerSocket socket] closeOnDealloc: YES]; - + // register for notifications of accepted incoming connections - [[NSNotificationCenter defaultCenter] addObserver: self - selector: @selector(connectionAccepted:) + [[NSNotificationCenter defaultCenter] addObserver: self + selector: @selector(connectionAccepted:) name: NSFileHandleConnectionAcceptedNotification object: mSocketFileHandle]; - + // tell socket to listen [mSocketFileHandle acceptConnectionInBackgroundAndNotify]; } - + return self; } @@ -58,12 +58,12 @@ - (void) connectionAccepted: (NSNotification *) aNotification { NSFileHandle * socket = [[aNotification userInfo] objectForKey: NSFileHandleNotificationFileHandleItem]; - + // now that we have a client connected, spin off a thread to handle activity [NSThread detachNewThreadSelector: @selector(handleClientConnection:) toTarget: self withObject: socket]; - + [[aNotification object] acceptConnectionInBackgroundAndNotify]; } @@ -76,14 +76,14 @@ id <TProtocol> inProtocol = [mInputProtocolFactory newProtocolOnTransport: transport]; id <TProtocol> outProtocol = [mOutputProtocolFactory newProtocolOnTransport: transport]; - + @try { while ([mProcessor processOnInputProtocol: inProtocol outputProtocol: outProtocol]); } @catch (TTransportException * te) { NSLog(@"%@", te); } - + [pool release]; } diff --git a/lib/cocoa/src/transport/THTTPClient.h b/lib/cocoa/src/transport/THTTPClient.h index d9ea1a957..0aabb4665 100644 --- a/lib/cocoa/src/transport/THTTPClient.h +++ b/lib/cocoa/src/transport/THTTPClient.h @@ -13,7 +13,7 @@ - (id) initWithURL: (NSURL *) aURL; -- (id) initWithURL: (NSURL *) aURL +- (id) initWithURL: (NSURL *) aURL userAgent: (NSString *) userAgent timeout: (int) timeout; diff --git a/lib/cocoa/src/transport/THTTPClient.m b/lib/cocoa/src/transport/THTTPClient.m index f5186e205..4bad09cf1 100644 --- a/lib/cocoa/src/transport/THTTPClient.m +++ b/lib/cocoa/src/transport/THTTPClient.m @@ -9,7 +9,7 @@ if (mRequest != nil) { [mRequest release]; } - + // set up our request object that we'll use for each request mRequest = [[NSMutableURLRequest alloc] initWithURL: mURL]; [mRequest setHTTPMethod: @"POST"]; @@ -37,7 +37,7 @@ } -- (id) initWithURL: (NSURL *) aURL +- (id) initWithURL: (NSURL *) aURL userAgent: (NSString *) userAgent timeout: (int) timeout { @@ -45,7 +45,7 @@ if (!self) { return nil; } - + mTimeout = timeout; if (userAgent) { mUserAgent = [userAgent retain]; @@ -56,7 +56,7 @@ // create our request data buffer mRequestData = [[NSMutableData alloc] initWithCapacity: 1024]; - + return self; } @@ -66,7 +66,7 @@ [aURL retain]; [mURL release]; mURL = aURL; - + [self setupRequest]; } @@ -108,7 +108,7 @@ // make the HTTP request NSURLResponse * response; NSError * error; - NSData * responseData = + NSData * responseData = [NSURLConnection sendSynchronousRequest: mRequest returningResponse: &response error: &error]; [mRequestData setLength: 0]; @@ -126,10 +126,10 @@ NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; if ([httpResponse statusCode] != 200) { @throw [TTransportException exceptionWithName: @"TTransportException" - reason: [NSString stringWithFormat: @"Bad response from HTTP server: %d", + reason: [NSString stringWithFormat: @"Bad response from HTTP server: %d", [httpResponse statusCode]]]; } - + // phew! [mResponseData release]; mResponseData = [responseData retain]; diff --git a/lib/cocoa/src/transport/TNSFileHandleTransport.m b/lib/cocoa/src/transport/TNSFileHandleTransport.m index 79a9e8d9d..c97b6c9e9 100644 --- a/lib/cocoa/src/transport/TNSFileHandleTransport.m +++ b/lib/cocoa/src/transport/TNSFileHandleTransport.m @@ -16,10 +16,10 @@ outputFileHandle: (NSFileHandle *) outputFileHandle { self = [super init]; - + mInputFileHandle = [inputFileHandle retain]; mOutputFileHandle = [outputFileHandle retain]; - + return self; } @@ -49,16 +49,16 @@ - (void) write: (uint8_t *) data offset: (unsigned int) offset length: (unsigned int) length { - NSData * dataObject = [[NSData alloc] initWithBytesNoCopy: data+offset + NSData * dataObject = [[NSData alloc] initWithBytesNoCopy: data+offset length: length freeWhenDone: NO]; - + [mOutputFileHandle writeData: dataObject]; - + [dataObject release]; } - + - (void) flush { diff --git a/lib/cocoa/src/transport/TNSStreamTransport.m b/lib/cocoa/src/transport/TNSStreamTransport.m index 42a197e12..92da5b3a5 100644 --- a/lib/cocoa/src/transport/TNSStreamTransport.m +++ b/lib/cocoa/src/transport/TNSStreamTransport.m @@ -51,7 +51,7 @@ } else if (result != length) { @throw [TTransportException exceptionWithReason: @"Output stream did not write all of our data."]; } -} +} - (void) flush { diff --git a/lib/cocoa/src/transport/TSocketClient.m b/lib/cocoa/src/transport/TSocketClient.m index e8ae6e9ec..e3da164e4 100644 --- a/lib/cocoa/src/transport/TSocketClient.m +++ b/lib/cocoa/src/transport/TSocketClient.m @@ -8,16 +8,16 @@ { NSInputStream * input = nil; NSOutputStream * output = nil; - + [NSStream getStreamsToHost: [NSHost hostWithName: hostname] port: port - inputStream: &input + inputStream: &input outputStream: &output]; self = [super initWithInputStream: input outputStream: output]; [input open]; [output open]; - + return self; } diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index 92ccf9941..9da970d75 100644 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -63,7 +63,7 @@ include_thriftdir = $(includedir)/thrift include_thrift_HEADERS = \ $(top_srcdir)/config.h \ src/Thrift.h \ - src/TReflectionLocal.h \ + src/TReflectionLocal.h \ src/reflection_limited_types.h \ src/TProcessor.h \ src/TLogging.h @@ -127,7 +127,7 @@ concurrency_test_CXXFLAGS = $(common_cxxflags) concurrency_test_LDFLAGS = $(common_ldflags) EXTRA_DIST = \ - README \ - thrift-nb.pc.in \ - thrift.pc.in \ - thrift-z.pc.in + README \ + thrift-nb.pc.in \ + thrift.pc.in \ + thrift-z.pc.in diff --git a/lib/cpp/src/TLogging.h b/lib/cpp/src/TLogging.h index 4d3060d85..6fb74840f 100644 --- a/lib/cpp/src/TLogging.h +++ b/lib/cpp/src/TLogging.h @@ -29,37 +29,37 @@ /** * T_GLOBAL_DEBUGGING_LEVEL = 0: all debugging turned off, debug macros undefined - * T_GLOBAL_DEBUGGING_LEVEL = 1: all debugging turned on + * T_GLOBAL_DEBUGGING_LEVEL = 1: all debugging turned on */ #define T_GLOBAL_DEBUGGING_LEVEL 0 /** * T_GLOBAL_LOGGING_LEVEL = 0: all logging turned off, logging macros undefined - * T_GLOBAL_LOGGING_LEVEL = 1: all logging turned on + * T_GLOBAL_LOGGING_LEVEL = 1: all logging turned on */ #define T_GLOBAL_LOGGING_LEVEL 1 -/** +/** * Standard wrapper around fprintf what will prefix the file name and line * number to the line. Uses T_GLOBAL_DEBUGGING_LEVEL to control whether it is * turned on or off. * - * @param format_string + * @param format_string */ #if T_GLOBAL_DEBUGGING_LEVEL > 0 #define T_DEBUG(format_string,...) \ if (T_GLOBAL_DEBUGGING_LEVEL > 0) { \ fprintf(stderr,"[%s,%d] " #format_string " \n", __FILE__, __LINE__,##__VA_ARGS__); \ - } + } #else #define T_DEBUG(format_string,...) #endif -/** - * analagous to T_DEBUG but also prints the time +/** + * analagous to T_DEBUG but also prints the time * * @param string format_string input: printf style format string */ @@ -80,7 +80,7 @@ #endif -/** +/** * analagous to T_DEBUG but uses input level to determine whether or not the string * should be logged. * @@ -93,7 +93,7 @@ } -/** +/** * Explicit error logging. Prints time, file name and line number * * @param string format_string input: printf style format string @@ -109,7 +109,7 @@ } -/** +/** * Analagous to T_ERROR, additionally aborting the process. * WARNING: macro calls abort(), ending program execution * @@ -127,7 +127,7 @@ } -/** +/** * Log input message * * @param string format_string input: printf style format string @@ -143,7 +143,7 @@ dbgtime[24] = '\0'; \ fprintf(stderr,"[%s] " #format_string " \n", dbgtime,##__VA_ARGS__); \ } \ - } + } #else #define T_LOG_OPER(format_string,...) #endif diff --git a/lib/cpp/src/TProcessor.h b/lib/cpp/src/TProcessor.h index affbe8126..cba4a844a 100644 --- a/lib/cpp/src/TProcessor.h +++ b/lib/cpp/src/TProcessor.h @@ -11,7 +11,7 @@ #include <protocol/TProtocol.h> #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { +namespace facebook { namespace thrift { /** * A processor is a generic object that acts upon two streams of data, one diff --git a/lib/cpp/src/Thrift.cpp b/lib/cpp/src/Thrift.cpp index 186c5af44..88890d496 100644 --- a/lib/cpp/src/Thrift.cpp +++ b/lib/cpp/src/Thrift.cpp @@ -21,7 +21,7 @@ uint32_t TApplicationException::read(facebook::thrift::protocol::TProtocol* ipro while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == facebook::thrift::protocol::T_STOP) { break; } switch (fid) { diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/Thrift.h index 338dbdebf..8e93bb0bb 100644 --- a/lib/cpp/src/Thrift.h +++ b/lib/cpp/src/Thrift.h @@ -99,7 +99,7 @@ class TApplicationException : public TException { type_(UNKNOWN) {} TApplicationException(TApplicationExceptionType type) : - TException(), + TException(), type_(type) {} TApplicationException(const std::string& message) : diff --git a/lib/cpp/src/concurrency/Exception.h b/lib/cpp/src/concurrency/Exception.h index 575a3edd9..00e264976 100644 --- a/lib/cpp/src/concurrency/Exception.h +++ b/lib/cpp/src/concurrency/Exception.h @@ -21,16 +21,16 @@ class InvalidArgumentException : public facebook::thrift::TException {}; class IllegalStateException : public facebook::thrift::TException {}; class TimedOutException : public facebook::thrift::TException { -public: +public: TimedOutException():TException("TimedOutException"){}; - TimedOutException(const std::string& message ) : + TimedOutException(const std::string& message ) : TException(message) {} }; class TooManyPendingTasksException : public facebook::thrift::TException { -public: +public: TooManyPendingTasksException():TException("TooManyPendingTasksException"){}; - TooManyPendingTasksException(const std::string& message ) : + TooManyPendingTasksException(const std::string& message ) : TException(message) {} }; diff --git a/lib/cpp/src/concurrency/Mutex.cpp b/lib/cpp/src/concurrency/Mutex.cpp index a05565624..87bfd354c 100644 --- a/lib/cpp/src/concurrency/Mutex.cpp +++ b/lib/cpp/src/concurrency/Mutex.cpp @@ -11,9 +11,9 @@ using boost::shared_ptr; -namespace facebook { namespace thrift { namespace concurrency { +namespace facebook { namespace thrift { namespace concurrency { -/** +/** * Implementation of Mutex class using POSIX mutex * * @author marc @@ -54,7 +54,7 @@ bool Mutex::trylock() const { return impl_->trylock(); } void Mutex::unlock() const { impl_->unlock(); } -/** +/** * Implementation of ReadWriteMutex class using POSIX rw lock * * @author boz @@ -86,7 +86,7 @@ public: void release() const { pthread_rwlock_unlock(&rw_lock_); } -private: +private: mutable pthread_rwlock_t rw_lock_; mutable bool initialized_; }; diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/concurrency/Mutex.h index f3c7cd0c9..e176628a7 100644 --- a/lib/cpp/src/concurrency/Mutex.h +++ b/lib/cpp/src/concurrency/Mutex.h @@ -9,7 +9,7 @@ #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { namespace concurrency { +namespace facebook { namespace thrift { namespace concurrency { /** * A simple mutex class @@ -46,7 +46,7 @@ public: // this releases both read and write locks virtual void release() const; - + private: class impl; @@ -54,7 +54,7 @@ private: }; class Guard { - public: + public: Guard(const Mutex& value) : mutex_(value) { mutex_.lock(); } @@ -67,20 +67,20 @@ class Guard { }; class RWGuard { - public: + public: RWGuard(const ReadWriteMutex& value, bool write = 0) : rw_mutex_(value) { if (write) { rw_mutex_.acquireWrite(); } else { rw_mutex_.acquireRead(); } - } + } ~RWGuard() { rw_mutex_.release(); - } - private: + } + private: const ReadWriteMutex& rw_mutex_; -}; +}; // A little hack to prevent someone from trying to do "Guard(m);" diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/concurrency/TimerManager.cpp index 4f77b2f5c..e3b7a89fc 100644 --- a/lib/cpp/src/concurrency/TimerManager.cpp +++ b/lib/cpp/src/concurrency/TimerManager.cpp @@ -12,7 +12,7 @@ #include <iostream> #include <set> -namespace facebook { namespace thrift { namespace concurrency { +namespace facebook { namespace thrift { namespace concurrency { using boost::shared_ptr; @@ -38,10 +38,10 @@ class TimerManager::Task : public Runnable { Task(shared_ptr<Runnable> runnable) : runnable_(runnable), state_(WAITING) {} - + ~Task() { } - + void run() { if (state_ == EXECUTING) { runnable_->run(); @@ -59,11 +59,11 @@ class TimerManager::Task : public Runnable { class TimerManager::Dispatcher: public Runnable { public: - Dispatcher(TimerManager* manager) : + Dispatcher(TimerManager* manager) : manager_(manager) {} - + ~Dispatcher() {} - + /** * Dispatcher entry point * @@ -85,7 +85,7 @@ class TimerManager::Dispatcher: public Runnable { Synchronized s(manager_->monitor_); task_iterator expiredTaskEnd; int64_t now = Util::currentTime(); - while (manager_->state_ == TimerManager::STARTED && + while (manager_->state_ == TimerManager::STARTED && (expiredTaskEnd = manager_->taskMap_.upper_bound(now)) == manager_->taskMap_.begin()) { int64_t timeout = 0LL; if (!manager_->taskMap_.empty()) { @@ -97,7 +97,7 @@ class TimerManager::Dispatcher: public Runnable { } catch (TimedOutException &e) {} now = Util::currentTime(); } - + if (manager_->state_ == TimerManager::STARTED) { for (task_iterator ix = manager_->taskMap_.begin(); ix != expiredTaskEnd; ix++) { shared_ptr<TimerManager::Task> task = ix->second; @@ -110,17 +110,17 @@ class TimerManager::Dispatcher: public Runnable { manager_->taskMap_.erase(manager_->taskMap_.begin(), expiredTaskEnd); } } - + for (std::set<shared_ptr<Task> >::iterator ix = expiredTasks.begin(); ix != expiredTasks.end(); ix++) { (*ix)->run(); } - + } while (manager_->state_ == TimerManager::STARTED); { Synchronized s(manager_->monitor_); if (manager_->state_ == TimerManager::STOPPING) { - manager_->state_ = TimerManager::STOPPED; + manager_->state_ = TimerManager::STOPPED; manager_->monitor_.notify(); } } @@ -143,7 +143,7 @@ TimerManager::~TimerManager() { // If we haven't been explicitly stopped, do so now. We don't need to grab // the monitor here, since stop already takes care of reentrancy. - + if (state_ != STOPPED) { try { stop(); @@ -203,31 +203,31 @@ void TimerManager::stop() { taskMap_.erase(ix); } - // Remove dispatcher's reference to us. + // Remove dispatcher's reference to us. dispatcher_->manager_ = NULL; } } shared_ptr<const ThreadFactory> TimerManager::threadFactory() const { - Synchronized s(monitor_); + Synchronized s(monitor_); return threadFactory_; } - + void TimerManager::threadFactory(shared_ptr<const ThreadFactory> value) { - Synchronized s(monitor_); + Synchronized s(monitor_); threadFactory_ = value; } size_t TimerManager::taskCount() const { return taskCount_; } - + void TimerManager::add(shared_ptr<Runnable> task, int64_t timeout) { int64_t now = Util::currentTime(); timeout += now; { - Synchronized s(monitor_); + Synchronized s(monitor_); if (state_ != TimerManager::STARTED) { throw IllegalStateException(); } @@ -260,7 +260,7 @@ void TimerManager::add(shared_ptr<Runnable> task, const struct timespec& value) void TimerManager::remove(shared_ptr<Runnable> task) { - Synchronized s(monitor_); + Synchronized s(monitor_); if (state_ != TimerManager::STARTED) { throw IllegalStateException(); } diff --git a/lib/cpp/src/concurrency/TimerManager.h b/lib/cpp/src/concurrency/TimerManager.h index 86900ce57..6d2eae95c 100644 --- a/lib/cpp/src/concurrency/TimerManager.h +++ b/lib/cpp/src/concurrency/TimerManager.h @@ -15,13 +15,13 @@ #include <map> #include <time.h> -namespace facebook { namespace thrift { namespace concurrency { +namespace facebook { namespace thrift { namespace concurrency { /** - * Timer Manager - * + * Timer Manager + * * This class dispatches timer tasks when they fall due. - * + * * @author marc * @version $Id:$ */ @@ -38,7 +38,7 @@ class TimerManager { virtual void threadFactory(boost::shared_ptr<const ThreadFactory> value); /** - * Starts the timer manager service + * Starts the timer manager service * * @throws IllegalArgumentException Missing thread factory attribute */ @@ -53,7 +53,7 @@ class TimerManager { /** * Adds a task to be executed at some time in the future by a worker thread. - * + * * @param task The task to execute * @param timeout Time in milliseconds to delay before executing task */ @@ -61,14 +61,14 @@ class TimerManager { /** * Adds a task to be executed at some time in the future by a worker thread. - * + * * @param task The task to execute * @param timeout Absolute time in the future to execute task. - */ + */ virtual void add(boost::shared_ptr<Runnable> task, const struct timespec& timeout); /** - * Removes a pending task + * Removes a pending task * * @throws NoSuchTaskException Specified task doesn't exist. It was either * processed already or this call was made for a @@ -86,7 +86,7 @@ class TimerManager { STOPPING, STOPPED }; - + virtual const STATE state() const; private: diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/concurrency/Util.h index 8a1ead313..3ebc0b14c 100644 --- a/lib/cpp/src/concurrency/Util.h +++ b/lib/cpp/src/concurrency/Util.h @@ -17,7 +17,7 @@ #include <sys/time.h> #endif // defined(HAVE_CLOCK_GETTIME) -namespace facebook { namespace thrift { namespace concurrency { +namespace facebook { namespace thrift { namespace concurrency { /** * Utility methods @@ -26,7 +26,7 @@ namespace facebook { namespace thrift { namespace concurrency { * and other common platform-dependent concurrency operations. * It should not be included in API headers for other concurrency library * headers, since it will, by definition, pull in all sorts of horrid - * platform dependent crap. Rather it should be inluded directly in + * platform dependent crap. Rather it should be inluded directly in * concurrency library implementation source. * * @author marc @@ -47,7 +47,7 @@ class Util { * @param time or duration in milliseconds */ static void toTimespec(struct timespec& result, int64_t value) { - result.tv_sec = value / MS_PER_S; // ms to s + result.tv_sec = value / MS_PER_S; // ms to s result.tv_nsec = (value % MS_PER_S) * NS_PER_MS; // ms to ns } diff --git a/lib/cpp/src/concurrency/test/TimerManagerTests.h b/lib/cpp/src/concurrency/test/TimerManagerTests.h index bd959cdd7..13e3ef89d 100644 --- a/lib/cpp/src/concurrency/test/TimerManagerTests.h +++ b/lib/cpp/src/concurrency/test/TimerManagerTests.h @@ -17,7 +17,7 @@ namespace facebook { namespace thrift { namespace concurrency { namespace test { using namespace facebook::thrift::concurrency; /** - * ThreadManagerTests class + * ThreadManagerTests class * * @author marc * @version $Id:$ @@ -30,8 +30,8 @@ class TimerManagerTests { class Task: public Runnable { public: - - Task(Monitor& monitor, int64_t timeout) : + + Task(Monitor& monitor, int64_t timeout) : _timeout(timeout), _startTime(Util::currentTime()), _monitor(monitor), @@ -56,15 +56,15 @@ class TimerManagerTests { if(error < ERROR) { _success = true; } - + _done = true; - std::cout << "\t\t\tTimerManagerTests::Task[" << this << "] done" << std::endl; //debug + std::cout << "\t\t\tTimerManagerTests::Task[" << this << "] done" << std::endl; //debug {Synchronized s(_monitor); _monitor.notifyAll(); } - } + } int64_t _timeout; int64_t _startTime; @@ -87,11 +87,11 @@ class TimerManagerTests { { TimerManager timerManager; - + timerManager.threadFactory(shared_ptr<PosixThreadFactory>(new PosixThreadFactory())); - + timerManager.start(); - + assert(timerManager.state() == TimerManager::STARTED); shared_ptr<TimerManagerTests::Task> task = shared_ptr<TimerManagerTests::Task>(new TimerManagerTests::Task(_monitor, timeout)); @@ -125,6 +125,6 @@ class TimerManagerTests { }; const double TimerManagerTests::ERROR = .20; - + }}}} // facebook::thrift::concurrency diff --git a/lib/cpp/src/processor/PeekProcessor.cpp b/lib/cpp/src/processor/PeekProcessor.cpp index cff5edd65..d86480596 100644 --- a/lib/cpp/src/processor/PeekProcessor.cpp +++ b/lib/cpp/src/processor/PeekProcessor.cpp @@ -4,7 +4,7 @@ using namespace facebook::thrift::transport; using namespace facebook::thrift::protocol; using namespace facebook::thrift; -namespace facebook { namespace thrift { namespace processor { +namespace facebook { namespace thrift { namespace processor { PeekProcessor::PeekProcessor() { memoryBuffer_.reset(new TMemoryBuffer()); @@ -38,7 +38,7 @@ void PeekProcessor::setTargetTransport(boost::shared_ptr<TTransport> targetTrans } } -bool PeekProcessor::process(boost::shared_ptr<TProtocol> in, +bool PeekProcessor::process(boost::shared_ptr<TProtocol> in, boost::shared_ptr<TProtocol> out) { std::string fname; @@ -77,7 +77,7 @@ bool PeekProcessor::process(boost::shared_ptr<TProtocol> in, uint32_t size; memoryBuffer_->getBuffer(&buffer, &size); peekBuffer(buffer, size); - + // Done peeking at variables peekEnd(); @@ -92,7 +92,7 @@ void PeekProcessor::peekName(const std::string& fname) { void PeekProcessor::peekBuffer(uint8_t* buffer, uint32_t size) { } -void PeekProcessor::peek(boost::shared_ptr<TProtocol> in, +void PeekProcessor::peek(boost::shared_ptr<TProtocol> in, TType ftype, int16_t fid) { in->skip(ftype); diff --git a/lib/cpp/src/processor/PeekProcessor.h b/lib/cpp/src/processor/PeekProcessor.h index 6b8414b54..49e7cd9eb 100644 --- a/lib/cpp/src/processor/PeekProcessor.h +++ b/lib/cpp/src/processor/PeekProcessor.h @@ -13,7 +13,7 @@ #include <transport/TTransportUtils.h> #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { namespace processor { +namespace facebook { namespace thrift { namespace processor { /* * Class for peeking at the raw data that is being processed by another processor @@ -22,7 +22,7 @@ namespace facebook { namespace thrift { namespace processor { * @author James Wang <jwang@facebook.com> */ class PeekProcessor : public facebook::thrift::TProcessor { - + public: PeekProcessor(); virtual ~PeekProcessor(); @@ -39,14 +39,14 @@ class PeekProcessor : public facebook::thrift::TProcessor { void setTargetTransport(boost::shared_ptr<facebook::thrift::transport::TTransport> targetTransport); - virtual bool process(boost::shared_ptr<facebook::thrift::protocol::TProtocol> in, + virtual bool process(boost::shared_ptr<facebook::thrift::protocol::TProtocol> in, boost::shared_ptr<facebook::thrift::protocol::TProtocol> out); // The following three functions can be overloaded by child classes to // achieve desired peeking behavior virtual void peekName(const std::string& fname); virtual void peekBuffer(uint8_t* buffer, uint32_t size); - virtual void peek(boost::shared_ptr<facebook::thrift::protocol::TProtocol> in, + virtual void peek(boost::shared_ptr<facebook::thrift::protocol::TProtocol> in, facebook::thrift::protocol::TType ftype, int16_t fid); virtual void peekEnd(); diff --git a/lib/cpp/src/processor/StatsProcessor.h b/lib/cpp/src/processor/StatsProcessor.h index b1a4e63a1..140a1d49d 100644 --- a/lib/cpp/src/processor/StatsProcessor.h +++ b/lib/cpp/src/processor/StatsProcessor.h @@ -12,7 +12,7 @@ #include <protocol/TProtocol.h> #include <TProcessor.h> -namespace facebook { namespace thrift { namespace processor { +namespace facebook { namespace thrift { namespace processor { /* * Class for keeping track of function call statistics and printing them if desired @@ -21,7 +21,7 @@ namespace facebook { namespace thrift { namespace processor { */ class StatsProcessor : public facebook::thrift::TProcessor { public: - StatsProcessor(bool print, bool frequency) + StatsProcessor(bool print, bool frequency) : print_(print), frequency_(frequency) {} @@ -128,14 +128,14 @@ protected: break; case facebook::thrift::protocol::T_DOUBLE: { - double dub; + double dub; piprot_->readDouble(dub); if (print_) { printf("%f", dub); } } break; - case facebook::thrift::protocol::T_STRING: + case facebook::thrift::protocol::T_STRING: { std::string str; piprot_->readString(str); @@ -144,7 +144,7 @@ protected: } } break; - case facebook::thrift::protocol::T_STRUCT: + case facebook::thrift::protocol::T_STRUCT: { std::string name; int16_t fid; diff --git a/lib/cpp/src/protocol/TBinaryProtocol.cpp b/lib/cpp/src/protocol/TBinaryProtocol.cpp index 30bbde62d..289d61479 100644 --- a/lib/cpp/src/protocol/TBinaryProtocol.cpp +++ b/lib/cpp/src/protocol/TBinaryProtocol.cpp @@ -25,7 +25,7 @@ static inline To bitwise_cast(From from) { //return *reinterpret_cast<To*>(&from); // BAD!!! //return *static_cast<To*>(static_cast<void*>(&from)); // BAD!!! //return *(To*)(void*)&from; // BAD!!! - + // Super clean and paritally blessed by section 3.9 of the standard. //unsigned char c[sizeof(from)]; //memcpy(c, &from, sizeof(from)); @@ -50,7 +50,7 @@ static inline To bitwise_cast(From from) { } -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { uint32_t TBinaryProtocol::writeMessageBegin(const std::string& name, const TMessageType messageType, @@ -99,8 +99,8 @@ uint32_t TBinaryProtocol::writeFieldEnd() { uint32_t TBinaryProtocol::writeFieldStop() { return writeByte((int8_t)T_STOP); -} - +} + uint32_t TBinaryProtocol::writeMapBegin(const TType keyType, const TType valType, const uint32_t size) { @@ -167,7 +167,7 @@ uint32_t TBinaryProtocol::writeI64(const int64_t i64) { trans_->write((uint8_t*)&net, 8); return 8; } - + uint32_t TBinaryProtocol::writeDouble(const double dub) { BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559); @@ -178,7 +178,7 @@ uint32_t TBinaryProtocol::writeDouble(const double dub) { return 8; } - + uint32_t TBinaryProtocol::writeString(const string& str) { uint32_t size = str.size(); uint32_t result = writeI32((int32_t)size); @@ -250,11 +250,11 @@ uint32_t TBinaryProtocol::readFieldBegin(string& name, result += readI16(fieldId); return result; } - + uint32_t TBinaryProtocol::readFieldEnd() { return 0; } - + uint32_t TBinaryProtocol::readMapBegin(TType& keyType, TType& valType, uint32_t& size) { diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/protocol/TBinaryProtocol.h index 89958ec54..c7e2791ae 100644 --- a/lib/cpp/src/protocol/TBinaryProtocol.h +++ b/lib/cpp/src/protocol/TBinaryProtocol.h @@ -11,7 +11,7 @@ #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { /** * The default binary protocol for thrift. Writes all data in a very basic @@ -90,7 +90,7 @@ class TBinaryProtocol : public TProtocol { uint32_t writeFieldEnd(); uint32_t writeFieldStop(); - + uint32_t writeMapBegin(const TType keyType, const TType valType, const uint32_t size); @@ -140,9 +140,9 @@ class TBinaryProtocol : public TProtocol { uint32_t readFieldBegin(std::string& name, TType& fieldType, int16_t& fieldId); - + uint32_t readFieldEnd(); - + uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size); @@ -151,7 +151,7 @@ class TBinaryProtocol : public TProtocol { uint32_t readListBegin(TType& elemType, uint32_t& size); - + uint32_t readListEnd(); uint32_t readSetBegin(TType& elemType, diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/protocol/TDebugProtocol.cpp index 5d28b7835..2f23b1129 100644 --- a/lib/cpp/src/protocol/TDebugProtocol.cpp +++ b/lib/cpp/src/protocol/TDebugProtocol.cpp @@ -25,7 +25,7 @@ static string byte_to_hex(const uint8_t byte) { } -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { string TDebugProtocol::fieldTypeName(TType type) { switch (type) { @@ -171,7 +171,7 @@ uint32_t TDebugProtocol::writeFieldBegin(const string& name, return writeIndented( id_str + ": " + - name + " (" + + name + " (" + fieldTypeName(fieldType) + ") = "); } @@ -183,8 +183,8 @@ uint32_t TDebugProtocol::writeFieldEnd() { uint32_t TDebugProtocol::writeFieldStop() { return 0; //writeIndented("***STOP***\n"); -} - +} + uint32_t TDebugProtocol::writeMapBegin(const TType keyType, const TType valType, const uint32_t size) { @@ -273,12 +273,12 @@ uint32_t TDebugProtocol::writeI32(const int32_t i32) { uint32_t TDebugProtocol::writeI64(const int64_t i64) { return writeItem(boost::lexical_cast<string>(i64)); } - + uint32_t TDebugProtocol::writeDouble(const double dub) { return writeItem(boost::lexical_cast<string>(dub)); } - + uint32_t TDebugProtocol::writeString(const string& str) { // XXX Raw/UTF-8? diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/protocol/TDebugProtocol.h index 0dd60d810..90b7688e4 100644 --- a/lib/cpp/src/protocol/TDebugProtocol.h +++ b/lib/cpp/src/protocol/TDebugProtocol.h @@ -14,7 +14,7 @@ #include <transport/TTransportUtils.h> -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { /* @@ -73,7 +73,7 @@ class TDebugProtocol : public TWriteOnlyProtocol { uint32_t writeFieldEnd(); uint32_t writeFieldStop(); - + uint32_t writeMapBegin(const TType keyType, const TType valType, const uint32_t size); @@ -140,7 +140,7 @@ class TDebugProtocolFactory : public TProtocolFactory { }}} // facebook::thrift::protocol -namespace facebook { namespace thrift { +namespace facebook { namespace thrift { template<typename ThriftStruct> std::string ThriftDebugString(const ThriftStruct& ts) { diff --git a/lib/cpp/src/protocol/TDenseProtocol.h b/lib/cpp/src/protocol/TDenseProtocol.h index 0902e15f3..dae2c18b3 100644 --- a/lib/cpp/src/protocol/TDenseProtocol.h +++ b/lib/cpp/src/protocol/TDenseProtocol.h @@ -20,7 +20,7 @@ namespace facebook { namespace thrift { namespace protocol { * The dense protocol is designed to use as little space as possible. * * There are two types of dense protocol instances. Standalone instances - * are not used for RPC and just encoded and decode structures of + * are not used for RPC and just encoded and decode structures of * a predetermined type. Non-standalone instances are used for RPC. * Currently, only standalone instances exist. * diff --git a/lib/cpp/src/protocol/TOneWayProtocol.h b/lib/cpp/src/protocol/TOneWayProtocol.h index 635744c8e..245f83056 100644 --- a/lib/cpp/src/protocol/TOneWayProtocol.h +++ b/lib/cpp/src/protocol/TOneWayProtocol.h @@ -9,7 +9,7 @@ #include "TProtocol.h" -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { /** * Abstract class for implementing a protocol that can only be written, @@ -62,12 +62,12 @@ class TWriteOnlyProtocol : public TProtocol { throw TProtocolException(TProtocolException::NOT_IMPLEMENTED, subclass_ + " does not support reading (yet)."); } - + uint32_t readFieldEnd() { throw TProtocolException(TProtocolException::NOT_IMPLEMENTED, subclass_ + " does not support reading (yet)."); } - + uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size) { @@ -85,7 +85,7 @@ class TWriteOnlyProtocol : public TProtocol { throw TProtocolException(TProtocolException::NOT_IMPLEMENTED, subclass_ + " does not support reading (yet)."); } - + uint32_t readListEnd() { throw TProtocolException(TProtocolException::NOT_IMPLEMENTED, subclass_ + " does not support reading (yet)."); diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h index 7fa3de85f..85cc48a9b 100644 --- a/lib/cpp/src/protocol/TProtocol.h +++ b/lib/cpp/src/protocol/TProtocol.h @@ -17,7 +17,7 @@ #include <string> #include <map> -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { using facebook::thrift::transport::TTransport; @@ -118,9 +118,9 @@ class TProtocol { virtual uint32_t writeStructBegin(const std::string& name) = 0; - + virtual uint32_t writeStructEnd() = 0; - + virtual uint32_t writeFieldBegin(const std::string& name, const TType fieldType, const int16_t fieldId) = 0; @@ -128,13 +128,13 @@ class TProtocol { virtual uint32_t writeFieldEnd() = 0; virtual uint32_t writeFieldStop() = 0; - + virtual uint32_t writeMapBegin(const TType keyType, const TType valType, const uint32_t size) = 0; virtual uint32_t writeMapEnd() = 0; - + virtual uint32_t writeListBegin(const TType elemType, const uint32_t size) = 0; @@ -166,7 +166,7 @@ class TProtocol { virtual uint32_t readMessageBegin(std::string& name, TMessageType& messageType, int32_t& seqid) = 0; - + virtual uint32_t readMessageEnd() = 0; virtual uint32_t readStructBegin(std::string& name) = 0; @@ -176,9 +176,9 @@ class TProtocol { virtual uint32_t readFieldBegin(std::string& name, TType& fieldType, int16_t& fieldId) = 0; - + virtual uint32_t readFieldEnd() = 0; - + virtual uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size) = 0; @@ -328,7 +328,7 @@ class TProtocol { ptrans_(ptrans) { trans_ = ptrans.get(); } - + boost::shared_ptr<TTransport> ptrans_; TTransport* trans_; diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/protocol/TProtocolException.h index 4429a623a..0532ec55a 100644 --- a/lib/cpp/src/protocol/TProtocolException.h +++ b/lib/cpp/src/protocol/TProtocolException.h @@ -10,7 +10,7 @@ #include <boost/lexical_cast.hpp> #include <string> -namespace facebook { namespace thrift { namespace protocol { +namespace facebook { namespace thrift { namespace protocol { /** * Class to encapsulate all the possible types of protocol errors that may @@ -41,7 +41,7 @@ class TProtocolException : public facebook::thrift::TException { type_(UNKNOWN) {} TProtocolException(TProtocolExceptionType type) : - facebook::thrift::TException(), + facebook::thrift::TException(), type_(type) {} TProtocolException(const std::string& message) : @@ -81,11 +81,11 @@ class TProtocolException : public facebook::thrift::TException { } protected: - /** + /** * Error code */ TProtocolExceptionType type_; - + }; }}} // facebook::thrift::protocol diff --git a/lib/cpp/src/transport/TFileTransport.h b/lib/cpp/src/transport/TFileTransport.h index f249ff91c..c4c921e2d 100644 --- a/lib/cpp/src/transport/TFileTransport.h +++ b/lib/cpp/src/transport/TFileTransport.h @@ -16,7 +16,7 @@ #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { using facebook::thrift::TProcessor; using facebook::thrift::protocol::TProtocolFactory; @@ -50,7 +50,7 @@ typedef struct readState { // last successful dispatch point int32_t lastDispatchPtr_; - + void resetState(uint32_t lastDispatchPtr) { readingSize_ = true; eventSizeBuffPos_ = 0; @@ -79,7 +79,7 @@ typedef struct readState { } } readState; - + /** * TFileTransportBuffer - buffer class used by TFileTransport for queueing up events * to be written to disk. Should be used in the following way: @@ -90,9 +90,9 @@ typedef struct readState { * 5) Go back to 2, or destroy buffer * * The buffer should never be written to after it is read from, unless it is reset first. - * Note: The above rules are enforced mainly for debugging its sole client TFileTransport + * Note: The above rules are enforced mainly for debugging its sole client TFileTransport * which uses the buffer in this way. - * + * * @author James Wang <jwang@facebook.com> */ class TFileTransportBuffer { @@ -105,7 +105,7 @@ class TFileTransportBuffer { void reset(); bool isFull(); bool isEmpty(); - + private: TFileTransportBuffer(); // should not be used @@ -145,7 +145,7 @@ class TFileWriterTransport : virtual public TTransport { }; /** - * File implementation of a transport. Reads and writes are done to a + * File implementation of a transport. Reads and writes are done to a * file on disk. * * @author Aditya Agarwal <aditya@facebook.com> @@ -161,7 +161,7 @@ class TFileTransport : public TFileReaderTransport, bool isOpen() { return true; } - + void write(const uint8_t* buf, uint32_t len); void flush(); @@ -205,7 +205,7 @@ class TFileTransport : public TFileReaderTransport, return chunkSize_; } - void setEventBufferSize(uint32_t bufferSize) { + void setEventBufferSize(uint32_t bufferSize) { if (bufferAndThreadInitialized_) { GlobalOutput("Cannot change the buffer size after writer thread started"); return; @@ -316,7 +316,7 @@ class TFileTransport : public TFileReaderTransport, // max number of corrupted events per chunk uint32_t maxCorruptedEvents_; static const uint32_t DEFAULT_MAX_CORRUPTED_EVENTS = 0; - + // sleep duration when EOF is hit uint32_t eofSleepTime_; static const uint32_t DEFAULT_EOF_SLEEP_TIME_US = 500 * 1000; @@ -324,15 +324,15 @@ class TFileTransport : public TFileReaderTransport, // sleep duration when a corrupted event is encountered uint32_t corruptedEventSleepTime_; static const uint32_t DEFAULT_CORRUPTED_SLEEP_TIME_US = 1 * 1000 * 1000; - + // writer thread id pthread_t writerThreadId_; - // buffers to hold data before it is flushed. Each element of the buffer stores a msg that + // buffers to hold data before it is flushed. Each element of the buffer stores a msg that // needs to be written to the file. The buffers are swapped by the writer thread. TFileTransportBuffer *dequeueBuffer_; TFileTransportBuffer *enqueueBuffer_; - + // conditions used to block when the buffer is full or empty pthread_cond_t notFull_, notEmpty_; volatile bool closing_; @@ -372,9 +372,9 @@ class TEOFException : public TTransportException { // wrapper class to process events from a file containing thrift events class TFileProcessor { public: - /** + /** * Constructor that defaults output transport to null transport - * + * * @param processor processes log-file events * @param protocolFactory protocol factory * @param inputTransport file transport @@ -388,14 +388,14 @@ class TFileProcessor { boost::shared_ptr<TProtocolFactory> outputProtocolFactory, boost::shared_ptr<TFileReaderTransport> inputTransport); - /** + /** * Constructor - * + * * @param processor processes log-file events * @param protocolFactory protocol factory * @param inputTransport input file transport * @param output output transport - */ + */ TFileProcessor(boost::shared_ptr<TProcessor> processor, boost::shared_ptr<TProtocolFactory> protocolFactory, boost::shared_ptr<TFileReaderTransport> inputTransport, @@ -414,7 +414,7 @@ class TFileProcessor { * */ void processChunk(); - + private: boost::shared_ptr<TProcessor> processor_; boost::shared_ptr<TProtocolFactory> inputProtocolFactory_; @@ -423,7 +423,7 @@ class TFileProcessor { boost::shared_ptr<TTransport> outputTransport_; }; - + }}} // facebook::thrift::transport #endif // _THRIFT_TRANSPORT_TFILETRANSPORT_H_ diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/transport/THttpClient.cpp index b6d9d9e72..c213ef095 100644 --- a/lib/cpp/src/transport/THttpClient.cpp +++ b/lib/cpp/src/transport/THttpClient.cpp @@ -7,7 +7,7 @@ #include "THttpClient.h" #include "TSocket.h" -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { using namespace std; @@ -148,7 +148,7 @@ uint32_t THttpClient::readContent(uint32_t size) { httpPos_ = 0; httpBufLen_ = 0; refill(); - + // Now have available however much we read avail = httpBufLen_; } @@ -162,7 +162,7 @@ uint32_t THttpClient::readContent(uint32_t size) { } return size; } - + char* THttpClient::readLine() { while (true) { char* eol = NULL; @@ -207,12 +207,12 @@ void THttpClient::refill() { throw TTransportException("Out of memory."); } } - + // Read more data uint32_t got = transport_->read((uint8_t*)(httpBuf_+httpBufLen_), httpBufSize_-httpBufLen_); httpBufLen_ += got; httpBuf_[httpBufLen_] = '\0'; - + if (got == 0) { throw TTransportException("Could not refill buffer"); } @@ -249,7 +249,7 @@ void THttpClient::readHeaders() { parseHeader(line); } } - } + } } bool THttpClient::parseStatusLine(char* status) { @@ -259,7 +259,7 @@ bool THttpClient::parseStatusLine(char* status) { if (code == NULL) { throw TTransportException(string("Bad Status: ") + status); } - + *code = '\0'; while (*(code++) == ' '); diff --git a/lib/cpp/src/transport/THttpClient.h b/lib/cpp/src/transport/THttpClient.h index acfcf1b13..1ae3575cb 100644 --- a/lib/cpp/src/transport/THttpClient.h +++ b/lib/cpp/src/transport/THttpClient.h @@ -9,7 +9,7 @@ #include <transport/TTransportUtils.h> -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { /** * HTTP client implementation of the thrift transport. This was irritating @@ -35,8 +35,8 @@ class THttpClient : public TTransport { bool isOpen() { return transport_->isOpen(); } - - bool peek() { + + bool peek() { return transport_->peek(); } @@ -49,7 +49,7 @@ class THttpClient : public TTransport { void readEnd(); void write(const uint8_t* buf, uint32_t len); - + void flush(); private: diff --git a/lib/cpp/src/transport/TServerSocket.h b/lib/cpp/src/transport/TServerSocket.h index 8d76fef7a..213d9d448 100644 --- a/lib/cpp/src/transport/TServerSocket.h +++ b/lib/cpp/src/transport/TServerSocket.h @@ -10,7 +10,7 @@ #include "TServerTransport.h" #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { class TSocket; diff --git a/lib/cpp/src/transport/TServerTransport.h b/lib/cpp/src/transport/TServerTransport.h index 9512372e9..b8e6b97dc 100644 --- a/lib/cpp/src/transport/TServerTransport.h +++ b/lib/cpp/src/transport/TServerTransport.h @@ -11,7 +11,7 @@ #include "TTransportException.h" #include <boost/shared_ptr.hpp> -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { /** * Server transport framework. A server needs to have some facility for diff --git a/lib/cpp/src/transport/TSocketPool.cpp b/lib/cpp/src/transport/TSocketPool.cpp index b6440fc82..235d060ee 100644 --- a/lib/cpp/src/transport/TSocketPool.cpp +++ b/lib/cpp/src/transport/TSocketPool.cpp @@ -9,7 +9,7 @@ #include "TSocketPool.h" -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { using namespace std; diff --git a/lib/cpp/src/transport/TSocketPool.h b/lib/cpp/src/transport/TSocketPool.h index a197c72b4..847f67e21 100644 --- a/lib/cpp/src/transport/TSocketPool.h +++ b/lib/cpp/src/transport/TSocketPool.h @@ -10,7 +10,7 @@ #include <vector> #include "TSocket.h" -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { /** * TCP Socket implementation of the TTransport interface. diff --git a/lib/cpp/src/transport/TTransport.h b/lib/cpp/src/transport/TTransport.h index 4e3c218ba..469acd23a 100644 --- a/lib/cpp/src/transport/TTransport.h +++ b/lib/cpp/src/transport/TTransport.h @@ -12,7 +12,7 @@ #include <transport/TTransportException.h> #include <string> -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { /** * Generic interface for a method of transporting data. A TTransport may be @@ -86,7 +86,7 @@ class TTransport { virtual uint32_t readAll(uint8_t* buf, uint32_t len) { uint32_t have = 0; uint32_t get = 0; - + while (have < len) { get = read(buf+have, len-have); if (get <= 0) { @@ -94,12 +94,12 @@ class TTransport { } have += get; } - + return have; } /** - * Called when read is completed. + * Called when read is completed. * This can be over-ridden to perform a transport-specific action * e.g. logging the request to a file * @@ -120,7 +120,7 @@ class TTransport { } /** - * Called when write is completed. + * Called when write is completed. * This can be over-ridden to perform a transport-specific action * at the end of a request. * diff --git a/lib/cpp/src/transport/TTransportException.cpp b/lib/cpp/src/transport/TTransportException.cpp index 85b77b842..e6322657d 100644 --- a/lib/cpp/src/transport/TTransportException.cpp +++ b/lib/cpp/src/transport/TTransportException.cpp @@ -12,7 +12,7 @@ using std::string; using boost::lexical_cast; -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { string TTransportException::strerror_s(int errno_copy) { #ifndef HAVE_STRERROR_R diff --git a/lib/cpp/src/transport/TTransportException.h b/lib/cpp/src/transport/TTransportException.h index 39c65ddd2..73bad8055 100644 --- a/lib/cpp/src/transport/TTransportException.h +++ b/lib/cpp/src/transport/TTransportException.h @@ -11,7 +11,7 @@ #include <string> #include <Thrift.h> -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { /** * Class to encapsulate all the possible types of transport errors that may @@ -38,13 +38,13 @@ class TTransportException : public facebook::thrift::TException { CORRUPTED_DATA = 7, INTERNAL_ERROR = 8, }; - + TTransportException() : facebook::thrift::TException(), type_(UNKNOWN) {} TTransportException(TTransportExceptionType type) : - facebook::thrift::TException(), + facebook::thrift::TException(), type_(type) {} TTransportException(const std::string& message) : @@ -91,7 +91,7 @@ class TTransportException : public facebook::thrift::TException { return message_.c_str(); } } - + protected: /** Just like strerror_r but returns a C++ string object. */ std::string strerror_s(int errno_copy); diff --git a/lib/cpp/src/transport/TTransportUtils.cpp b/lib/cpp/src/transport/TTransportUtils.cpp index 556d5fa6e..e1f37b847 100644 --- a/lib/cpp/src/transport/TTransportUtils.cpp +++ b/lib/cpp/src/transport/TTransportUtils.cpp @@ -8,7 +8,7 @@ using std::string; -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { uint32_t TBufferedTransport::read(uint8_t* buf, uint32_t len) { uint32_t need = len; @@ -20,12 +20,12 @@ uint32_t TBufferedTransport::read(uint8_t* buf, uint32_t len) { memcpy(buf, rBuf_+rPos_, rLen_-rPos_); need -= rLen_-rPos_; buf += rLen_-rPos_; - } + } // Get more from underlying transport up to buffer size rLen_ = transport_->read(rBuf_, rBufSize_); rPos_ = 0; } - + // Hand over whatever we have uint32_t give = need; if (rLen_-rPos_ < give) { @@ -137,7 +137,7 @@ uint32_t TFramedTransport::read(uint8_t* buf, uint32_t len) { // Read another chunk readFrame(); } - + // Hand over whatever we have uint32_t give = need; if (rLen_-rPos_ < give) { @@ -196,7 +196,7 @@ void TFramedTransport::write(const uint8_t* buf, uint32_t len) { // Copy the old buffer to the new one memcpy(wBuf2, wBuf_, wLen_); - + // Now point buf to the new one delete [] wBuf_; wBuf_ = wBuf2; @@ -218,7 +218,7 @@ void TFramedTransport::flush() { sz = (int32_t)htonl(sz); transport_->write((const uint8_t*)&sz, 4); - + // Write frame body if (wLen_ > 0) { transport_->write(wBuf_, wLen_); @@ -267,7 +267,7 @@ uint32_t TMemoryBuffer::read(uint8_t* buf, uint32_t len) { // Copy into buffer and increment rPos_ memcpy(buf, buffer_ + rPos_, give); rPos_ += give; - + return give; } @@ -293,7 +293,7 @@ uint32_t TMemoryBuffer::readAppendToString(std::string& str, uint32_t len) { str.reserve(str.length()+give); str.append((char*)buffer_ + rPos_, give); rPos_ += give; - + return give; } @@ -340,7 +340,7 @@ void TMemoryBuffer::consume(uint32_t len) { uint32_t TPipedTransport::read(uint8_t* buf, uint32_t len) { uint32_t need = len; - + // We don't have enough data yet if (rLen_-rPos_ < need) { // Copy out whatever we have @@ -356,7 +356,7 @@ uint32_t TPipedTransport::read(uint8_t* buf, uint32_t len) { rBufSize_ *=2; rBuf_ = (uint8_t *)realloc(rBuf_, sizeof(uint8_t) * rBufSize_); } - + // try to fill up the buffer rLen_ += srcTrans_->read(rBuf_+rPos_, rBufSize_ - rPos_); } @@ -407,7 +407,7 @@ void TPipedTransport::flush() { srcTrans_->flush(); } -TPipedFileReaderTransport::TPipedFileReaderTransport(boost::shared_ptr<TFileReaderTransport> srcTrans, boost::shared_ptr<TTransport> dstTrans) +TPipedFileReaderTransport::TPipedFileReaderTransport(boost::shared_ptr<TFileReaderTransport> srcTrans, boost::shared_ptr<TTransport> dstTrans) : TPipedTransport(srcTrans, dstTrans), srcTrans_(srcTrans) { } @@ -438,7 +438,7 @@ uint32_t TPipedFileReaderTransport::read(uint8_t* buf, uint32_t len) { uint32_t TPipedFileReaderTransport::readAll(uint8_t* buf, uint32_t len) { uint32_t have = 0; uint32_t get = 0; - + while (have < len) { get = read(buf+have, len-have); if (get <= 0) { @@ -446,7 +446,7 @@ uint32_t TPipedFileReaderTransport::readAll(uint8_t* buf, uint32_t len) { } have += get; } - + return have; } diff --git a/lib/cpp/src/transport/TZlibTransport.cpp b/lib/cpp/src/transport/TZlibTransport.cpp index 27aa350c7..c9acc2480 100644 --- a/lib/cpp/src/transport/TZlibTransport.cpp +++ b/lib/cpp/src/transport/TZlibTransport.cpp @@ -11,7 +11,7 @@ using std::string; -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { // Don't call this outside of the constructor. void TZlibTransport::initZlib() { diff --git a/lib/cpp/src/transport/TZlibTransport.h b/lib/cpp/src/transport/TZlibTransport.h index dd8ae2f07..c2c18495b 100644 --- a/lib/cpp/src/transport/TZlibTransport.h +++ b/lib/cpp/src/transport/TZlibTransport.h @@ -12,7 +12,7 @@ struct z_stream_s; -namespace facebook { namespace thrift { namespace transport { +namespace facebook { namespace thrift { namespace transport { class TZlibTransportException : public TTransportException { public: @@ -135,7 +135,7 @@ class TZlibTransport : public TTransport { ~TZlibTransport(); bool isOpen(); - + void open() { transport_->open(); } @@ -145,7 +145,7 @@ class TZlibTransport : public TTransport { } uint32_t read(uint8_t* buf, uint32_t len); - + void write(const uint8_t* buf, uint32_t len); void flush(); diff --git a/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs b/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs index 4375a5251..e91a156b2 100644 --- a/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs +++ b/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ThriftMSBuildTask")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,11 +25,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj b/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj index 68c6bd1a7..02110eae6 100644 --- a/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj +++ b/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj @@ -56,11 +56,11 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> -</Project>
\ No newline at end of file +</Project> diff --git a/lib/csharp/src/Protocol/TBinaryProtocol.cs b/lib/csharp/src/Protocol/TBinaryProtocol.cs index c2eb81fc6..5df202108 100644 --- a/lib/csharp/src/Protocol/TBinaryProtocol.cs +++ b/lib/csharp/src/Protocol/TBinaryProtocol.cs @@ -2,7 +2,7 @@ // TBinaryProtocol.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // Will Palmeri <will@imeem.com> // diff --git a/lib/csharp/src/Protocol/TField.cs b/lib/csharp/src/Protocol/TField.cs index 932953095..c29425357 100644 --- a/lib/csharp/src/Protocol/TField.cs +++ b/lib/csharp/src/Protocol/TField.cs @@ -2,7 +2,7 @@ // TField.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TList.cs b/lib/csharp/src/Protocol/TList.cs index 72056cb89..eb307ce26 100644 --- a/lib/csharp/src/Protocol/TList.cs +++ b/lib/csharp/src/Protocol/TList.cs @@ -2,7 +2,7 @@ // TList.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TMap.cs b/lib/csharp/src/Protocol/TMap.cs index 586aa4f60..53c78334a 100644 --- a/lib/csharp/src/Protocol/TMap.cs +++ b/lib/csharp/src/Protocol/TMap.cs @@ -2,7 +2,7 @@ // TMap.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TMessage.cs b/lib/csharp/src/Protocol/TMessage.cs index a9522ff0e..92176f36f 100644 --- a/lib/csharp/src/Protocol/TMessage.cs +++ b/lib/csharp/src/Protocol/TMessage.cs @@ -2,7 +2,7 @@ // TMessage.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TMessageType.cs b/lib/csharp/src/Protocol/TMessageType.cs index 1cadf3145..6e6ead76f 100644 --- a/lib/csharp/src/Protocol/TMessageType.cs +++ b/lib/csharp/src/Protocol/TMessageType.cs @@ -2,7 +2,7 @@ // TMessageType.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TProtocol.cs b/lib/csharp/src/Protocol/TProtocol.cs index d4b082976..2702ad804 100644 --- a/lib/csharp/src/Protocol/TProtocol.cs +++ b/lib/csharp/src/Protocol/TProtocol.cs @@ -2,7 +2,7 @@ // TProtocol.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TProtocolFactory.cs b/lib/csharp/src/Protocol/TProtocolFactory.cs index 5434da91d..756bb5e3c 100644 --- a/lib/csharp/src/Protocol/TProtocolFactory.cs +++ b/lib/csharp/src/Protocol/TProtocolFactory.cs @@ -2,7 +2,7 @@ // TProtocolFactory.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TProtocolUtil.cs b/lib/csharp/src/Protocol/TProtocolUtil.cs index ae5a10786..a65ea0fa6 100644 --- a/lib/csharp/src/Protocol/TProtocolUtil.cs +++ b/lib/csharp/src/Protocol/TProtocolUtil.cs @@ -2,7 +2,7 @@ // TProtocolUtil.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TSet.cs b/lib/csharp/src/Protocol/TSet.cs index 1f172e47d..0dea8cb5d 100644 --- a/lib/csharp/src/Protocol/TSet.cs +++ b/lib/csharp/src/Protocol/TSet.cs @@ -2,7 +2,7 @@ // TSet.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TStruct.cs b/lib/csharp/src/Protocol/TStruct.cs index 000ebf115..383369572 100644 --- a/lib/csharp/src/Protocol/TStruct.cs +++ b/lib/csharp/src/Protocol/TStruct.cs @@ -2,7 +2,7 @@ // TStruct.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Protocol/TType.cs b/lib/csharp/src/Protocol/TType.cs index 0badb3358..257ac6bc1 100644 --- a/lib/csharp/src/Protocol/TType.cs +++ b/lib/csharp/src/Protocol/TType.cs @@ -2,7 +2,7 @@ // TType.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Server/TServer.cs b/lib/csharp/src/Server/TServer.cs index 3e70b11e9..b168d9936 100644 --- a/lib/csharp/src/Server/TServer.cs +++ b/lib/csharp/src/Server/TServer.cs @@ -2,7 +2,7 @@ // TServer.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Server/TSimpleServer.cs b/lib/csharp/src/Server/TSimpleServer.cs index c3461ef89..b2a70fe9d 100644 --- a/lib/csharp/src/Server/TSimpleServer.cs +++ b/lib/csharp/src/Server/TSimpleServer.cs @@ -2,7 +2,7 @@ // TSimpleServer.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Server/TThreadPoolServer.cs b/lib/csharp/src/Server/TThreadPoolServer.cs index c42d348a5..b62de814c 100644 --- a/lib/csharp/src/Server/TThreadPoolServer.cs +++ b/lib/csharp/src/Server/TThreadPoolServer.cs @@ -2,7 +2,7 @@ // TThreadPoolServer.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Distributed under the Thrift Software License @@ -115,7 +115,7 @@ namespace Thrift.Server outputTransport = outputTransportFactory.GetTransport(client); inputProtocol = inputProtocolFactory.GetProtocol(inputTransport); outputProtocol = outputProtocolFactory.GetProtocol(outputTransport); - while (processor.Process(inputProtocol, outputProtocol)) + while (processor.Process(inputProtocol, outputProtocol)) { //keep processing requests until client disconnects } diff --git a/lib/csharp/src/TApplicationException.cs b/lib/csharp/src/TApplicationException.cs index e4f3acf85..e9d200a95 100644 --- a/lib/csharp/src/TApplicationException.cs +++ b/lib/csharp/src/TApplicationException.cs @@ -2,7 +2,7 @@ // TApplicationException.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/TProcessor.cs b/lib/csharp/src/TProcessor.cs index 7567820c3..2cbddd727 100644 --- a/lib/csharp/src/TProcessor.cs +++ b/lib/csharp/src/TProcessor.cs @@ -2,7 +2,7 @@ // TProcessor.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Distributed under the Thrift Software License diff --git a/lib/csharp/src/Transport/TServerSocket.cs b/lib/csharp/src/Transport/TServerSocket.cs index cb4a84fa1..3b5c8dd0c 100644 --- a/lib/csharp/src/Transport/TServerSocket.cs +++ b/lib/csharp/src/Transport/TServerSocket.cs @@ -2,7 +2,7 @@ // TServerTransport.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/csharp/src/Transport/TServerTransport.cs b/lib/csharp/src/Transport/TServerTransport.cs index b4f5f07da..6b05a1589 100644 --- a/lib/csharp/src/Transport/TServerTransport.cs +++ b/lib/csharp/src/Transport/TServerTransport.cs @@ -2,7 +2,7 @@ // TServerTransport.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/csharp/src/Transport/TSocket.cs b/lib/csharp/src/Transport/TSocket.cs index c05d58712..a3f362388 100644 --- a/lib/csharp/src/Transport/TSocket.cs +++ b/lib/csharp/src/Transport/TSocket.cs @@ -2,7 +2,7 @@ // TSocket.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/csharp/src/Transport/TStreamTransport.cs b/lib/csharp/src/Transport/TStreamTransport.cs index 1715b6aab..dbbec1912 100644 --- a/lib/csharp/src/Transport/TStreamTransport.cs +++ b/lib/csharp/src/Transport/TStreamTransport.cs @@ -2,7 +2,7 @@ // TStreamTransport.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/csharp/src/Transport/TTransport.cs b/lib/csharp/src/Transport/TTransport.cs index 90f7e74fe..915cbc93b 100644 --- a/lib/csharp/src/Transport/TTransport.cs +++ b/lib/csharp/src/Transport/TTransport.cs @@ -2,7 +2,7 @@ // TTransport.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/csharp/src/Transport/TTransportException.cs b/lib/csharp/src/Transport/TTransportException.cs index d59c46e6a..daf21d8fc 100644 --- a/lib/csharp/src/Transport/TTransportException.cs +++ b/lib/csharp/src/Transport/TTransportException.cs @@ -2,7 +2,7 @@ // TTransportException.cs // // Begin: Aug 19, 2007 -// Authors: +// Authors: // Todd Berman <tberman@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/csharp/src/Transport/TTransportFactory.cs b/lib/csharp/src/Transport/TTransportFactory.cs index 456140d54..1cb5c9201 100644 --- a/lib/csharp/src/Transport/TTransportFactory.cs +++ b/lib/csharp/src/Transport/TTransportFactory.cs @@ -2,7 +2,7 @@ // TTransportFactory.cs // // Begin: Dec 3, 2007 -// Authors: +// Authors: // Will Palmeri <wpalmeri@imeem.com> // // Copyright (C) 2007 imeem, inc. <http://www.imeem.com> diff --git a/lib/erl/COPYING b/lib/erl/COPYING index 039f21e3e..0101a7dc8 100644 --- a/lib/erl/COPYING +++ b/lib/erl/COPYING @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/erl/LICENSE b/lib/erl/LICENSE index 039f21e3e..0101a7dc8 100644 --- a/lib/erl/LICENSE +++ b/lib/erl/LICENSE @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/erl/build/beamver b/lib/erl/build/beamver index fe448b966..2b5f77b33 100644 --- a/lib/erl/build/beamver +++ b/lib/erl/build/beamver @@ -11,7 +11,7 @@ # # 5> code:which(acca_inets). # "/home/martin/work/otp/releases/<app>/../../acca/ebin/<app>.beam" -# +# # 8> beam_lib:version(code:which(<app>)). # {ok,{<app>,['$Id: beamver,v 1.1.1.1 2003/06/13 21:43:21 mlogan Exp $ ']}} diff --git a/lib/erl/build/otp.mk b/lib/erl/build/otp.mk index 4e93ea8c4..1d16e2c83 100644 --- a/lib/erl/build/otp.mk +++ b/lib/erl/build/otp.mk @@ -17,10 +17,10 @@ ERLANGDEV_GROUP=erlangdev # ERL_TOP is root of Erlang source tree # ERL_RUN_TOP is root of Erlang target tree (some Ericsson Makefiles use $ROOT) -# ERLANG_OTP is target root for Erlang code +# ERLANG_OTP is target root for Erlang code # - see sasl/systools reference manual page; grep "TEST" -# OS_TYPE is FreeBSD, NetBSD, OpenBSD, Linux, SCO_SV, SunOS. +# OS_TYPE is FreeBSD, NetBSD, OpenBSD, Linux, SCO_SV, SunOS. OS_TYPE=${shell uname} # MHOST is the host where this Makefile runs. @@ -36,11 +36,11 @@ endif # Edit to reflect local environment. # ifeq (${OS_TYPE},Linux) # ERL_RUN_TOP=/usr/local/lib/erlang -# Note* ERL_RUN_TOP can be determined by starting an +# Note* ERL_RUN_TOP can be determined by starting an # erlang shell and typing code:root_dir(). # ERL_TOP=a symbolic link to the actual source top, which changes from version to version -# Note* ERL_TOP is the directory where the erlang -# source files reside. Make sure to run ./configure there. +# Note* ERL_TOP is the directory where the erlang +# source files reside. Make sure to run ./configure there. # TARGET=i686-pc-linux-gnu # Note* Target can be found in $ERL_TOP/erts # endif @@ -72,7 +72,7 @@ ifeq (${OS_TYPE},SunOS) LD=/usr/ccs/bin/ld RANLIB=/usr/ccs/bin/ranlib -CFLAGS+=-Wall -pedantic -ansi -O +CFLAGS+=-Wall -pedantic -ansi -O CORE=*.core endif diff --git a/lib/erl/build/otp_subdir.mk b/lib/erl/build/otp_subdir.mk index 733396939..2a36c6588 100644 --- a/lib/erl/build/otp_subdir.mk +++ b/lib/erl/build/otp_subdir.mk @@ -25,16 +25,16 @@ # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved via the world wide web at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # The Initial Developer of the Original Code is Ericsson Utvecklings AB. # Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings # AB. All Rights Reserved.'' -# +# # $Id: otp_subdir.mk,v 1.5 2004/07/12 15:12:23 jeinhorn Exp $ # # diff --git a/lib/erl/build/raw_test.mk b/lib/erl/build/raw_test.mk index dbacf18f1..bf8535d14 100644 --- a/lib/erl/build/raw_test.mk +++ b/lib/erl/build/raw_test.mk @@ -1,6 +1,6 @@ # for testing erlang files directly. The set up for a -# this type of test would be -# files to test reside in lib/<app_name>/src and the test files which are +# this type of test would be +# files to test reside in lib/<app_name>/src and the test files which are # just plain erlang code reside in lib/<app_name>/test # # This color codes emitted while the tests run assume that you are using @@ -25,5 +25,5 @@ test: echo $${MY_LRED:-$(LRED)}"$$d Test Failed"; \ fi; \ echo -n $(OFF)$(NO_COLOR); \ - done + done diff --git a/lib/erl/include/protocol/tBinaryProtocol.hrl b/lib/erl/include/protocol/tBinaryProtocol.hrl index c97683984..dea2e29c4 100644 --- a/lib/erl/include/protocol/tBinaryProtocol.hrl +++ b/lib/erl/include/protocol/tBinaryProtocol.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/protocol/tBinaryProtocolFactory.hrl b/lib/erl/include/protocol/tBinaryProtocolFactory.hrl index 266932c77..cf8c92b0e 100644 --- a/lib/erl/include/protocol/tBinaryProtocolFactory.hrl +++ b/lib/erl/include/protocol/tBinaryProtocolFactory.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/protocol/tProtocol.hrl b/lib/erl/include/protocol/tProtocol.hrl index 3e42d67a6..d393f352c 100644 --- a/lib/erl/include/protocol/tProtocol.hrl +++ b/lib/erl/include/protocol/tProtocol.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/protocol/tProtocolFactory.hrl b/lib/erl/include/protocol/tProtocolFactory.hrl index 56c7fee4b..6335dd960 100644 --- a/lib/erl/include/protocol/tProtocolFactory.hrl +++ b/lib/erl/include/protocol/tProtocolFactory.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/server/tErlServer.hrl b/lib/erl/include/server/tErlServer.hrl index 0a6699320..b60df710a 100644 --- a/lib/erl/include/server/tErlServer.hrl +++ b/lib/erl/include/server/tErlServer.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/server/tServer.hrl b/lib/erl/include/server/tServer.hrl index 502a137f7..9488438ad 100644 --- a/lib/erl/include/server/tServer.hrl +++ b/lib/erl/include/server/tServer.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/server/tSimpleServer.hrl b/lib/erl/include/server/tSimpleServer.hrl index f115d0bd3..e6d257d30 100644 --- a/lib/erl/include/server/tSimpleServer.hrl +++ b/lib/erl/include/server/tSimpleServer.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/tErlProcessor.hrl b/lib/erl/include/tErlProcessor.hrl index 78b91f152..65e5cd073 100644 --- a/lib/erl/include/tErlProcessor.hrl +++ b/lib/erl/include/tErlProcessor.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/tProcessor.hrl b/lib/erl/include/tProcessor.hrl index 3d138cde5..188339751 100644 --- a/lib/erl/include/tProcessor.hrl +++ b/lib/erl/include/tProcessor.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tBufferedTransport.hrl b/lib/erl/include/transport/tBufferedTransport.hrl index 05c738e31..0aa1a9143 100644 --- a/lib/erl/include/transport/tBufferedTransport.hrl +++ b/lib/erl/include/transport/tBufferedTransport.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tBufferedTransportFactory.hrl b/lib/erl/include/transport/tBufferedTransportFactory.hrl index 3a4cdc5e5..69081b4ff 100644 --- a/lib/erl/include/transport/tBufferedTransportFactory.hrl +++ b/lib/erl/include/transport/tBufferedTransportFactory.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tErlAcceptor.hrl b/lib/erl/include/transport/tErlAcceptor.hrl index 333feb5d8..43babb53a 100644 --- a/lib/erl/include/transport/tErlAcceptor.hrl +++ b/lib/erl/include/transport/tErlAcceptor.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tServerSocket.hrl b/lib/erl/include/transport/tServerSocket.hrl index a2c25acba..2f85b8acb 100644 --- a/lib/erl/include/transport/tServerSocket.hrl +++ b/lib/erl/include/transport/tServerSocket.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tServerTransport.hrl b/lib/erl/include/transport/tServerTransport.hrl index 207bbf631..ccb75e494 100644 --- a/lib/erl/include/transport/tServerTransport.hrl +++ b/lib/erl/include/transport/tServerTransport.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tSocket.hrl b/lib/erl/include/transport/tSocket.hrl index 0317d5aa9..95d8d8757 100644 --- a/lib/erl/include/transport/tSocket.hrl +++ b/lib/erl/include/transport/tSocket.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tTransport.hrl b/lib/erl/include/transport/tTransport.hrl index ca89413d2..8d742898d 100644 --- a/lib/erl/include/transport/tTransport.hrl +++ b/lib/erl/include/transport/tTransport.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/include/transport/tTransportFactory.hrl b/lib/erl/include/transport/tTransportFactory.hrl index d4881408e..05aa8203f 100644 --- a/lib/erl/include/transport/tTransportFactory.hrl +++ b/lib/erl/include/transport/tTransportFactory.hrl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/erl/src/Makefile b/lib/erl/src/Makefile index b42e0056c..452cfee2c 100644 --- a/lib/erl/src/Makefile +++ b/lib/erl/src/Makefile @@ -52,13 +52,13 @@ WEB_TARGET=/var/yaws/www/$(APP_NAME) # ---------------------------------------------------- ERL_FLAGS += -ERL_COMPILE_FLAGS += -I../include -I../../fslib/include -I../../system_status/include +ERL_COMPILE_FLAGS += -I../include -I../../fslib/include -I../../system_status/include # ---------------------------------------------------- # Targets # ---------------------------------------------------- -all debug opt: $(EBIN) $(TARGET_FILES) +all debug opt: $(EBIN) $(TARGET_FILES) #$(EBIN)/rm_logger.beam: $(APP_NAME).hrl include ../build/docs.mk @@ -84,24 +84,24 @@ $(APP_TARGET): $(APP_SRC) ../vsn.mk $(BEAMS) -e 's;%PFX%;$(PFX);' \ -e 's;%APP_NAME%;$(APP_NAME);' \ -e 's;%MODULES%;%MODULES%$(MODULES_STRING_LIST);' \ - $< > $<".tmp" + $< > $<".tmp" sed -e 's/%MODULES%\(.*\),/\1/' \ - $<".tmp" > $@ + $<".tmp" > $@ rm $<".tmp" $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk sed -e 's;%VSN%;$(VSN);' $< > $@ -$(WEB_TARGET): ../markup/* - rm -rf $(WEB_TARGET) - mkdir $(WEB_TARGET) +$(WEB_TARGET): ../markup/* + rm -rf $(WEB_TARGET) + mkdir $(WEB_TARGET) cp -r ../markup/ $(WEB_TARGET) cp -r ../skins/ $(WEB_TARGET) # ---------------------------------------------------- # Install Target -# ---------------------------------------------------- +# ---------------------------------------------------- install: all $(WEB_TARGET) # $(INSTALL_DIR) $(INSTALL_DST)/src diff --git a/lib/erl/src/protocol/tBinaryProtocolFactory.erl b/lib/erl/src/protocol/tBinaryProtocolFactory.erl index ff7fa5654..c525cdb05 100644 --- a/lib/erl/src/protocol/tBinaryProtocolFactory.erl +++ b/lib/erl/src/protocol/tBinaryProtocolFactory.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ @@ -24,11 +24,11 @@ %%% ?DEFINE_ATTR(super). - + %%% %%% behavior callbacks %%% - + %%% super() -> SuperModule = atom() %%% | none diff --git a/lib/erl/src/protocol/tProtocolFactory.erl b/lib/erl/src/protocol/tProtocolFactory.erl index d697263c2..f756a2933 100644 --- a/lib/erl/src/protocol/tProtocolFactory.erl +++ b/lib/erl/src/protocol/tProtocolFactory.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ @@ -27,7 +27,7 @@ %%% %%% behavior callbacks %%% - + %%% super() -> SuperModule = atom() %%% | none diff --git a/lib/erl/src/server/tServer.erl b/lib/erl/src/server/tServer.erl index 23aef22e5..fc033310b 100644 --- a/lib/erl/src/server/tServer.erl +++ b/lib/erl/src/server/tServer.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ @@ -29,11 +29,11 @@ ?DEFINE_ATTR(serverTransport); ?DEFINE_ATTR(transportFactory); ?DEFINE_ATTR(protocolFactory). - + %%% %%% behavior callbacks %%% - + %%% super() -> SuperModule = atom() %%% | none @@ -58,17 +58,17 @@ new(Handler, Processor, ServerTransport, TransportFactory, ProtocolFactory) -> %% much ado about nothing but %% subclasses pass nil too - transportFactory = + transportFactory = case TransportFactory of nil -> tTransportFactory:new(); _ -> TransportFactory end, - - protocolFactory = + + protocolFactory = case ProtocolFactory of nil -> tBinaryProtocolFactory:new(); _ -> ProtocolFactory - end + end }. new(Handler, Processor, ServerTransport) -> diff --git a/lib/erl/src/server/tSimpleServer.erl b/lib/erl/src/server/tSimpleServer.erl index 6dcc72362..833fe5db8 100644 --- a/lib/erl/src/server/tSimpleServer.erl +++ b/lib/erl/src/server/tSimpleServer.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ @@ -27,11 +27,11 @@ %%% ?DEFINE_ATTR(super). - + %%% %%% behavior callbacks %%% - + %%% super() -> SuperModule = atom() %%% | none @@ -86,16 +86,16 @@ serve_loop(This) -> ?R0(Trans, effectful_close), serve_loop(This). - + serve_loop_loop(This, Prot) -> - Next = + Next = try Handler = oop:get(This, handler), Processor = oop:get(This, processor), Val = apply(Processor, process, [Handler, Prot, Prot]), %% TODO(cpiro): make processor a gen_server instance error_logger:info_msg("request processed: rv=~p", [Val]), loop - catch + catch %% TODO(cpiro) case when is_record(...) to pick out our exception %% records vs. normal erlang throws E when is_record(E, tTransportException) -> @@ -105,7 +105,7 @@ serve_loop_loop(This, Prot) -> error_logger:info_msg("EXCEPTION: ~p", [F]), close end, - case Next of + case Next of loop -> serve_loop_loop(This, Prot); close -> ok end. diff --git a/lib/erl/src/tProcessor.erl b/lib/erl/src/tProcessor.erl index 003748a7a..b62e5ad0c 100644 --- a/lib/erl/src/tProcessor.erl +++ b/lib/erl/src/tProcessor.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ @@ -25,7 +25,7 @@ %%% %%% behavior callbacks %%% - + %%% super() -> SuperModule = atom() %%% | none diff --git a/lib/erl/src/thrift_app.erl b/lib/erl/src/thrift_app.erl index dabc7ed43..17a14cf1b 100644 --- a/lib/erl/src/thrift_app.erl +++ b/lib/erl/src/thrift_app.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ @@ -15,7 +15,7 @@ %%% behavior definition %%% -start(_Type, _StartArgs) -> +start(_Type, _StartArgs) -> io:format("starting thrift~n"), thrift_logger:install(), {ok, Sup} = thrift_app_sup:start_link(), diff --git a/lib/erl/src/thrift_app_sup.erl b/lib/erl/src/thrift_app_sup.erl index 3a44c3f48..545ffa871 100644 --- a/lib/erl/src/thrift_app_sup.erl +++ b/lib/erl/src/thrift_app_sup.erl @@ -1,6 +1,6 @@ %%% Copyright (c) 2007- Facebook %%% Distributed under the Thrift Software License -%%% +%%% %%% See accompanying file LICENSE or visit the Thrift site at: %%% http://developers.facebook.com/thrift/ diff --git a/lib/hs/src/TBinaryProtocol.hs b/lib/hs/src/TBinaryProtocol.hs index dd5212d27..e02a0ee8d 100644 --- a/lib/hs/src/TBinaryProtocol.hs +++ b/lib/hs/src/TBinaryProtocol.hs @@ -11,11 +11,11 @@ module TBinaryProtocol (TBinaryProtocol(..)) where version_mask = 0xffff0000 version_1 = 0x80010000; - + getByte i b= 255 .&. (shiftR i (8*b)) getBytes i 0 = [] getBytes i n = (toEnum (getByte i (n-1)) :: Char):(getBytes i (n-1)) - + floatBits :: Double -> Word64 floatBits (D# d#) = W64# (unsafeCoerce# d#) @@ -44,7 +44,7 @@ module TBinaryProtocol (TBinaryProtocol(..)) where twrite tr s writeBinary = writeString writeMessageBegin (TBinaryProtocol tr) (n,t,s) = do writeI32 (TBinaryProtocol tr) (version_1 .|. (fromEnum t)) - writeString (TBinaryProtocol tr) n + writeString (TBinaryProtocol tr) n writeI32 (TBinaryProtocol tr) s writeMessageEnd (TBinaryProtocol tr) = return () writeStructBegin (TBinaryProtocol tr) s = return () @@ -81,7 +81,7 @@ module TBinaryProtocol (TBinaryProtocol(..)) where if (ver .&. version_mask /= version_1) then throwDyn (ProtocolExn PE_BAD_VERSION "Missing version identifier") else do - s <- readString (TBinaryProtocol tr) + s <- readString (TBinaryProtocol tr) sz <- readI32 (TBinaryProtocol tr) return (s,toEnum (ver .&. 0xFF) :: Message_type,fromIntegral sz :: Int) readMessageEnd (TBinaryProtocol tr) = return () @@ -106,5 +106,5 @@ module TBinaryProtocol (TBinaryProtocol(..)) where readSetEnd = readListEnd pflush (TBinaryProtocol tr) = tflush tr - + diff --git a/lib/hs/src/TChannelTransport.hs b/lib/hs/src/TChannelTransport.hs index df1aedc39..bf2e8a6aa 100644 --- a/lib/hs/src/TChannelTransport.hs +++ b/lib/hs/src/TChannelTransport.hs @@ -10,7 +10,7 @@ instance TTransport TChannelTrans where topen a = return a tclose a = return a tread a 0 = return [] - tread (TChannelTrans h) i = Prelude.catch + tread (TChannelTrans h) i = Prelude.catch (do c <- hGetChar h t <- tread (TChannelTrans h) (i-1) return $ c:t) diff --git a/lib/hs/src/TServer.hs b/lib/hs/src/TServer.hs index 83a6ee3f7..4676fc1a4 100644 --- a/lib/hs/src/TServer.hs +++ b/lib/hs/src/TServer.hs @@ -11,19 +11,19 @@ proc_loop hand proc ps = do v <-proc hand ps if v then proc_loop hand proc ps else return () -accept_loop accepter hand sock proc transgen iprotgen oprotgen = +accept_loop accepter hand sock proc transgen iprotgen oprotgen = do (h,hn,_) <- accepter sock - let t = transgen h + let t = transgen h let ip = iprotgen t let op = oprotgen t forkIO (handle (\e -> return ()) (proc_loop hand proc (ip,op))) accept_loop accepter hand sock proc transgen iprotgen oprotgen - -run_threaded_server accepter listener hand proc port transgen iprotgen oprotgen = + +run_threaded_server accepter listener hand proc port transgen iprotgen oprotgen = do sock <- listener accept_loop accepter hand sock proc transgen iprotgen oprotgen return () - + -- A basic threaded binary protocol socket server. run_basic_server hand proc port = run_threaded_server accept (listenOn (PortNumber port)) hand proc port TChannelTrans TBinaryProtocol TBinaryProtocol diff --git a/lib/hs/src/TSocket.hs b/lib/hs/src/TSocket.hs index 7e7287861..ea23345d7 100644 --- a/lib/hs/src/TSocket.hs +++ b/lib/hs/src/TSocket.hs @@ -11,15 +11,15 @@ instance TTransport TSocket where Just _ -> True Nothing -> False topen a = do h <- connectTo (host a) (PortNumber (port a)) - return $ (a{chan = Just h}) - tclose a = case chan a of + return $ (a{chan = Just h}) + tclose a = case chan a of Just h -> do hClose h return $ a{chan=Nothing} Nothing -> return a tread a 0 = return [] - tread a n = case chan a of + tread a n = case chan a of Just h -> handle (\e -> throwDyn (TransportExn "TSocket: Could not read." TE_UNKNOWN)) - (do c <- hGetChar h + (do c <- hGetChar h l <- tread a (n-1) return $ c:l) Nothing -> return [] diff --git a/lib/hs/src/Thrift.hs b/lib/hs/src/Thrift.hs index 4087b2ba4..6b9462661 100644 --- a/lib/hs/src/Thrift.hs +++ b/lib/hs/src/Thrift.hs @@ -33,25 +33,25 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) return ret else do r <- treadAll a (len-rl) return (ret++r) - - - data T_type = T_STOP - | T_VOID + + + data T_type = T_STOP + | T_VOID | T_BOOL | T_BYTE - | T_I08 - | T_I16 - | T_I32 - | T_U64 - | T_I64 - | T_DOUBLE - | T_STRING - | T_UTF7 - | T_STRUCT - | T_MAP - | T_SET - | T_LIST - | T_UTF8 + | T_I08 + | T_I16 + | T_I32 + | T_U64 + | T_I64 + | T_DOUBLE + | T_STRING + | T_UTF7 + | T_STRUCT + | T_MAP + | T_SET + | T_LIST + | T_UTF8 | T_UTF16 | T_UNKNOWN deriving (Eq) @@ -75,49 +75,49 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) T_LIST -> 15 T_UTF8 -> 16 T_UTF16 -> 17 - T_UNKNOWN -> -1 - toEnum t = case t of - 0 -> T_STOP - 1 -> T_VOID + T_UNKNOWN -> -1 + toEnum t = case t of + 0 -> T_STOP + 1 -> T_VOID 2 -> T_BOOL 3 -> T_BYTE - 6-> T_I16 - 8 -> T_I32 - 9 -> T_U64 - 10 -> T_I64 - 4 -> T_DOUBLE + 6-> T_I16 + 8 -> T_I32 + 9 -> T_U64 + 10 -> T_I64 + 4 -> T_DOUBLE 11 -> T_STRING 12 -> T_STRUCT - 13 -> T_MAP - 14 -> T_SET - 15 -> T_LIST - 16 -> T_UTF8 + 13 -> T_MAP + 14 -> T_SET + 15 -> T_LIST + 16 -> T_UTF8 17 -> T_UTF16 _ -> T_UNKNOWN - - + + data Message_type = M_CALL | M_REPLY | M_EXCEPTION | M_UNKNOWN deriving Eq instance Enum Message_type where - + fromEnum t = case t of M_CALL -> 1 M_REPLY -> 2 M_EXCEPTION -> 3 M_UNKNOWN -> -1 - + toEnum t = case t of 1 -> M_CALL 2 -> M_REPLY 3 -> M_EXCEPTION _ -> M_UNKNOWN - - - - + + + + class Protocol a where pflush :: a -> IO () writeMessageBegin :: a -> ([Char],Message_type,Int) -> IO () @@ -221,9 +221,9 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) T_UTF8 -> return () T_UTF16 -> return () T_UNKNOWN -> return () - - - data PE_type = PE_UNKNOWN + + + data PE_type = PE_UNKNOWN | PE_INVALID_DATA | PE_NEGATIVE_SIZE | PE_SIZE_LIMIT @@ -231,7 +231,7 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) deriving (Eq, Data, Typeable) data ProtocolExn = ProtocolExn PE_type [Char] deriving (Typeable, Data) - + data AE_type = AE_UNKNOWN | AE_UNKNOWN_METHOD | AE_INVALID_MESSAGE_TYPE @@ -239,7 +239,7 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) | AE_BAD_SEQUENCE_ID | AE_MISSING_RESULT deriving (Eq, Data, Typeable) - + instance Enum AE_type where toEnum i = case i of 0 -> AE_UNKNOWN @@ -256,9 +256,9 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) AE_WRONG_METHOD_NAME -> 3 AE_BAD_SEQUENCE_ID -> 4 AE_MISSING_RESULT -> 5 - + data AppExn = AppExn {ae_type :: AE_type, ae_message :: [Char]} deriving (Typeable, Data) - + readAppExnFields pt rec = do (n,ft,id) <- readFieldBegin pt if ft == T_STOP then return rec else @@ -276,13 +276,13 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) _ -> do skip pt ft readFieldEnd pt readAppExnFields pt rec - + readAppExn pt = do readStructBegin pt rec <- readAppExnFields pt (AppExn {ae_type = undefined, ae_message = undefined}) readStructEnd pt return rec - - + + writeAppExn pt ae = do writeStructBegin pt "TApplicationException" if ae_message ae /= "" then do writeFieldBegin pt ("message",T_STRING,1) @@ -295,4 +295,4 @@ module Thrift (TransportExn(..),TransportExn_Type(..),TTransport(..), T_type(..) writeFieldStop pt writeStructEnd pt - + diff --git a/lib/java/COPYING b/lib/java/COPYING index 039f21e3e..0101a7dc8 100644 --- a/lib/java/COPYING +++ b/lib/java/COPYING @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/java/LICENSE b/lib/java/LICENSE index 039f21e3e..0101a7dc8 100644 --- a/lib/java/LICENSE +++ b/lib/java/LICENSE @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/java/src/TApplicationException.java b/lib/java/src/TApplicationException.java index fdce9f5c8..893a38961 100644 --- a/lib/java/src/TApplicationException.java +++ b/lib/java/src/TApplicationException.java @@ -59,21 +59,21 @@ public class TApplicationException extends TException { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) { case 1: if (field.type == TType.STRING) { message = iprot.readString(); - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: if (field.type == TType.I32) { type = iprot.readI32(); - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/TException.java b/lib/java/src/TException.java index 77eed3e80..a328bfd95 100644 --- a/lib/java/src/TException.java +++ b/lib/java/src/TException.java @@ -19,7 +19,7 @@ public class TException extends Exception { public TException(String message) { super(message); } - + public TException(Throwable cause) { super(cause); } diff --git a/lib/java/src/TProcessorFactory.java b/lib/java/src/TProcessorFactory.java index ace90a233..5bac1ba55 100644 --- a/lib/java/src/TProcessorFactory.java +++ b/lib/java/src/TProcessorFactory.java @@ -15,11 +15,11 @@ import com.facebook.thrift.transport.TTransport; public class TProcessorFactory { private final TProcessor processor_; - + public TProcessorFactory(TProcessor processor) { processor_ = processor; } - + public TProcessor getProcessor(TTransport trans) { return processor_; } diff --git a/lib/java/src/protocol/TBinaryProtocol.java b/lib/java/src/protocol/TBinaryProtocol.java index b9167d24d..750dce11e 100644 --- a/lib/java/src/protocol/TBinaryProtocol.java +++ b/lib/java/src/protocol/TBinaryProtocol.java @@ -27,7 +27,7 @@ public class TBinaryProtocol extends TProtocol { protected int readLength_; protected boolean checkReadLength_ = false; - + /** * Factory */ @@ -321,7 +321,7 @@ public class TBinaryProtocol extends TProtocol { checkReadLength(len); return trans_.readAll(buf, off, len); } - + public void setReadLength(int readLength) { readLength_ = readLength; checkReadLength_ = true; @@ -335,5 +335,5 @@ public class TBinaryProtocol extends TProtocol { } } } - + } diff --git a/lib/java/src/protocol/TList.java b/lib/java/src/protocol/TList.java index d1c76420c..3fe85990f 100644 --- a/lib/java/src/protocol/TList.java +++ b/lib/java/src/protocol/TList.java @@ -13,7 +13,7 @@ package com.facebook.thrift.protocol; */ public class TList { public TList() {} - + public TList(byte t, int s) { elemType = t; size = s; diff --git a/lib/java/src/protocol/TMap.java b/lib/java/src/protocol/TMap.java index 0a0e4df1b..9b7126e00 100644 --- a/lib/java/src/protocol/TMap.java +++ b/lib/java/src/protocol/TMap.java @@ -13,7 +13,7 @@ package com.facebook.thrift.protocol; */ public class TMap { public TMap() {} - + public TMap(byte k, byte v, int s) { keyType = k; valueType = v; diff --git a/lib/java/src/protocol/TProtocol.java b/lib/java/src/protocol/TProtocol.java index 08a7ef31b..3e7e7f05b 100644 --- a/lib/java/src/protocol/TProtocol.java +++ b/lib/java/src/protocol/TProtocol.java @@ -23,7 +23,7 @@ public abstract class TProtocol { /** * Transport - */ + */ protected TTransport trans_; /** @@ -32,7 +32,7 @@ public abstract class TProtocol { protected TProtocol(TTransport trans) { trans_ = trans; } - + /** * Transport accessor */ @@ -47,7 +47,7 @@ public abstract class TProtocol { public abstract void writeMessageBegin(TMessage message) throws TException; public abstract void writeMessageEnd() throws TException; - + public abstract void writeStructBegin(TStruct struct) throws TException; public abstract void writeStructEnd() throws TException; @@ -99,9 +99,9 @@ public abstract class TProtocol { public abstract void readStructEnd() throws TException; public abstract TField readFieldBegin() throws TException; - + public abstract void readFieldEnd() throws TException; - + public abstract TMap readMapBegin() throws TException; public abstract void readMapEnd() throws TException; @@ -121,7 +121,7 @@ public abstract class TProtocol { public abstract short readI16() throws TException; public abstract int readI32() throws TException; - + public abstract long readI64() throws TException; public abstract double readDouble() throws TException; diff --git a/lib/java/src/protocol/TProtocolUtil.java b/lib/java/src/protocol/TProtocolUtil.java index ad333bc2a..0b85d38b4 100644 --- a/lib/java/src/protocol/TProtocolUtil.java +++ b/lib/java/src/protocol/TProtocolUtil.java @@ -80,7 +80,7 @@ public class TProtocolUtil { break; } case TType.SET: - { + { TSet set = prot.readSetBegin(); for (int i = 0; i < set.size; i++) { skip(prot, set.elemType); diff --git a/lib/java/src/reflection/limited/Argument.java b/lib/java/src/reflection/limited/Argument.java index c24e07e33..2a485e82a 100644 --- a/lib/java/src/reflection/limited/Argument.java +++ b/lib/java/src/reflection/limited/Argument.java @@ -49,7 +49,7 @@ public class Argument implements java.io.Serializable { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) @@ -58,7 +58,7 @@ public class Argument implements java.io.Serializable { if (field.type == TType.I16) { this.key = iprot.readI16(); this.__isset.key = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -66,7 +66,7 @@ public class Argument implements java.io.Serializable { if (field.type == TType.STRING) { this.name = iprot.readString(); this.__isset.name = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -75,7 +75,7 @@ public class Argument implements java.io.Serializable { this.type = new ThriftType(); this.type.read(iprot); this.__isset.type = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/reflection/limited/ContainerType.java b/lib/java/src/reflection/limited/ContainerType.java index 11d387292..6c8bcc319 100644 --- a/lib/java/src/reflection/limited/ContainerType.java +++ b/lib/java/src/reflection/limited/ContainerType.java @@ -49,7 +49,7 @@ public class ContainerType implements java.io.Serializable { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) @@ -58,7 +58,7 @@ public class ContainerType implements java.io.Serializable { if (field.type == TType.I32) { this.ttype = iprot.readI32(); this.__isset.ttype = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -67,7 +67,7 @@ public class ContainerType implements java.io.Serializable { this.subtype1 = new SimpleType(); this.subtype1.read(iprot); this.__isset.subtype1 = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -76,7 +76,7 @@ public class ContainerType implements java.io.Serializable { this.subtype2 = new SimpleType(); this.subtype2.read(iprot); this.__isset.subtype2 = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/reflection/limited/Method.java b/lib/java/src/reflection/limited/Method.java index 64ba21d73..41fa6ca15 100644 --- a/lib/java/src/reflection/limited/Method.java +++ b/lib/java/src/reflection/limited/Method.java @@ -49,7 +49,7 @@ public class Method implements java.io.Serializable { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) @@ -58,7 +58,7 @@ public class Method implements java.io.Serializable { if (field.type == TType.STRING) { this.name = iprot.readString(); this.__isset.name = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -67,7 +67,7 @@ public class Method implements java.io.Serializable { this.return_type = new ThriftType(); this.return_type.read(iprot); this.__isset.return_type = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -86,7 +86,7 @@ public class Method implements java.io.Serializable { iprot.readListEnd(); } this.__isset.arguments = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/reflection/limited/Service.java b/lib/java/src/reflection/limited/Service.java index f3a9481c7..fcbd09cef 100644 --- a/lib/java/src/reflection/limited/Service.java +++ b/lib/java/src/reflection/limited/Service.java @@ -49,7 +49,7 @@ public class Service implements java.io.Serializable { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) @@ -58,7 +58,7 @@ public class Service implements java.io.Serializable { if (field.type == TType.STRING) { this.name = iprot.readString(); this.__isset.name = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -77,7 +77,7 @@ public class Service implements java.io.Serializable { iprot.readListEnd(); } this.__isset.methods = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -85,7 +85,7 @@ public class Service implements java.io.Serializable { if (field.type == TType.BOOL) { this.fully_reflected = iprot.readBool(); this.__isset.fully_reflected = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/reflection/limited/SimpleType.java b/lib/java/src/reflection/limited/SimpleType.java index c0feae63d..2a69e3927 100644 --- a/lib/java/src/reflection/limited/SimpleType.java +++ b/lib/java/src/reflection/limited/SimpleType.java @@ -44,7 +44,7 @@ public class SimpleType implements java.io.Serializable { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) @@ -53,7 +53,7 @@ public class SimpleType implements java.io.Serializable { if (field.type == TType.I32) { this.ttype = iprot.readI32(); this.__isset.ttype = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -61,7 +61,7 @@ public class SimpleType implements java.io.Serializable { if (field.type == TType.STRING) { this.name = iprot.readString(); this.__isset.name = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/reflection/limited/ThriftType.java b/lib/java/src/reflection/limited/ThriftType.java index d3bb3eb97..63022ec0d 100644 --- a/lib/java/src/reflection/limited/ThriftType.java +++ b/lib/java/src/reflection/limited/ThriftType.java @@ -49,7 +49,7 @@ public class ThriftType implements java.io.Serializable { while (true) { field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { + if (field.type == TType.STOP) { break; } switch (field.id) @@ -58,7 +58,7 @@ public class ThriftType implements java.io.Serializable { if (field.type == TType.BOOL) { this.is_container = iprot.readBool(); this.__isset.is_container = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -67,7 +67,7 @@ public class ThriftType implements java.io.Serializable { this.simple_type = new SimpleType(); this.simple_type.read(iprot); this.__isset.simple_type = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; @@ -76,7 +76,7 @@ public class ThriftType implements java.io.Serializable { this.container_type = new ContainerType(); this.container_type.read(iprot); this.__isset.container_type = true; - } else { + } else { TProtocolUtil.skip(iprot, field.type); } break; diff --git a/lib/java/src/server/TServer.java b/lib/java/src/server/TServer.java index 2ac322aec..c066607c6 100644 --- a/lib/java/src/server/TServer.java +++ b/lib/java/src/server/TServer.java @@ -56,7 +56,7 @@ public abstract class TServer { protected TServer(TProcessorFactory processorFactory, TServerTransport serverTransport) { this(processorFactory, - serverTransport, + serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(), @@ -99,7 +99,7 @@ public abstract class TServer { inputProtocolFactory_ = inputProtocolFactory; outputProtocolFactory_ = outputProtocolFactory; } - + /** * The run method fires up the server and gets things going. */ diff --git a/lib/java/src/server/TSimpleServer.java b/lib/java/src/server/TSimpleServer.java index cb127c729..bf66843c7 100644 --- a/lib/java/src/server/TSimpleServer.java +++ b/lib/java/src/server/TSimpleServer.java @@ -42,8 +42,8 @@ public class TSimpleServer extends TServer { TTransportFactory inputTransportFactory, TTransportFactory outputTransportFactory, TProtocolFactory inputProtocolFactory, - TProtocolFactory outputProtocolFactory) { - super(new TProcessorFactory(processor), serverTransport, + TProtocolFactory outputProtocolFactory) { + super(new TProcessorFactory(processor), serverTransport, inputTransportFactory, outputTransportFactory, inputProtocolFactory, outputProtocolFactory); } @@ -65,13 +65,13 @@ public class TSimpleServer extends TServer { TTransportFactory inputTransportFactory, TTransportFactory outputTransportFactory, TProtocolFactory inputProtocolFactory, - TProtocolFactory outputProtocolFactory) { - super(processorFactory, serverTransport, + TProtocolFactory outputProtocolFactory) { + super(processorFactory, serverTransport, inputTransportFactory, outputTransportFactory, inputProtocolFactory, outputProtocolFactory); } - - + + public void serve() { stopped_ = false; try { diff --git a/lib/java/src/transport/TIOStreamTransport.java b/lib/java/src/transport/TIOStreamTransport.java index e9998b901..5fef3b74c 100644 --- a/lib/java/src/transport/TIOStreamTransport.java +++ b/lib/java/src/transport/TIOStreamTransport.java @@ -55,7 +55,7 @@ public class TIOStreamTransport extends TTransport { * * @param is Input stream to read from * @param os Output stream to read from - */ + */ public TIOStreamTransport(InputStream is, OutputStream os) { inputStream_ = is; outputStream_ = os; diff --git a/lib/java/src/transport/TServerSocket.java b/lib/java/src/transport/TServerSocket.java index cc6d9004a..2692ac43f 100644 --- a/lib/java/src/transport/TServerSocket.java +++ b/lib/java/src/transport/TServerSocket.java @@ -18,7 +18,7 @@ import java.net.SocketException; * @author Mark Slee <mcslee@facebook.com> */ public class TServerSocket extends TServerTransport { - + /** * Underlying serversocket object */ @@ -85,7 +85,7 @@ public class TServerSocket extends TServerTransport { } } } - + protected TSocket acceptImpl() throws TTransportException { if (serverSocket_ == null) { throw new TTransportException(TTransportException.NOT_OPEN, "No underlying server socket."); diff --git a/lib/java/src/transport/TSocket.java b/lib/java/src/transport/TSocket.java index 2c17e436b..20538502e 100644 --- a/lib/java/src/transport/TSocket.java +++ b/lib/java/src/transport/TSocket.java @@ -24,7 +24,7 @@ public class TSocket extends TIOStreamTransport { * Wrapped Socket object */ private Socket socket_ = null; - + /** * Remote host */ diff --git a/lib/ocaml/README b/lib/ocaml/README index b3043676a..222a4b90b 100644 --- a/lib/ocaml/README +++ b/lib/ocaml/README @@ -2,7 +2,7 @@ Library ------- The library abstract classes, exceptions, and general use functions are mostly jammed in Thrift.ml (an exception being -TServer). +TServer). Generally, classes are used, however they are often put in their own module along with other relevant types and functions. The classes @@ -24,7 +24,7 @@ class). The class type is t and is in a module with the name of the struct. -enum format +enum format ----------- Enums are put in their own module along with functions to_i and of_i which convert the ocaml types into ints. For diff --git a/lib/ocaml/src/TBinaryProtocol.ml b/lib/ocaml/src/TBinaryProtocol.ml index fa84e7125..109eeaaf6 100644 --- a/lib/ocaml/src/TBinaryProtocol.ml +++ b/lib/ocaml/src/TBinaryProtocol.ml @@ -10,7 +10,7 @@ let tv = P.t_type_to_i let vt = P.t_type_of_i -let comp_int b n = +let comp_int b n = let s = ref 0l in let sb = 32 - 8*n in for i=0 to (n-1) do @@ -32,7 +32,7 @@ class t trans = object (self) inherit P.t trans val ibyte = String.create 8 - method writeBool b = + method writeBool b = ibyte.[0] <- char_of_int (if b then 1 else 0); trans#write ibyte 0 1 method writeByte i = @@ -88,7 +88,7 @@ object (self) self#writeByte (tv t); self#writeI32 s method writeSetEnd = () - method readByte = + method readByte = ignore (trans#readAll ibyte 0 1); (comp_int ibyte 1) method readI16 = @@ -124,7 +124,7 @@ object (self) "" method readStructEnd = () method readFieldBegin = - let t = (vt (self#readByte)) + let t = (vt (self#readByte)) in if t != P.T_STOP then ("",t,self#readI16) diff --git a/lib/ocaml/src/TChannelTransport.ml b/lib/ocaml/src/TChannelTransport.ml index 5407a8e88..9678e5ab8 100644 --- a/lib/ocaml/src/TChannelTransport.ml +++ b/lib/ocaml/src/TChannelTransport.ml @@ -8,12 +8,12 @@ object (self) method isOpen = opened method opn = () method close = close_in i; opened <- false - method read buf off len = + method read buf off len = if opened then - try + try really_input i buf off len; len with _ -> raise (T.E (T.UNKNOWN, ("TChannelTransport: Could not read "^(string_of_int len)))) - else + else raise (T.E (T.NOT_OPEN, "TChannelTransport: Channel was closed")) method write buf off len = output o buf off len method flush = flush o diff --git a/lib/ocaml/src/TServer.ml b/lib/ocaml/src/TServer.ml index 5fb8089bb..bd97ab97b 100644 --- a/lib/ocaml/src/TServer.ml +++ b/lib/ocaml/src/TServer.ml @@ -1,7 +1,7 @@ open Thrift class virtual t - (pf : Processor.t) + (pf : Processor.t) (st : Transport.server_t) (tf : Transport.factory) (ipf : Protocol.factory) diff --git a/lib/ocaml/src/TServerSocket.ml b/lib/ocaml/src/TServerSocket.ml index 9e797060d..1e8260960 100644 --- a/lib/ocaml/src/TServerSocket.ml +++ b/lib/ocaml/src/TServerSocket.ml @@ -11,7 +11,7 @@ object Unix.listen s 256 method close = match sock with - Some s -> Unix.shutdown s Unix.SHUTDOWN_ALL; Unix.close s; + Some s -> Unix.shutdown s Unix.SHUTDOWN_ALL; Unix.close s; sock <- None | _ -> () method acceptImpl = diff --git a/lib/ocaml/src/TSocket.ml b/lib/ocaml/src/TSocket.ml index 20c861322..2d824377c 100644 --- a/lib/ocaml/src/TSocket.ml +++ b/lib/ocaml/src/TSocket.ml @@ -7,34 +7,34 @@ object (self) inherit T.t val mutable chans = None method isOpen = chans != None - method opn = + method opn = try let addr = (let {Unix.h_addr_list=x} = Unix.gethostbyname host in x.(0)) in chans <- Some(Unix.open_connection (Unix.ADDR_INET (addr,port))) - with + with Unix.Unix_error (e,fn,_) -> raise (T.E (T.NOT_OPEN, ("TSocket: Could not connect to "^host^":"^(string_of_int port)^" because: "^fn^":"^(Unix.error_message e)))) | _ -> raise (T.E (T.NOT_OPEN, ("TSocket: Could not connect to "^host^":"^(string_of_int port)))) - method close = - match chans with - None -> () - | Some(inc,out) -> (Unix.shutdown_connection inc; - close_in inc; + method close = + match chans with + None -> () + | Some(inc,out) -> (Unix.shutdown_connection inc; + close_in inc; chans <- None) method read buf off len = match chans with None -> raise (T.E (T.NOT_OPEN, "TSocket: Socket not open")) - | Some(i,o) -> - try + | Some(i,o) -> + try really_input i buf off len; len with Unix.Unix_error (e,fn,_) -> raise (T.E (T.UNKNOWN, ("TSocket: Could not read "^(string_of_int len)^" from "^host^":"^(string_of_int port)^" because: "^fn^":"^(Unix.error_message e)))) | _ -> raise (T.E (T.UNKNOWN, ("TSocket: Could not read "^(string_of_int len)^" from "^host^":"^(string_of_int port)))) - method write buf off len = match chans with + method write buf off len = match chans with None -> raise (T.E (T.NOT_OPEN, "TSocket: Socket not open")) | Some(i,o) -> output o buf off len method flush = match chans with None -> raise (T.E (T.NOT_OPEN, "TSocket: Socket not open")) | Some(i,o) -> flush o end - - + + diff --git a/lib/ocaml/src/TThreadedServer.ml b/lib/ocaml/src/TThreadedServer.ml index 10f161411..702cb2269 100644 --- a/lib/ocaml/src/TThreadedServer.ml +++ b/lib/ocaml/src/TThreadedServer.ml @@ -1,7 +1,7 @@ open Thrift -class t - (pf : Processor.t) +class t + (pf : Processor.t) (st : Transport.server_t) (tf : Transport.factory) (ipf : Protocol.factory) @@ -12,8 +12,8 @@ object st#listen; while true do let tr = tf#getTransport (st#accept) in - ignore (Thread.create - (fun _ -> + ignore (Thread.create + (fun _ -> let ip = ipf#getProtocol tr in let op = opf#getProtocol tr in try @@ -23,4 +23,4 @@ object with _ -> ()) ()) done end - + diff --git a/lib/ocaml/src/Thrift.ml b/lib/ocaml/src/Thrift.ml index 92c015b60..1a9130f34 100644 --- a/lib/ocaml/src/Thrift.ml +++ b/lib/ocaml/src/Thrift.ml @@ -2,7 +2,7 @@ exception Break;; exception Thrift_error;; exception Field_empty of string;; -class t_exn = +class t_exn = object val mutable message = "" method get_message = message @@ -11,7 +11,7 @@ end;; module Transport = struct - type exn_type = + type exn_type = | UNKNOWN | NOT_OPEN | ALREADY_OPEN @@ -52,31 +52,31 @@ struct method virtual close : unit method virtual acceptImpl : t end - + end;; module Protocol = struct - type t_type = - | T_STOP - | T_VOID + type t_type = + | T_STOP + | T_VOID | T_BOOL | T_BYTE - | T_I08 - | T_I16 - | T_I32 - | T_U64 - | T_I64 - | T_DOUBLE - | T_STRING - | T_UTF7 - | T_STRUCT - | T_MAP - | T_SET - | T_LIST - | T_UTF8 + | T_I08 + | T_I16 + | T_I32 + | T_U64 + | T_I64 + | T_DOUBLE + | T_STRING + | T_UTF7 + | T_STRUCT + | T_MAP + | T_SET + | T_LIST + | T_UTF8 | T_UTF16 let t_type_to_i = function @@ -98,25 +98,25 @@ struct | T_LIST -> 15 | T_UTF8 -> 16 | T_UTF16 -> 17 - + let t_type_of_i = function - 0 -> T_STOP - | 1 -> T_VOID + 0 -> T_STOP + | 1 -> T_VOID | 2 -> T_BOOL | 3 -> T_BYTE - | 6-> T_I16 - | 8 -> T_I32 - | 9 -> T_U64 - | 10 -> T_I64 - | 4 -> T_DOUBLE + | 6-> T_I16 + | 8 -> T_I32 + | 9 -> T_U64 + | 10 -> T_I64 + | 4 -> T_DOUBLE | 11 -> T_STRING | 12 -> T_STRUCT - | 13 -> T_MAP - | 14 -> T_SET - | 15 -> T_LIST - | 16 -> T_UTF8 + | 13 -> T_MAP + | 14 -> T_SET + | 15 -> T_LIST + | 16 -> T_UTF8 | 17 -> T_UTF16 - | _ -> raise Thrift_error + | _ -> raise Thrift_error type message_type = | CALL @@ -128,7 +128,7 @@ struct | REPLY -> 2 | EXCEPTION -> 3 - let message_type_of_i = function + let message_type_of_i = function | 1 -> CALL | 2 -> REPLY | 3 -> EXCEPTION @@ -182,7 +182,7 @@ struct method virtual readString : string method virtual readBinary : string (* skippage *) - method skip typ = + method skip typ = match typ with | T_STOP -> () | T_VOID -> () @@ -192,7 +192,7 @@ struct | T_I16 -> ignore self#readI16 | T_I32 -> ignore self#readI32 | T_U64 - | T_I64 -> ignore self#readI64 + | T_I64 -> ignore self#readI64 | T_DOUBLE -> ignore self#readDouble | T_STRING -> ignore self#readString | T_UTF7 -> () @@ -202,7 +202,7 @@ struct let (_,t,_) = self#readFieldBegin in if t = T_STOP then raise Break - else + else (self#skip t; self#readFieldEnd) done @@ -241,8 +241,8 @@ struct | BAD_VERSION exception E of exn_type * string;; - -end;; + +end;; module Processor = @@ -251,10 +251,10 @@ struct object method virtual process : Protocol.t -> Protocol.t -> bool end;; - + class factory (processor : t) = object - val processor_ = processor + val processor_ = processor method getProcessor (trans : Transport.t) = processor_ end;; end @@ -306,18 +306,18 @@ struct oprot#writeFieldStop; oprot#writeStructEnd end;; - + let create typ msg = let e = new t in e#set_type typ; e#set_message msg; e - + let read (iprot : Protocol.t) = let msg = ref "" in let typ = ref 0 in ignore iprot#readStructBegin; - (try + (try while true do let (name,ft,id) =iprot#readFieldBegin in if ft = Protocol.T_STOP then @@ -341,6 +341,6 @@ struct e#set_type (typ_of_i !typ); e#set_message !msg; e;; - + exception E of t end;; diff --git a/lib/perl/COPYING b/lib/perl/COPYING index 039f21e3e..0101a7dc8 100644 --- a/lib/perl/COPYING +++ b/lib/perl/COPYING @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/perl/LICENSE b/lib/perl/LICENSE index 039f21e3e..0101a7dc8 100644 --- a/lib/perl/LICENSE +++ b/lib/perl/LICENSE @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/perl/lib/Thrift/HttpClient.pm b/lib/perl/lib/Thrift/HttpClient.pm index 854149b15..9f79838cf 100644 --- a/lib/perl/lib/Thrift/HttpClient.pm +++ b/lib/perl/lib/Thrift/HttpClient.pm @@ -30,10 +30,10 @@ sub new my $classname = shift; my $url = shift || 'http://localhost:9090'; my $debugHandler = shift; - + my $out = IO::String->new; binmode($out); - + my $self = { url => $url, out => $out, @@ -111,9 +111,9 @@ sub readAll { my $self = shift; my $len = shift; - + my $buf = $self->read($len); - + if (!defined($buf)) { die new Thrift::TException('TSocket: Could not read '.$len.' bytes from input buffer'); } @@ -127,9 +127,9 @@ sub read { my $self = shift; my $len = shift; - + my $buf; - + my $in = $self->{in}; if (!defined($in)) { @@ -170,20 +170,20 @@ sub flush $ua->default_header('Accept' => 'application/x-thrift'); $ua->default_header('Content-Type' => 'application/x-thrift'); $ua->cookie_jar({}); # hash to remember cookies between redirects - + my $out = $self->{out}; $out->setpos(0); # rewind my $buf = join('', <$out>); - + my $request = new HTTP::Request(POST => $self->{url}, undef, $buf); my $response = $ua->request($request); my $content_ref = $response->content_ref; - + my $in = IO::String->new($content_ref); binmode($in); $self->{in} = $in; $in->setpos(0); # rewind - + # reset write buffer $out = IO::String->new; binmode($out); diff --git a/lib/php/COPYING b/lib/php/COPYING index 039f21e3e..0101a7dc8 100644 --- a/lib/php/COPYING +++ b/lib/php/COPYING @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/php/LICENSE b/lib/php/LICENSE index 039f21e3e..0101a7dc8 100644 --- a/lib/php/LICENSE +++ b/lib/php/LICENSE @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/php/src/ext/thrift_protocol/trunk/php_thrift_protocol.cpp b/lib/php/src/ext/thrift_protocol/trunk/php_thrift_protocol.cpp index 1df54d541..a66612810 100644 --- a/lib/php/src/ext/thrift_protocol/trunk/php_thrift_protocol.cpp +++ b/lib/php/src/ext/thrift_protocol/trunk/php_thrift_protocol.cpp @@ -148,7 +148,7 @@ protected: size_t buffer_remaining; size_t buffer_size; - zval* p; + zval* p; zval* t; zval funcname; }; @@ -161,7 +161,7 @@ void createObject(char* obj_typename, zval* return_value) { if (! ce) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", obj_typename); RETURN_NULL(); - } + } object_and_properties_init(return_value, ce, NULL); } @@ -173,7 +173,7 @@ void binary_deserialize(long thrift_typeID, PHPTransport& transport, zval* retur case T_STOP: case T_VOID: RETURN_NULL(); - return; + return; case T_STRUCT: { assert(structType); createObject(structType, return_value); @@ -195,10 +195,10 @@ void binary_deserialize(long thrift_typeID, PHPTransport& transport, zval* retur RETURN_BOOL(c != 0); } //case T_I08: // same numeric value as T_BYTE - case T_BYTE: { + case T_BYTE: { uint8_t c; transport.readBytes(&c, 1); - RETURN_LONG(c); + RETURN_LONG(c); } case T_I16: { uint16_t c; @@ -338,7 +338,7 @@ PHP_FUNCTION(thrift_protocol_binary_deserialize) { efree(args); RETURN_NULL(); } - + char* structType = NULL; if (argc >= 3) { if (Z_TYPE_PP(args[2]) == IS_STRING) { diff --git a/lib/php/src/protocol/TBinaryProtocol.php b/lib/php/src/protocol/TBinaryProtocol.php index f66f8eec0..874a5485a 100644 --- a/lib/php/src/protocol/TBinaryProtocol.php +++ b/lib/php/src/protocol/TBinaryProtocol.php @@ -314,34 +314,34 @@ class TBinaryProtocol extends TProtocol { // Check for a negative if ($isNeg) { - $hi = ~$hi & (int)0xffffffff; - $lo = ~$lo & (int)0xffffffff; - - if ($lo == (int)0xffffffff) { - $hi++; - $lo = 0; - } else { - $lo++; - } + $hi = ~$hi & (int)0xffffffff; + $lo = ~$lo & (int)0xffffffff; + + if ($lo == (int)0xffffffff) { + $hi++; + $lo = 0; + } else { + $lo++; + } } // Force 32bit words in excess of 2G to pe positive - we deal wigh sign // explicitly below if ($hi & (int)0x80000000) { - $hi &= (int)0x7fffffff; - $hi += 0x80000000; + $hi &= (int)0x7fffffff; + $hi += 0x80000000; } if ($lo & (int)0x80000000) { - $lo &= (int)0x7fffffff; - $lo += 0x80000000; + $lo &= (int)0x7fffffff; + $lo += 0x80000000; } $value = $hi * 4294967296 + $lo; if ($isNeg) { - $value = 0 - $value; + $value = 0 - $value; } } else { diff --git a/lib/py/src/reflection/limited/ttypes.py b/lib/py/src/reflection/limited/ttypes.py index ec58f6689..f6e639865 100644 --- a/lib/py/src/reflection/limited/ttypes.py +++ b/lib/py/src/reflection/limited/ttypes.py @@ -87,10 +87,10 @@ class SimpleType: oprot.writeFieldStop() oprot.writeStructEnd() - def __str__(self): + def __str__(self): return str(self.__dict__) - def __repr__(self): + def __repr__(self): return repr(self.__dict__) def __eq__(self, other): @@ -171,10 +171,10 @@ class ContainerType: oprot.writeFieldStop() oprot.writeStructEnd() - def __str__(self): + def __str__(self): return str(self.__dict__) - def __repr__(self): + def __repr__(self): return repr(self.__dict__) def __eq__(self, other): @@ -255,10 +255,10 @@ class ThriftType: oprot.writeFieldStop() oprot.writeStructEnd() - def __str__(self): + def __str__(self): return str(self.__dict__) - def __repr__(self): + def __repr__(self): return repr(self.__dict__) def __eq__(self, other): @@ -338,10 +338,10 @@ class Argument: oprot.writeFieldStop() oprot.writeStructEnd() - def __str__(self): + def __str__(self): return str(self.__dict__) - def __repr__(self): + def __repr__(self): return repr(self.__dict__) def __eq__(self, other): @@ -430,10 +430,10 @@ class Method: oprot.writeFieldStop() oprot.writeStructEnd() - def __str__(self): + def __str__(self): return str(self.__dict__) - def __repr__(self): + def __repr__(self): return repr(self.__dict__) def __eq__(self, other): @@ -521,10 +521,10 @@ class Service: oprot.writeFieldStop() oprot.writeStructEnd() - def __str__(self): + def __str__(self): return str(self.__dict__) - def __repr__(self): + def __repr__(self): return repr(self.__dict__) def __eq__(self, other): diff --git a/lib/py/src/server/TServer.py b/lib/py/src/server/TServer.py index 74bb93e5a..b6738f762 100644 --- a/lib/py/src/server/TServer.py +++ b/lib/py/src/server/TServer.py @@ -132,7 +132,7 @@ class TThreadPoolServer(TServer): self.serveClient(client) except Exception, x: print '%s, %s, %s' % (type(x), x, traceback.format_exc()) - + def serveClient(self, client): """Process input/output from a client for as long as possible""" itrans = self.inputTransportFactory.getTransport(client) @@ -158,7 +158,7 @@ class TThreadPoolServer(TServer): t.start() except Exception, x: print '%s, %s, %s,' % (type(x), x, traceback.format_exc()) - + # Pump the socket for clients self.serverTransport.listen() while True: diff --git a/lib/py/src/transport/THttpClient.py b/lib/py/src/transport/THttpClient.py index 7410fa4f3..9cf4039a9 100644 --- a/lib/py/src/transport/THttpClient.py +++ b/lib/py/src/transport/THttpClient.py @@ -28,7 +28,7 @@ class THttpClient(TTransportBase): def close(self): self.__http.close() self.__http = None - + def isOpen(self): return self.__http != None diff --git a/lib/py/src/transport/TSocket.py b/lib/py/src/transport/TSocket.py index 146820d82..732dbd7de 100644 --- a/lib/py/src/transport/TSocket.py +++ b/lib/py/src/transport/TSocket.py @@ -27,7 +27,7 @@ class TSocket(TTransportBase): self.handle = None self._unix_socket = unix_socket self._timeout = None - + def setHandle(self, h): self.handle = h @@ -39,7 +39,7 @@ class TSocket(TTransportBase): self._timeout = None else: self._timeout = ms/1000.0 - + if (self.handle != None): self.handle.settimeout(self._timeout) @@ -48,7 +48,7 @@ class TSocket(TTransportBase): return [(socket.AF_UNIX, socket.SOCK_STREAM, None, None, self._unix_socket)] else: return socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE | socket.AI_ADDRCONFIG) - + def open(self): try: res0 = self._resolveAddr() diff --git a/lib/rb/COPYING b/lib/rb/COPYING index 039f21e3e..0101a7dc8 100644 --- a/lib/rb/COPYING +++ b/lib/rb/COPYING @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/rb/LICENSE b/lib/rb/LICENSE index 039f21e3e..0101a7dc8 100644 --- a/lib/rb/LICENSE +++ b/lib/rb/LICENSE @@ -1,5 +1,5 @@ Thrift Software License -Copyright (c) 2006- Facebook, Inc. +Copyright (c) 2006- Facebook, Inc. Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by diff --git a/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb b/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb index a152bf274..ce0b1bb7c 100644 --- a/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb +++ b/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb @@ -29,7 +29,7 @@ class TBinaryProtocol < TProtocol writeByte(type) writeI16(id) end - + def writeFieldStop() writeByte(TType::STOP) end @@ -39,17 +39,17 @@ class TBinaryProtocol < TProtocol writeByte(vtype) writeI32(size) end - + def writeListBegin(etype, size) writeByte(etype) writeI32(size) end - + def writeSetBegin(etype, size) writeByte(etype) writeI32(size) end - + def writeBool(bool) if (bool) writeByte(1) @@ -69,7 +69,7 @@ class TBinaryProtocol < TProtocol def writeI32(i32) trans.write([i32].pack('N')) end - + def writeI64(i64) hi = i64 >> 32 lo = i64 & 0xffffffff @@ -79,7 +79,7 @@ class TBinaryProtocol < TProtocol def writeDouble(dub) trans.write([dub].pack('G')) end - + def writeString(str) writeI32(str.length) trans.write(str) @@ -95,7 +95,7 @@ class TBinaryProtocol < TProtocol seqid = readI32() return name, type, seqid end - + def readFieldBegin() type = readByte() if (type === TType::STOP) @@ -104,7 +104,7 @@ class TBinaryProtocol < TProtocol id = readI16() return nil, type, id end - + def readMapBegin() ktype = readByte() vtype = readByte() @@ -122,8 +122,8 @@ class TBinaryProtocol < TProtocol etype = readByte() size = readI32() return etype, size - end - + end + def readBool() byte = readByte() return byte != 0 @@ -146,7 +146,7 @@ class TBinaryProtocol < TProtocol end return val end - + def readI32() dat = trans.readAll(4) val, = dat.unpack('N') diff --git a/lib/rb/lib/thrift/protocol/tprotocol.rb b/lib/rb/lib/thrift/protocol/tprotocol.rb index fb43705b8..a06b4cd13 100644 --- a/lib/rb/lib/thrift/protocol/tprotocol.rb +++ b/lib/rb/lib/thrift/protocol/tprotocol.rb @@ -29,7 +29,7 @@ class TProtocolException < TException end class TProtocol - + attr_reader :trans def initialize(trans) @@ -39,87 +39,87 @@ class TProtocol def writeMessageBegin(name, type, seqid); nil; end def writeMessageEnd; nil; end - + def writeStructBegin(name); nil; end - + def writeStructEnd(); nil; end - + def writeFieldBegin(name, type, id); nil; end - + def writeFieldEnd(); nil; end - + def writeFieldStop(); nil; end def writeMapBegin(ktype, vtype, size); nil; end - + def writeMapEnd(); nil; end def writeListBegin(etype, size); nil; end - + def writeListEnd(); nil; end - + def writeSetBegin(etype, size); nil; end def writeSetEnd(); nil; end - + def writeBool(bool); nil; end - + def writeByte(byte); nil; end - + def writeI16(i16); nil; end - + def writeI32(i32); nil; end - + def writeI64(i64); nil; end - + def writeDouble(dub); nil; end - + def writeString(str); nil; end - + def readMessageBegin(); nil; end - + def readMessageEnd(); nil; end - + def readStructBegin(); nil; end - + def readStructEnd(); nil; end - + def readFieldBegin(); nil; end - + def readFieldEnd(); nil; end - + def readMapBegin(); nil; end - + def readMapEnd(); nil; end - + def readListBegin(); nil; end - + def readListEnd(); nil; end def readSetBegin(); nil; end - + def readSetEnd(); nil; end - + def readBool(); nil; end - + def readByte(); nil; end def readI16(); nil; end - + def readI32(); nil; end - + def readI64(); nil; end - + def readDouble(); nil; end - + def readString(); nil; end - + def write_field(name, type, fid, value) writeFieldBegin(name, type, fid) write_type(type, value) writeFieldEnd end - + def write_type(type, value) case type when TType::BOOL @@ -142,7 +142,7 @@ class TProtocol raise NotImplementedError end end - + def read_type(type) case type when TType::BOOL @@ -163,7 +163,7 @@ class TProtocol raise NotImplementedError end end - + def skip(type) if type === TType::STOP nil diff --git a/lib/rb/lib/thrift/server/tserver.rb b/lib/rb/lib/thrift/server/tserver.rb index d9ff621eb..43b2bdd9a 100644 --- a/lib/rb/lib/thrift/server/tserver.rb +++ b/lib/rb/lib/thrift/server/tserver.rb @@ -20,7 +20,7 @@ class TServer @transportFactory = transportFactory ? transportFactory : TTransportFactory.new() @protocolFactory = protocolFactory ? protocolFactory : TBinaryProtocolFactory.new() end - + def serve(); nil; end end diff --git a/lib/rb/setup.rb b/lib/rb/setup.rb index 424a5f37c..9f0c8267a 100644 --- a/lib/rb/setup.rb +++ b/lib/rb/setup.rb @@ -659,7 +659,7 @@ module FileOperations def ruby(*args) command config('rubyprog'), *args end - + def make(task = nil) command(*[config('makeprog'), task].compact) end @@ -722,7 +722,7 @@ module HookScriptAPI def srcdirectory?(path) File.dir?(srcfile(path)) end - + def srcfile?(path) File.file?(srcfile(path)) end @@ -826,7 +826,7 @@ class ToplevelInstaller __send__ "exec_#{task}" end end - + def run_metaconfigs @config.load_script "#{@ardir}/metaconfig" end @@ -1404,7 +1404,7 @@ class Installer end # picked up many entries from cvs-1.11.1/src/ignore.c - JUNK_FILES = %w( + JUNK_FILES = %w( core RCSLOG tags TAGS .make.state .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb *~ *.old *.bak *.BAK *.orig *.rej _$* *$ |