From: Chris B. <buc...@us...> - 2012-04-10 15:49:59
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv16091 Modified Files: ChangeLog NEWS cimXmlRequest.c control.c httpAdapter.c sfcb.cfg.pre.in Log Message: [ 3440300 ] Allow forced chunked responses Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- cimXmlRequest.c 28 Mar 2012 15:48:12 -0000 1.70 +++ cimXmlRequest.c 10 Apr 2012 15:49:56 -0000 1.71 @@ -54,14 +54,14 @@ #ifdef LOCAL_CONNECT_ONLY_ENABLE // from httpAdapter.c -int noChunking = 0; +int chunkMode = CHUNK_NEVER; #endif // LOCAL_CONNECT_ONLY_ENABLE typedef struct handler { RespSegments(*handler) (CimXmlRequestContext *, RequestHdr * hdr); } Handler; -extern int noChunking; +extern int chunkMode; extern CMPIBroker *Broker; extern UtilStringBuffer *newStringBuffer(int s); @@ -1052,7 +1052,7 @@ binCtx.xmlAs=binCtx.noResp=0; binCtx.chunkFncs=ctx->chunkFncs; - if (noChunking || ctx->teTrailers==0) + if (ctx->teTrailers==0) hdr->chunkedMode=binCtx.chunkedMode=0; else { sreq.hdr.flags|=FL_chunked; @@ -1072,7 +1072,7 @@ closeProviderContext(&binCtx); - if (noChunking || ctx->teTrailers==0) { + if (ctx->teTrailers==0) { if (err == 0) { rs = genResponses(&binCtx, resp, l); } else { @@ -1505,14 +1505,14 @@ binCtx.xmlAs=binCtx.noResp=0; binCtx.chunkFncs=ctx->chunkFncs; - if (noChunking || ctx->teTrailers==0) + if (ctx->teTrailers==0) { hdr->chunkedMode=binCtx.chunkedMode=0; + } else { sreq->hdr.flags|=FL_chunked; hdr->chunkedMode=binCtx.chunkedMode=1; } binCtx.pAs=NULL; - _SFCB_TRACE(1, ("--- Getting Provider context")); irc = getProviderContext(&binCtx, (OperationHdr *) req); _SFCB_TRACE(1, ("--- Provider context gotten irc: %d",irc)); @@ -1524,7 +1524,7 @@ _SFCB_TRACE(1, ("--- Back from Providers")); closeProviderContext(&binCtx); - if (noChunking || ctx->teTrailers==0) { + if (ctx->teTrailers==0) { if (err == 0) { rs = genResponses(&binCtx, resp, l); } else { @@ -1597,7 +1597,7 @@ binCtx.xmlAs=XML_asObj; binCtx.noResp=0; binCtx.chunkFncs=ctx->chunkFncs; - if (noChunking || ctx->teTrailers==0) + if (ctx->teTrailers==0) hdr->chunkedMode=binCtx.chunkedMode=0; else { sreq.hdr.flags|=FL_chunked; @@ -1617,7 +1617,7 @@ _SFCB_TRACE(1, ("--- Back from Provider")); closeProviderContext(&binCtx); - if (noChunking || ctx->teTrailers==0) { + if (ctx->teTrailers==0) { if (err == 0) { rs = genResponses(&binCtx, resp, l); } else { @@ -1791,7 +1791,7 @@ binCtx.pAs=NULL; binCtx.chunkFncs=ctx->chunkFncs; - if (noChunking || ctx->teTrailers==0) + if (ctx->teTrailers==0) hdr->chunkedMode=binCtx.chunkedMode=0; else { sreq->hdr.flags|=FL_chunked; @@ -1810,7 +1810,7 @@ closeProviderContext(&binCtx); - if (noChunking || ctx->teTrailers==0) { + if (ctx->teTrailers==0) { if (err == 0) { rs = genResponses(&binCtx, resp, l); } else { @@ -1982,7 +1982,7 @@ binCtx.pAs=NULL; binCtx.chunkFncs=ctx->chunkFncs; - if (noChunking || ctx->teTrailers==0) + if (ctx->teTrailers==0) hdr->chunkedMode=binCtx.chunkedMode=0; else { sreq->hdr.flags|=FL_chunked; @@ -2000,7 +2000,7 @@ _SFCB_TRACE(1, ("--- Back from Provider")); closeProviderContext(&binCtx); - if (noChunking || ctx->teTrailers==0) { + if (ctx->teTrailers==0) { if (err == 0) { rs = genResponses(&binCtx, resp, l); } else { Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.757 retrieving revision 1.758 diff -u -d -r1.757 -r1.758 --- ChangeLog 9 Apr 2012 21:21:33 -0000 1.757 +++ ChangeLog 10 Apr 2012 15:49:56 -0000 1.758 @@ -1,3 +1,8 @@ +2012-04-10 Chris Buccella <buc...@li...> + + * cimXmlRequest.c, control.c, httpAdapter.c, sfcb.cfg.pre.in: + [ 3440300 ] Allow forced chunked responses + 2012-04-05 Narasimha Sharoff <nsh...@us...> * control.c: Index: sfcb.cfg.pre.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.cfg.pre.in,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- sfcb.cfg.pre.in 29 Mar 2012 15:39:33 -0000 1.31 +++ sfcb.cfg.pre.in 10 Apr 2012 15:49:56 -0000 1.32 @@ -38,6 +38,8 @@ #httpLocalOnly: false ## Enable HTTP chunking. This will reduce memory usage of HTTP process. +## Possible values are: true, false, always +## "always" will chunk responses regardless of the client's HTTP headers ## Default is true useChunking: true Index: httpAdapter.c =================================================================== RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- httpAdapter.c 30 Mar 2012 21:51:31 -0000 1.104 +++ httpAdapter.c 10 Apr 2012 15:49:56 -0000 1.105 @@ -78,7 +78,12 @@ static int doUdsAuth; #endif static int doFork = 0; -int noChunking = 0; + +#define CHUNK_NEVER 0 +#define CHUNK_ALLOW 1 +#define CHUNK_FORCE 2 +int chunkMode = CHUNK_ALLOW; + int sfcbSSLMode = 0; int httpLocalOnly = 0; /* 1 = only listen on loopback interface */ static int hMax; @@ -1055,7 +1060,9 @@ ctx.principal = inBuf.principal; ctx.role = extras.role; ctx.host = inBuf.host; - ctx.teTrailers = inBuf.trailers; + /* override based on sfcb.cfg value */ + ctx.teTrailers = (chunkMode == CHUNK_FORCE) ? 1 : inBuf.trailers; + if (chunkMode == CHUNK_NEVER) ctx.teTrailers = 0; ctx.cimXmlDocLength = len - hl; ctx.commHndl = &conn_fd; @@ -1748,9 +1755,11 @@ if (getControlNum("keepaliveMaxRequest", &keepaliveMaxRequest)) keepaliveMaxRequest = 10; - if (getControlBool("useChunking", &noChunking)) - noChunking = 0; - noChunking = noChunking == 0; + char* chunkStr; + if (getControlChars("useChunking", &chunkStr) == 0) { + if (strcmp(chunkStr, "false") == 0) chunkMode = CHUNK_NEVER; + else if (strcmp(chunkStr, "always") == 0) chunkMode = CHUNK_FORCE; + } /* * grab commandline options Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.678 retrieving revision 1.679 diff -u -d -r1.678 -r1.679 --- NEWS 9 Apr 2012 21:21:14 -0000 1.678 +++ NEWS 10 Apr 2012 15:49:56 -0000 1.679 @@ -1,6 +1,10 @@ Changes in 1.3.15 ================= +New features: + +- 3440300 Allow forced chunked responses + Bugs fixed: - 3514443 sfcb 1.3.14 compilation error Index: control.c =================================================================== RCS file: /cvsroot/sblim/sfcb/control.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- control.c 9 Apr 2012 21:20:57 -0000 1.44 +++ control.c 10 Apr 2012 15:49:56 -0000 1.45 @@ -90,7 +90,7 @@ {"doBasicAuth", 2, "false"}, {"doUdsAuth", 2, "false"}, - {"useChunking", 2, "false"}, + {"useChunking", 0, "true"}, {"chunkSize", 1, "50000"}, {"trimWhitespace", 2, "true"}, |