maskit opened a new pull request, #13084:
URL: https://github.com/apache/trafficserver/pull/13084

     ## Summary                                                                 
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
     - Add `--log-field <symbol>` option to jax_fingerprint plugin that 
registers a custom log field usable in `logging.yaml` format strings (e.g., 
`--log-field jaxja4` enables `%<jaxja4>`)                                       
            
     - Change `TSLogMarshalCallback` and `LogField::CustomMarshalFunc` from raw 
function pointers to `std::function` to support capturing lambdas, enabling 
plugins to register log field callbacks with state                              
    
     - Reject `--log-field` in remap plugin context with a clear error, since 
log fields must be registered globally                                          
                                                                                
  
                                                                                
                                                                                
                                                                                
     ## Details                                                                 
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
     The `--log-field` option requires the plugin to be loaded globally in 
`plugin.config` because log fields must be registered before log formats are 
parsed at startup. It works with all fingerprinting methods — both 
CONNECTION_BASED     
     (JA3, JA4) and REQUEST_BASED (JA4H). If you use a remap-only setup, you 
must also load the plugin globally with `--log-field` to register the log field.
                                                                                
                                                                                
                                                                                
     The plugin captures its config in a lambda passed to `TSLogFieldRegister`, 
which required widening the callback types from raw function pointers to 
`std::function`.                                                                
       
      
     ### Plugin API change                                                      
                                                                                
                                                                                
                     
     `TSLogMarshalCallback` in `apidefs.h` changes from a raw function pointer 
(`int (*)(TSHttpTxn, char *)`) to `std::function<int(TSHttpTxn, char *)>`. This 
is not a breaking change — existing plugins that pass plain function pointers 
or 
     non-capturing lambdas to `TSLogFieldRegister` will continue to work as-is, 
since `std::function` implicitly converts from both. The change simply allows 
capturing lambdas and other callable objects as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to