You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by vm...@apache.org on 2022/11/08 02:12:20 UTC

[trafficserver] branch master updated: Asynchronously refresh OCSP (#9178)

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

vmamidi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 0f8998d37 Asynchronously refresh OCSP (#9178)
0f8998d37 is described below

commit 0f8998d37295e46baf24cbc8c88bfaa78db44482
Author: Vijay Mamidi <vi...@yahoo.com>
AuthorDate: Mon Nov 7 18:12:14 2022 -0800

    Asynchronously refresh OCSP (#9178)
---
 iocore/net/SSLNetProcessor.cc | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/iocore/net/SSLNetProcessor.cc b/iocore/net/SSLNetProcessor.cc
index 2919825e4..110579da4 100644
--- a/iocore/net/SSLNetProcessor.cc
+++ b/iocore/net/SSLNetProcessor.cc
@@ -44,8 +44,9 @@ struct OCSPContinuation : public Continuation {
   int
   mainEvent(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
   {
+    Note("OCSP refresh started");
     ocsp_update();
-
+    Note("OCSP refresh finished");
     return EVENT_CONT;
   }
 
@@ -79,13 +80,11 @@ SSLNetProcessor::start(int, size_t stacksize)
 
 #if TS_USE_TLS_OCSP
   if (SSLConfigParams::ssl_ocsp_enabled) {
-    // Call the update initially to get things populated
-    Note("Initial OCSP refresh started");
-    ocsp_update();
-    Note("Initial OCSP refresh finished");
-
-    EventType ET_OCSP = eventProcessor.spawn_event_threads("ET_OCSP", 1, stacksize);
-    eventProcessor.schedule_every(new OCSPContinuation(), HRTIME_SECONDS(SSLConfigParams::ssl_ocsp_update_period), ET_OCSP);
+    EventType ET_OCSP  = eventProcessor.spawn_event_threads("ET_OCSP", 1, stacksize);
+    Continuation *cont = new OCSPContinuation();
+    // schedule the update initially to get things populated
+    eventProcessor.schedule_imm(cont, ET_OCSP);
+    eventProcessor.schedule_every(cont, HRTIME_SECONDS(SSLConfigParams::ssl_ocsp_update_period), ET_OCSP);
   }
 #endif /* TS_USE_TLS_OCSP */