FS-2746 --resolve large xmlrpc update thanks garmt

This commit is contained in:
Jeff Lenk committed 2012-10-13 11:37:25 -05:00
1 parent 37ecad9903
commit 6b6c83a718
397 files changed
+41821 -33840

No files matched your search

@@ -15,20 +15,21 @@
#include <string>
#include <queue>
#include <xmlrpc-c/c_util.h>
#include <xmlrpc-c/girmem.hpp>
namespace xmlrpc_c {
class packet : public girmem::autoObject {
class XMLRPC_DLLEXPORT packet : public girmem::autoObject {
public:
packet();
packet(const unsigned char * const data,
size_t const dataLength);
size_t const dataLength);
packet(const char * const data,
size_t const dataLength);
size_t const dataLength);
~packet();
@@ -54,7 +55,7 @@ private:
class packetPtr: public girmem::autoObjectPtr {
class XMLRPC_DLLEXPORT packetPtr: public girmem::autoObjectPtr {
public:
packetPtr();
@@ -67,7 +68,9 @@ public:
class packetSocket {
class XMLRPC_DLLEXPORT packetSocket_impl;
class XMLRPC_DLLEXPORT packetSocket {
/*----------------------------------------------------------------------------
This is an Internet communication vehicle that transmits individual
variable-length packets of text.
@@ -106,56 +109,7 @@ public:
packetPtr * const packetPP);
private:
int sockFd;
// The kernel stream socket we use.
bool eof;
// The packet socket is at end-of-file for reads.
// 'readBuffer' is empty and there won't be any more data to fill
// it because the underlying stream socket is closed.
std::queue<packetPtr> readBuffer;
packetPtr packetAccumP;
// The receive packet we're currently accumulating; it will join
// 'readBuffer' when we've received the whole packet (and we've
// seen the END escape sequence so we know we've received it all).
// If we're not currently accumulating a packet (haven't seen a
// PKT escape sequence), this points to nothing.
bool inEscapeSeq;
// In our trek through the data read from the underlying stream
// socket, we are after an ESC character and before the end of the
// escape sequence. 'escAccum' shows what of the escape sequence
// we've seen so far.
bool inPacket;
// We're now receiving packet data from the underlying stream
// socket. We've seen a complete PKT escape sequence, but have not
// seen a complete END escape sequence since.
struct {
unsigned char bytes[3];
size_t len;
} escAccum;
void
bufferFinishedPacket();
void
takeSomeEscapeSeq(const unsigned char * const buffer,
size_t const length,
size_t * const bytesTakenP);
void
takeSomePacket(const unsigned char * const buffer,
size_t const length,
size_t * const bytesTakenP);
void
verifyNothingAccumulated();
void
processBytesRead(const unsigned char * const buffer,
size_t const bytesRead);
void
readFromFile();
packetSocket_impl * implP;
};