]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance: Remove unused clientBeginRequest() (#1910)
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 Oct 2024 16:03:03 +0000 (16:03 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 8 Oct 2024 16:30:28 +0000 (16:30 +0000)
This ESI-only function became unused since recent commit 5eb89ef3. It
has enough problematic code and comments to justify dedicated removal.

doc/Programming-Guide/05_TypicalRequestFlow.dox
src/Downloader.cc
src/client_side_reply.cc
src/client_side_request.cc
src/client_side_request.h
src/http/Stream.cc
src/redirect.cc
src/servers/Http1Server.cc

index 1a9e93441296fcec48df8f035593cc20545ce9e3..c8b346908c7088d0bf13a0385b86eb85382a7af5 100644 (file)
@@ -11,8 +11,7 @@
 
 \par
 \li    A client connection is accepted by the client-side socket
-       support and parsed, or is directly created via
-       clientBeginRequest().
+       support and parsed.
 
 \li    The access controls are checked.  The client-side-request builds
        an ACL state data structure and registers a callback function
index 022381ae3cd40e8d6d8a219f3b0f3df1eac40b61..b2fbec21660824fd91a6fa17b86130a1aaa8e0af 100644 (file)
@@ -12,6 +12,7 @@
 #include "client_side_reply.h"
 #include "client_side_request.h"
 #include "ClientRequestContext.h"
+#include "clientStream.h"
 #include "Downloader.h"
 #include "fatal.h"
 #include "http/one/RequestParser.h"
index 620c83d8f2b7de565e820f72777753a456bdc396..66c5391611149157667c3ea41a79cc419c56d23d 100644 (file)
@@ -13,6 +13,7 @@
 #include "acl/Gadgets.h"
 #include "anyp/PortCfg.h"
 #include "client_side_reply.h"
+#include "clientStream.h"
 #include "errorpage.h"
 #include "ETag.h"
 #include "fd.h"
index c7778253e911d0ae33c4932f71aa59d0b580d3cf..b9a6d9d2bc54a6dc9f827c0fbe2659eee6770a32 100644 (file)
@@ -268,101 +268,6 @@ ClientHttpRequest::~ClientHttpRequest()
     dlinkDelete(&active, &ClientActiveRequests);
 }
 
-/**
- * Create a request and kick it off
- *
- * \retval 0     success
- * \retval -1    failure
- *
- * TODO: Pass in the buffers to be used in the initial Read request, as they are
- * determined by the user
- */
-int
-clientBeginRequest(const HttpRequestMethod &method, char const *url, CSCB *streamcallback,
-                   CSD *streamdetach, const ClientStreamData &streamdata, const HttpHeader *header,
-                   char *tailbuf, size_t taillen, const MasterXaction::Pointer &mx)
-{
-    size_t url_sz;
-    ClientHttpRequest *http = new ClientHttpRequest(nullptr);
-    HttpRequest *request;
-    StoreIOBuffer tempBuffer;
-    if (http->al != nullptr)
-        http->al->cache.start_time = current_time;
-    /* this is only used to adjust the connection offset in client_side.c */
-    http->req_sz = 0;
-    tempBuffer.length = taillen;
-    tempBuffer.data = tailbuf;
-    /* client stream setup */
-    clientStreamInit(&http->client_stream, clientGetMoreData, clientReplyDetach,
-                     clientReplyStatus, new clientReplyContext(http), streamcallback,
-                     streamdetach, streamdata, tempBuffer);
-    /* make it visible in the 'current acctive requests list' */
-    /* Set flags */
-    /* internal requests only makes sense in an
-     * accelerator today. TODO: accept flags ? */
-    http->flags.accel = true;
-    /* allow size for url rewriting */
-    url_sz = strlen(url) + Config.appendDomainLen + 5;
-    http->uri = (char *)xcalloc(url_sz, 1);
-    strcpy(http->uri, url); // XXX: polluting http->uri before parser validation
-
-    request = HttpRequest::FromUrlXXX(http->uri, mx, method);
-    if (!request) {
-        debugs(85, 5, "Invalid URL: " << http->uri);
-        return -1;
-    }
-
-    /*
-     * now update the headers in request with our supplied headers.
-     * HttpRequest::FromUrl() should return a blank header set, but
-     * we use Update to be sure of correctness.
-     */
-    if (header)
-        request->header.update(header);
-
-    /* http struct now ready */
-
-    /*
-     * build new header list *? TODO
-     */
-    request->flags.accelerated = http->flags.accel;
-
-    /* this is an internally created
-     * request, not subject to acceleration
-     * target overrides */
-    // TODO: detect and handle internal requests of internal objects?
-
-    /* Internally created requests cannot have bodies today */
-    request->content_length = 0;
-
-    request->client_addr.setNoAddr();
-
-#if FOLLOW_X_FORWARDED_FOR
-    request->indirect_client_addr.setNoAddr();
-#endif /* FOLLOW_X_FORWARDED_FOR */
-
-    request->my_addr.setNoAddr();   /* undefined for internal requests */
-
-    request->my_addr.port(0);
-
-    request->http_ver = Http::ProtocolVersion();
-
-    http->initRequest(request);
-
-    /* optional - skip the access check ? */
-    http->calloutContext = new ClientRequestContext(http);
-
-    http->calloutContext->http_access_done = false;
-
-    http->calloutContext->redirect_done = true;
-
-    http->calloutContext->no_cache_done = true;
-
-    http->doCallouts();
-
-    return 0;
-}
-
 bool
 ClientRequestContext::httpStateIsValid()
 {
index bff45673b39021e46d1ae8c33a0ce208e143bf27..6a93b87ddd60f82cb6998d608b31fa8c3b0c4756 100644 (file)
@@ -12,7 +12,6 @@
 #include "AccessLogEntry.h"
 #include "acl/FilledChecklist.h"
 #include "client_side.h"
-#include "clientStream.h"
 #include "http/forward.h"
 #include "HttpHeaderRange.h"
 #include "log/forward.h"
@@ -28,9 +27,6 @@ class ClientRequestContext;
 class ConnStateData;
 class MemObject;
 
-/* client_side_request.c - client side request related routines (pure logic) */
-int clientBeginRequest(const HttpRequestMethod &, char const *, CSCB *, CSD *, const ClientStreamData &, const HttpHeader *, char *, size_t, const MasterXactionPointer &);
-
 class ClientHttpRequest
 #if USE_ADAPTATION
     : public Adaptation::Initiator, // to start adaptation transactions
index 1538d69fe2c9ee72af81de03a5ef0fd78df3b539..83f8329d5af3193a0e2da236e4c29c42a65afba5 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "squid.h"
 #include "client_side_request.h"
+#include "clientStream.h"
 #include "http/Stream.h"
 #include "HttpHdrContRange.h"
 #include "HttpHeaderTools.h"
index ddf79018234437af2c218a871e61d49ff76c3b96..816aab0ffba2fde330a1341c6acf14d964094db3 100644 (file)
@@ -14,6 +14,7 @@
 #include "client_side.h"
 #include "client_side_reply.h"
 #include "client_side_request.h"
+#include "clientStream.h"
 #include "comm/Connection.h"
 #include "fde.h"
 #include "format/Format.h"
index 05151a339ce0cbd4b2d1953ccd195a7ccd772d31..24c1974ba3ff19cdfdeb7e0d4122104c36a0678c 100644 (file)
@@ -13,6 +13,7 @@
 #include "client_side.h"
 #include "client_side_reply.h"
 #include "client_side_request.h"
+#include "clientStream.h"
 #include "comm/Write.h"
 #include "http/one/RequestParser.h"
 #include "http/Stream.h"