当前位置: 首页>>代码示例>>C++>>正文


C++ Transport::getRemoteHost方法代码示例

本文整理汇总了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);
}
开发者ID:fredemmott,项目名称:hhvm,代码行数:28,代码来源:ext_server.cpp

示例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);
}
开发者ID:param108,项目名称:hiphop-php,代码行数:10,代码来源:ext_server.cpp

示例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);
}
开发者ID:ArPharazon,项目名称:hiphop-php,代码行数:16,代码来源:ext_server.cpp

示例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);
}
开发者ID:UnknownGosu,项目名称:hhvm,代码行数:19,代码来源:ext_server.cpp


注:本文中的Transport::getRemoteHost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。