You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2016/08/24 23:11:38 UTC

[trafficserver] 01/01: Merge pull request #910 from bryancall/TS-1509

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 497690e1d73ce36903effc5086b09ebc6d27aab8
Merge: 6a11f16 9a9a766
Author: Bryan Call <bc...@apache.org>
AuthorDate: Wed Aug 24 16:11:31 2016 -0700

    Merge pull request #910 from bryancall/TS-1509
    
    TS-1509: Remove TS_PARSE_OK constant

 doc/developer-guide/api/functions/TSHttpParserCreate.en.rst | 11 ++---------
 doc/developer-guide/api/functions/TSUrlCreate.en.rst        |  6 +++---
 doc/developer-guide/api/types/TSParseResult.en.rst          |  2 --
 lib/ts/apidefs.h.in                                         |  3 +--
 plugins/authproxy/authproxy.cc                              |  1 -
 plugins/generator/generator.cc                              |  1 -
 proxy/InkAPITest.cc                                         |  4 +---
 proxy/hdrs/MIME.h                                           |  4 ++--
 8 files changed, 9 insertions(+), 23 deletions(-)

diff --cc plugins/generator/generator.cc
index c793006,fec2029..b74c245
--- a/plugins/generator/generator.cc
+++ b/plugins/generator/generator.cc
@@@ -479,29 -442,13 +479,28 @@@ GeneratorInterceptionHook(TSCont contp
          return TS_EVENT_ERROR;
  
        case TS_PARSE_DONE:
-       case TS_PARSE_OK:
          // Check the response.
          VDEBUG("parsed request on grq=%p, sending a response ", cdata.grq);
 -        if (GeneratorParseRequest(cdata.grq) && GeneratorWriteResponseHeader(cdata.grq, TSVIOVConnGet(arg.vio), contp)) {
 -          // If this is a HEAD request, we don't need to send any bytes.
 -          if (cdata.grq->flags & GeneratorRequest::ISHEAD) {
 -            cdata.grq->nbytes = 0;
 -          }
 +        if (!GeneratorParseRequest(cdata.grq)) {
 +          // We got a syntactically bad URL. It would be graceful to send
 +          // a 400 response, but we are graceless and just fail the
 +          // transaction.
 +          GeneratorRequestDestroy(cdata.grq, arg.vio, contp);
 +          return TS_EVENT_ERROR;
 +        }
 +
 +        // If this is a HEAD request, we don't need to send any bytes.
 +        if (cdata.grq->flags & GeneratorRequest::ISHEAD) {
 +          cdata.grq->nbytes = 0;
 +        }
 +
 +        // Start the vconn write.
 +        cdata.grq->writeio.write(TSVIOVConnGet(arg.vio), contp);
 +        TSVIONBytesSet(cdata.grq->writeio.vio, 0);
 +
 +        if (cdata.grq->delay > 0) {
 +          VDEBUG("delaying response by %ums", cdata.grq->delay);
 +          TSContSchedule(contp, cdata.grq->delay, TS_THREAD_POOL_NET);
            return TS_EVENT_NONE;
          }
  

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.