[ 
https://issues.apache.org/jira/browse/TS-4395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15357651#comment-15357651
 ] 

ASF GitHub Bot commented on TS-4395:
------------------------------------

Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/747#discussion_r69190550
  
    --- Diff: plugins/experimental/remap_purge/remap_purge.c ---
    @@ -143,18 +144,17 @@ on_http_cache_lookup_complete(TSHttpTxn txnp, TSCont 
contp, PurgeInstance *purge
     }
     
     /* Before we can send the response, we want to modify it to a "200 OK" 
again,
    -   and produce some reasonabel body output. */
    +   and produce some reasonable body output. */
     static int
     on_send_response_header(TSHttpTxn txnp, TSCont contp, PurgeInstance *purge)
     {
       TSMBuffer bufp;
       TSMLoc hdr_loc;
     
    -  TSDebug(PLUGIN_NAME, "Fixing up the response on the succseful PURGE");
    +  TSDebug(PLUGIN_NAME, "Fixing up the response on the successful PURGE");
       if (TS_SUCCESS == TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
         char response[1024];
    -    int len = snprintf(response, sizeof(response) - 1, "PURGED 
%s\r\n\r\n", purge->id);
    -    ;
    +    int len = snprintf(response, sizeof(response), "PURGED %s\r\n\r\n", 
purge->id);
    --- End diff --
    
    ``len`` is what ``snprintf`` would have printed. Should be fine in 
practice, but in principle could be > ``strlen(response)``.


> remap_purge: Simple plugin to purge an entire remap rule
> --------------------------------------------------------
>
>                 Key: TS-4395
>                 URL: https://issues.apache.org/jira/browse/TS-4395
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Plugins
>            Reporter: Leif Hedstrom
>            Assignee: Leif Hedstrom
>             Fix For: 7.0.0
>
>
> This is similar to the existing plugin to purge based on a genID stored in a 
> persistent storage. The difference is that the purging is done exclusively 
> via a restful API, and has little (no) overhead on performance (since the 
> generation ID is always in memory).
> Example:
> {code}
> map http://example.com/p1  http://p1.example.com
>     @plugin=remap_purge.so @pparam=--path=__secret_purge__  
> @pparam=--state=example_p1
> {code}
> And to purge:
> {code}
> $ curl -s -D - -X PURGE http://example.com/p1/__secret_purge__
> HTTP/1.1 200 OK
> Date: Sat, 30 Apr 2016 00:09:34 GMT
> Connection: close
> Server: ATS/7.0.0
> Content-Length: 39
> Content-Type: text/html
> PURGED http://example.com/p1
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to