diff --git a/utils/cloudio/SMComm.cpp b/utils/cloudio/SMComm.cpp index 617c44895..491aee7d3 100644 --- a/utils/cloudio/SMComm.cpp +++ b/utils/cloudio/SMComm.cpp @@ -73,7 +73,6 @@ SMComm::SMComm() { char buf[4096]; cwd = ::getcwd(buf, 4096); - cout << "got cwd = " << cwd << endl; } SMComm::~SMComm() diff --git a/utils/cloudio/SocketPool.cpp b/utils/cloudio/SocketPool.cpp index a6fbada64..07c36e62d 100644 --- a/utils/cloudio/SocketPool.cpp +++ b/utils/cloudio/SocketPool.cpp @@ -90,7 +90,8 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream * const uint8_t *inbuf = in.buf(); int err = 0; - /* TODO: make these writes not send SIGPIPE */ + /* TODO: make these writes not send SIGPIPE + TODO: turn at least the header bits into a single write */ err = ::write(sock, &storagemanager::SM_MSG_START, sizeof(storagemanager::SM_MSG_START)); sm_check_error; err = ::write(sock, &length, sizeof(length)); @@ -142,6 +143,8 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream * } } + assert(i == 0); // in testing there shouldn't be any garbage in the stream + if (length == 0) // didn't find the header yet { // i == endOfData - 7 here @@ -156,6 +159,9 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream * out->needAtLeast(length); outbuf = out->getInputPtr(); memcpy(outbuf, &window[startOfPayload], endOfData - startOfPayload); + if (length < endOfData - startOfPayload) + cout << "SocketPool: warning! Probably got a bad length field! payload length = " << length << + " endOfData = " << endOfData << " startOfPayload = " << startOfPayload << endl; remainingBytes = length - (endOfData - startOfPayload); // remainingBytes is now the # of bytes left to read out->advanceInputPtr(endOfData - startOfPayload); break; // done looking for the header, can fill the output buffer directly now. diff --git a/utils/idbdatafile/IDBPolicy.cpp b/utils/idbdatafile/IDBPolicy.cpp index 9264fa784..b9eb29814 100644 --- a/utils/idbdatafile/IDBPolicy.cpp +++ b/utils/idbdatafile/IDBPolicy.cpp @@ -132,7 +132,7 @@ IDBDataFile::Types IDBPolicy::getType( const std::string& path, Contexts ctxt ) { bool isLocal = isLocalFile( path ); - if (isLocal) + if (isLocal || (!useHdfs() && !useCloud())) if (ctxt == PRIMPROC) return IDBDataFile::UNBUFFERED; else