本文整理汇总了C++中Transport::getRemoteHost方法的典型用法代码示例。如果您正苦于以下问题:C++ Transport::getRemoteHost方法的具体用法?C++ Transport::getRemoteHost怎么用?C++ Transport::getRemoteHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transport
的用法示例。
在下文中一共展示了Transport::getRemoteHost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HHVM_FUNCTION
Resource HHVM_FUNCTION(pagelet_server_task_start,
const String& url,
const Array& headers /* = null_array */,
const String& post_data /* = null_string */,
const Array& files /* = null_array */,
int64_t desired_timeout /* = 0 */) {
String remote_host;
Transport *transport = g_context->getTransport();
// If a non-zero timeout is requested, use it and cap it at the remaining
// request time.
int remaining_time =
ThreadInfo::s_threadInfo->m_reqInjectionData.getRemainingTime();
int timeout = desired_timeout > 0 && desired_timeout <= remaining_time
? desired_timeout
: remaining_time;
if (transport) {
remote_host = transport->getRemoteHost();
if (!headers.exists(s_Host) && RuntimeOption::SandboxMode) {
Array tmp = headers;
tmp.set(s_Host, transport->getHeader("Host"));
return PageletServer::TaskStart(url, tmp, remote_host,
post_data, files, timeout);
}
}
return PageletServer::TaskStart(url, headers, remote_host,
post_data, files, timeout);
}
示例2: f_pagelet_server_task_start
Object f_pagelet_server_task_start(CStrRef url,
CArrRef headers /* = null_array */,
CStrRef post_data /* = null_string */) {
String remote_host;
Transport *transport = g_context->getTransport();
if (transport) {
remote_host = transport->getRemoteHost();
}
return PageletServer::TaskStart(url, headers, remote_host, post_data);
}
示例3: f_pagelet_server_task_start
Object f_pagelet_server_task_start(CStrRef url,
CArrRef headers /* = null_array */,
CStrRef post_data /* = null_string */,
CArrRef files /* = null_array */) {
String remote_host;
Transport *transport = g_context->getTransport();
if (transport) {
remote_host = transport->getRemoteHost();
if (!headers.exists("Host") && RuntimeOption::SandboxMode) {
Array tmp = headers;
tmp.set("Host", transport->getHeader("Host"));
return PageletServer::TaskStart(url, tmp, remote_host, post_data, files);
}
}
return PageletServer::TaskStart(url, headers, remote_host, post_data);
}
示例4: f_pagelet_server_task_start
Resource f_pagelet_server_task_start(const String& url,
const Array& headers /* = null_array */,
const String& post_data /* = null_string */,
const Array& files /* = null_array */) {
String remote_host;
Transport *transport = g_context->getTransport();
int timeout = ThreadInfo::s_threadInfo->m_reqInjectionData.getRemainingTime();
if (transport) {
remote_host = transport->getRemoteHost();
if (!headers.exists(s_Host) && RuntimeOption::SandboxMode) {
Array tmp = headers;
tmp.set(s_Host, transport->getHeader("Host"));
return PageletServer::TaskStart(url, tmp, remote_host,
post_data, files, timeout);
}
}
return PageletServer::TaskStart(url, headers, remote_host,
post_data, files, timeout);
}