trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhe...@apache.org
Subject [trafficserver] branch master updated: Return TSFetchSM from TSFetchUrl so TSFetchFlagSet can set fetch flags
Date Thu, 02 Apr 2020 22:24:49 GMT
This is an automated email from the ASF dual-hosted git repository.

sudheerv 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 3b246a9  Return TSFetchSM from TSFetchUrl so TSFetchFlagSet can set fetch flags
3b246a9 is described below

commit 3b246a9ad0d1508725bc4f270baa24e41d65e2fb
Author: Sudheer Vinukonda <sudheerv@apache.org>
AuthorDate: Wed Apr 1 19:14:58 2020 -0700

    Return TSFetchSM from TSFetchUrl so TSFetchFlagSet can set fetch flags
    
    This is a miss in the commit 7675d0b8082247de35146cedbce6875cb2d39f03
---
 doc/developer-guide/api/functions/TSFetchCreate.en.rst | 4 ++--
 include/ts/apidefs.h.in                                | 2 ++
 include/ts/experimental.h                              | 2 --
 include/ts/ts.h                                        | 4 ++--
 src/traffic_server/InkAPI.cc                           | 4 +++-
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/doc/developer-guide/api/functions/TSFetchCreate.en.rst b/doc/developer-guide/api/functions/TSFetchCreate.en.rst
index 9fe8ed5..4dc4924 100644
--- a/doc/developer-guide/api/functions/TSFetchCreate.en.rst
+++ b/doc/developer-guide/api/functions/TSFetchCreate.en.rst
@@ -32,9 +32,9 @@ Synopsis
     #include <ts/ts.h>
 
 .. function:: void TSFetchPages(TSFetchUrlParams_t *)
-.. function:: void TSFetchUrl(const char *, int, sockaddr const *, TSCont, TSFetchWakeUpOptions,
TSFetchEvent)
+.. function:: TSFetchSM TSFetchUrl(const char *, int, sockaddr const *, TSCont, TSFetchWakeUpOptions,
TSFetchEvent)
 .. function:: void TSFetchFlagSet(TSFetchSM, int)
-.. function:: TSFetch TSFetchCreate(TSCont, const char *, const char *, const char *, struct
sockaddr const *, int)
+.. function:: TSFetchSM TSFetchCreate(TSCont, const char *, const char *, const char *, struct
sockaddr const *, int)
 .. function:: void TSFetchHeaderAdd(TSFetchSM, const char *, int, const char *, int)
 .. function:: void TSFetchWriteData(TSFetchSM, const void *, size_t)
 .. function:: ssize_t TSFetchReadData(TSFetchSM, void *, size_t)
diff --git a/include/ts/apidefs.h.in b/include/ts/apidefs.h.in
index c728b01..c874121 100644
--- a/include/ts/apidefs.h.in
+++ b/include/ts/apidefs.h.in
@@ -922,6 +922,8 @@ typedef struct tsapi_hostlookupresult *TSHostLookupResult;
 typedef struct tsapi_aiocallback *TSAIOCallback;
 typedef struct tsapi_net_accept *TSAcceptor;
 
+typedef struct tsapi_fetchsm *TSFetchSM;
+
 typedef void *(*TSThreadFunc)(void *data);
 typedef int (*TSEventFunc)(TSCont contp, TSEvent event, void *edata);
 typedef void (*TSConfigDestroyFunc)(void *data);
diff --git a/include/ts/experimental.h b/include/ts/experimental.h
index b731127..d2ebfd0 100644
--- a/include/ts/experimental.h
+++ b/include/ts/experimental.h
@@ -50,8 +50,6 @@ typedef enum {
   TS_FETCH_FLAGS_NOT_INTERNAL_REQUEST = 1 << 4  // Allow this fetch to be created as
a non-internal request.
 } TSFetchFlags;
 
-typedef struct tsapi_fetchsm *TSFetchSM;
-
 /* Forward declaration of in_addr, any user of these APIs should probably
    include net/netinet.h or whatever is appropriate on the platform. */
 struct in_addr;
diff --git a/include/ts/ts.h b/include/ts/ts.h
index b18ce03..1e82590 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1722,8 +1722,8 @@ tsapi TSVConn TSHttpConnect(struct sockaddr const *addr);
  */
 tsapi TSVConn TSHttpConnectTransparent(struct sockaddr const *client_addr, struct sockaddr
const *server_addr);
 
-tsapi void TSFetchUrl(const char *request, int request_len, struct sockaddr const *addr,
TSCont contp,
-                      TSFetchWakeUpOptions callback_options, TSFetchEvent event);
+tsapi TSFetchSM TSFetchUrl(const char *request, int request_len, struct sockaddr const *addr,
TSCont contp,
+                           TSFetchWakeUpOptions callback_options, TSFetchEvent event);
 tsapi void TSFetchPages(TSFetchUrlParams_t *params);
 
 /* Check if HTTP State machine is internal or not */
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 0824666..d9fef70 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -7916,7 +7916,7 @@ TSFetchPages(TSFetchUrlParams_t *params)
   }
 }
 
-void
+TSFetchSM
 TSFetchUrl(const char *headers, int request_len, sockaddr const *ip, TSCont contp, TSFetchWakeUpOptions
callback_options,
            TSFetchEvent events)
 {
@@ -7928,6 +7928,8 @@ TSFetchUrl(const char *headers, int request_len, sockaddr const *ip,
TSCont cont
 
   fetch_sm->init((Continuation *)contp, callback_options, events, headers, request_len,
ip);
   fetch_sm->httpConnect();
+
+  return reinterpret_cast<TSFetchSM>(fetch_sm);
 }
 
 void


Mime
View raw message