maskit commented on code in PR #9591:
URL: https://github.com/apache/trafficserver/pull/9591#discussion_r1164749388


##########
iocore/net/OCSPStapling.cc:
##########
@@ -57,6 +59,142 @@ struct certinfo {
   time_t expire_time;
 };
 
+extern ClassAllocator<FetchSM> FetchSMAllocator;
+
+class HTTPRequest : public Continuation
+{
+public:
+  static constexpr int MAX_RESP_LEN = 100 * 1024;
+
+  HTTPRequest()
+  {
+    mutex = new_ProxyMutex();
+    SET_HANDLER(&HTTPRequest::event_handler);
+  }
+
+  ~HTTPRequest()
+  {
+    this->_fsm->ext_destroy();
+    OPENSSL_free(this->_req_body);
+  }
+
+  int
+  event_handler(int event, Event *e)
+  {
+    if (event == TS_EVENT_IMMEDIATE) {
+      this->fetch();
+    } else {
+      auto fsm = reinterpret_cast<FetchSM *>(e);
+      auto req = reinterpret_cast<HTTPRequest *>(fsm->ext_get_user_data());
+      if (event == TS_FETCH_EVENT_EXT_BODY_DONE) {
+        req->set_done();
+      } else if (event == TS_EVENT_ERROR) {
+        req->set_error();
+      }
+    }
+
+    return 0;
+  }
+
+  void
+  set_request_line(bool use_post, const char *uri)
+  {
+    struct sockaddr_in sin;
+    memset(&sin, 0, sizeof(sin));
+    sin.sin_family      = AF_INET;
+    sin.sin_addr.s_addr = inet_addr("127.0.0.1");
+    sin.sin_port        = 65535;

Review Comment:
   Nothing. I don't think the address and port are actually used for something.



-- 
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