CBDATA_CLASS_INIT(ClientSocketContext);
/* Local functions */
-/* ClientSocketContext */
-static ClientSocketContext *ClientSocketContextNew(const Comm::ConnectionPointer &clientConn, ClientHttpRequest *);
-/* other */
static IOCB clientWriteComplete;
static IOCB clientWriteBodyComplete;
static IOACB httpAccept;
clientStreamDetach(getTail(), http);
}
-ClientSocketContext::ClientSocketContext() : http(NULL), reply(NULL), next(NULL),
+ClientSocketContext::ClientSocketContext(const Comm::ConnectionPointer &aConn, ClientHttpRequest *aReq) :
+ clientConnection(aConn),
+ http(aReq),
+ reply(NULL),
+ next(NULL),
writtenToSocket(0),
mayUseConnection_ (false),
connRegistered_ (false)
{
+ assert(http != NULL);
memset (reqbuf, '\0', sizeof (reqbuf));
flags.deferred = 0;
flags.parsed_ok = 0;
deferredparams.rep = NULL;
}
-ClientSocketContext *
-ClientSocketContextNew(const Comm::ConnectionPointer &client, ClientHttpRequest * http)
-{
- ClientSocketContext *newContext;
- assert(http != NULL);
- newContext = new ClientSocketContext;
- newContext->http = http;
- newContext->clientConnection = client;
- return newContext;
-}
-
void
ClientSocketContext::writeControlMsg(HttpControlMsg &msg)
{
http->req_sz = csd->in.notYetUsed;
http->uri = xstrdup(uri);
setLogUri (http, uri);
- context = ClientSocketContextNew(csd->clientConnection, http);
+ context = new ClientSocketContext(csd->clientConnection, http);
tempBuffer.data = context->reqbuf;
tempBuffer.length = HTTP_REQBUF_SZ;
clientStreamInit(&http->client_stream, clientGetMoreData, clientReplyDetach,
http = new ClientHttpRequest(csd);
http->req_sz = HttpParserRequestLen(hp);
- result = ClientSocketContextNew(csd->clientConnection, http);
+ result = new ClientSocketContext(csd->clientConnection, http);
tempBuffer.data = result->reqbuf;
tempBuffer.length = HTTP_REQBUF_SZ;
#define STUB_API "client_side.cc"
#include "tests/STUB.h"
-ClientSocketContext::ClientSocketContext() STUB
-ClientSocketContext::~ClientSocketContext() STUB
+//ClientSocketContext::ClientSocketContext(const ConnectionPointer&, ClientHttpRequest*) STUB
+//ClientSocketContext::~ClientSocketContext() STUB
bool ClientSocketContext::startOfOutput() const STUB_RETVAL(false)
void ClientSocketContext::writeComplete(const Comm::ConnectionPointer &conn, char *bufnotused, size_t size, comm_err_t errflag) STUB
void ClientSocketContext::keepaliveNextRequest() STUB