[ 
https://issues.apache.org/jira/browse/TS-4523?focusedWorklogId=26526&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26526
 ]

ASF GitHub Bot logged work on TS-4523:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Aug/16 22:02
            Start Date: 16/Aug/16 22:02
    Worklog Time Spent: 10m 
      Work Description: Github user ushachar commented on the issue:

    https://github.com/apache/trafficserver/pull/712
  
    The reason for wanting this feature is to support prolonged content related 
actions -- in @davidbz  case out-of-process content malware analysis.
    
    When acting as a forward proxy and handling a request for a very large 
file, he needs to support an initial analysis on the first N MBs of the file in 
order to decide if he must analyze the full file or can release it to the 
client.
    This analysis can take a significant amount of time and continuing to 
buffer the contents can lead to resource exhaustion.
    (When combined with turning on flow control to make sure that we throttle 
the proxy<->upstream tcp connection)
    
    @bgaff - I know you had some concerns regarding this - does this use case 
seem reasonable to you?


Issue Time Tracking
-------------------

    Worklog Id:     (was: 26526)
    Time Spent: 0.5h  (was: 20m)

> Add the ability to pause/resume data consumption in the CPP API
> ---------------------------------------------------------------
>
>                 Key: TS-4523
>                 URL: https://issues.apache.org/jira/browse/TS-4523
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Plugins
>            Reporter: David Ben Zakai
>            Assignee: Uri Shachar
>             Fix For: 7.0.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> I'd like to suggest an API change in the CPP API Transformation interface.
> My own use case is that I'd like to be able to pause the transformation, 
> handle what I can from the file and release the buffered content before 
> resuming and releasing the rest of the data.
> Basically what I'm trying to achieve:
> Write data to file (up to a certain amount)
> File analysis
> Produce file data (and any leftovers) downstream
> When the file size reaches a certain size limit I'd like to be able to pause 
> the transformation and produce all of its content downstream and then resume 
> the transformation.
> API Changes:
> TransformationPlugin.h:
> /**
> * Call this method if you wish to pause the transformation.
> * Schedule the return value continuation to resume the transforamtion.
> * If the continuation is scheduled and called after the transform is 
> destroyed it will 
> * won't do anything beyond cleanups.
> * Note: You must schedule the continuation or destroy it (using 
> TSContDestroy) yourself, 
> * otherwise it will leak.
> */
> TSCont pause();
> Internally, the continuation wraps the "resumeCallback" static function:
> static int resumeCallback(TSCont cont, TSEvent event, void *edata); /** 
> Resume callback*/
> Thank you!



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

Reply via email to