Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/ts/experimental.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ typedef enum {
TS_FETCH_FLAGS_STREAM = 1 << 1, // enable stream IO
TS_FETCH_FLAGS_DECHUNK = 1 << 2, // dechunk body content
TS_FETCH_FLAGS_NEWLOCK = 1 << 3, // allocate new lock for fetch sm
TS_FETCH_FLAGS_NOT_INTERNAL_REQUEST = 1 << 4 // Allow this fetch to be created as a non-internal request.
TS_FETCH_FLAGS_NOT_INTERNAL_REQUEST = 1 << 4, // Allow this fetch to be created as a non-internal request.
TS_FETCH_FLAGS_SKIP_REMAP = 1 << 5, // Skip remapping and allow requesting arbitary URL
} TSFetchFlags;

/* Forward declaration of in_addr, any user of these APIs should probably
Expand Down
15 changes: 14 additions & 1 deletion iocore/net/I_NetVConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,18 @@ class NetVConnection : public VConnection, public PluginUserArgs<TS_USER_ARGS_VC
is_internal_request = val;
}

bool
get_is_unmanaged_request() const
{
return is_unmanaged_request;
}

void
set_is_unmanaged_request(bool val = false)
{
is_unmanaged_request = val;
}

/// Get the transparency state.
bool
get_is_transparent() const
Expand Down Expand Up @@ -528,7 +540,8 @@ class NetVConnection : public VConnection, public PluginUserArgs<TS_USER_ARGS_VC
bool got_local_addr = false;
bool got_remote_addr = false;

bool is_internal_request = false;
bool is_internal_request = false;
bool is_unmanaged_request = false;
/// Set if this connection is transparent.
bool is_transparent = false;
/// Set if proxy protocol is enabled
Expand Down
4 changes: 2 additions & 2 deletions iocore/net/OCSPStapling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ class HTTPRequest : public Continuation

this->_fsm = FetchSMAllocator.alloc();
if (use_post) {
this->_fsm->ext_init(this, "POST", uri, "HTTP/1.1", reinterpret_cast<sockaddr *>(&sin), 0);
this->_fsm->ext_init(this, "POST", uri, "HTTP/1.1", reinterpret_cast<sockaddr *>(&sin), TS_FETCH_FLAGS_SKIP_REMAP);
} else {
this->_fsm->ext_init(this, "GET", uri, "HTTP/1.1", reinterpret_cast<sockaddr *>(&sin), 0);
this->_fsm->ext_init(this, "GET", uri, "HTTP/1.1", reinterpret_cast<sockaddr *>(&sin), TS_FETCH_FLAGS_SKIP_REMAP);
}
}

Expand Down
1 change: 1 addition & 0 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ HttpSM::attach_client_session(ProxyTransaction *client_vc)
}

t_state.setup_per_txn_configs();
t_state.api_skip_all_remapping = netvc->get_is_unmanaged_request();

ink_assert(_ua.get_txn()->get_proxy_ssn());
ink_assert(_ua.get_txn()->get_proxy_ssn()->accept_options);
Expand Down
5 changes: 5 additions & 0 deletions src/traffic_server/FetchSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ FetchSM::httpConnect()
}
}

if (fetch_flags & TS_FETCH_FLAGS_SKIP_REMAP) {
PluginVC *other_side = reinterpret_cast<PluginVC *>(http_vc)->get_other_side();
other_side->set_is_unmanaged_request(true);
}

read_vio = http_vc->do_io_read(this, INT64_MAX, resp_buffer);
write_vio = http_vc->do_io_write(this, getReqLen() + req_content_length, req_reader);
}
Expand Down