text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>fine Net_ServerSocketImpl_INCLUDED
#include "Poco/Net/Net.h"
#include "Poco/Net/SocketImpl.h"
namespace Poco
{
namespace Net
{
class Net_API ServerSocketImpl : public SocketImpl
/// This class implements a TCP server socket.
{
public:
ServerSocketImpl();
/// Creates t... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// Socket.h
//
// Library: Net
// Package: Sockets
// Module: Socket
//
// Definition of the Socket class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_Socket_INCLUDED
#define Net_Socket_INCLU... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|> void setReactor(SocketReactor & reactor)
/// Sets the reactor for this acceptor.
{
_pReactor = &reactor;
if (!_pReactor->hasEventHandler(
_socket, Poco::Observer<SocketAcceptor, ReadableNotification>(*this, &SocketAcceptor::onAccept)))
... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// SocketAddress.h
//
// Library: Net
// Package: NetCore
// Module: SocketAddress
//
// Definition of the SocketAddress class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_SocketAddress_INCLU... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// SocketAddressImpl.h
//
// Library: Net
// Package: NetCore
// Module: SocketAddressImpl
//
// Definition of the SocketAddressImpl class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_SocketA... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// SocketConnector.h
//
// Library: Net
// Package: Reactor
// Module: SocketConnector
//
// Definition of the SocketConnector class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_SocketConnect... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>addr32 _S6_un._S6_u32
# else
# define s6_addr32 __u6_addr.__u6_addr32
# endif
# endif
#endif
namespace Poco
{
namespace Net
{
struct AddressFamily
/// AddressFamily::Family replaces the previously used IPAddress::Family
/// enumeration and is now used for IPAddr... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|> method will only work if the blocking modes of
/// the socket are changed via the setBlocking method!
virtual bool secure() const;
/// Returns true iff the socket's connection is secure
/// (using SSL or TLS).
int socketError();
/// Returns the value of t... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// SocketNotification.h
//
// Library: Net
// Package: Reactor
// Module: SocketNotification
//
// Definition of the SocketNotification class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_Sock... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|> return _events.find(pNotification) != _events.end();
}
inline bool SocketNotifier::hasObserver(const Poco::AbstractObserver & observer) const
{
return _nc.hasObserver(observer);
}
inline bool SocketNotifier::hasObservers() const
{
return _nc.hasObservers();
... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>cketReactor, using the given timeout.
virtual ~SocketReactor();
/// Destroys the SocketReactor.
void run();
/// Runs the SocketReactor. The reactor will run
/// until stop() is called (in a separate thread).
void stop();
/// Stops the SocketReacto... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// SocketStream.h
//
// Library: Net
// Package: Sockets
// Module: SocketStream
//
// Definition of the SocketStream class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_SocketStream_INCLUDED
... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// StreamSocket.h
//
// Library: Net
// Package: Sockets
// Module: StreamSocket
//
// Definition of the StreamSocket class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_StreamSocket_INCLUDED
... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// StreamSocketImpl.h
//
// Library: Net
// Package: Sockets
// Module: StreamSocketImpl
//
// Definition of the StreamSocketImpl class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_StreamSock... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>;
/// Returns the string size.
private:
std::istringstream _istr;
std::string _filename;
StringPartSource(const StringPartSource &);
StringPartSource & operator=(const StringPartSource &);
};
}
} // namespace Poco::Net
#endif // Net_StringPartSource_IN... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>nection.
///
/// As soon as a connection thread fetches the next connection from
/// the queue, it creates a TCPServerConnection object for it
/// (using the TCPServerConnectionFactory passed to the constructor)
/// and calls the TCPServerConnection's start() method. When the
/// s... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// TCPServerConnection.h
//
// Library: Net
// Package: TCPServer
// Module: TCPServerConnection
//
// Definition of the TCPServerConnection class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// TCPServerConnectionFactory.h
//
// Library: Net
// Package: TCPServer
// Module: TCPServerConnectionFactory
//
// Definition of the TCPServerConnectionFactory class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|> Poco::ThreadPool & _threadPool;
mutable Poco::FastMutex _mutex;
};
//
// inlines
//
inline const TCPServerParams & TCPServerDispatcher::params() const
{
return *_pParams;
}
}
} // namespace Poco::Net
#endif // Net_TCPServerDispatcher_INCLUDED
<|fim_p... | fim | ClickHouse/ClickHouse | c |
//
// TCPServerParams.h
//
// Library: Net
// Package: TCPServer
// Module: TCPServerParams
//
// Definition of the TCPServerParams class.
//
// Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_TCPServerParams_INCLUDED
... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>
<|fim_prefix|>#pragma once
#include <cstddef>
#include <memory>
namespace Poco
{
namespace Net
{
class Throttler
/// Throttler is an interface for controlling the rate of data transfer.
/// It can be used to limit the speed of data being sent or received over a network connection.
{
... | fim | ClickHouse/ClickHouse | c |
<|fim_prefix|>//
// WebSocket.h
//
// Library: Net
// Package: WebSocket
// Module: WebSocket
//
// Definition of the WebSocket class.
//
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_WebSocket_INCLUDED
#define Net_Web... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>span & timeout);
virtual Poco::Timespan getSendTimeout();
virtual void setReceiveTimeout(const Poco::Timespan & timeout);
virtual Poco::Timespan getReceiveTimeout();
virtual void setSendThrottler(const Poco::Net::ThrottlerPtr & throttler);
virtual Poco::Net::Throttl... | fim | ClickHouse/ClickHouse | c |
<|fim_suffix|>();
}
catch (Poco::Exception& exc)
{
if (!response.sent())
{
sendErrorResponse(HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, exc.displayText());
}
}
catch (std::exception& exc)
{
if (!response.sent())
{
sendErrorResponse(HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, exc.what());... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// DNS.cpp
//
// Library: Net
// Package: NetCore
// Module: DNS
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/DNS.h"
#include "Poco/Net/NetException.h"
#include "Poco/Net/SocketAddress.... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>ket)
{
if (dynamic_cast<DatagramSocketImpl*>(socket.impl()))
Socket::operator = (socket);
else
throw InvalidArgumentException("Cannot assign incompatible socket");
return *this;
}
void DatagramSocket::connect(const SocketAddress& address)
{
impl()->connect(address);
}
void DatagramSocket::bind... | fim | ClickHouse/ClickHouse | cpp |
//
// DatagramSocketImpl.cpp
//
// Library: Net
// Package: Sockets
// Module: DatagramSocketImpl
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/DatagramSocketImpl.h"
#include "Poco/Net/NetException.h"
... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// DialogSocket.cpp
//
// Library: Net
// Package: Sockets
// Module: DialogSocket
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/DialogSocket.h"
#include "Poco/Exception.h"
#include "Poc... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>e::filename() const
{
return _filename;
}
std::streamsize FilePartSource::getContentLength() const
{
Poco::File p(_path);
return static_cast<std::streamsize>(p.getSize());
}
} } // namespace Poco::Net
<|fim_prefix|>//
// FilePartSource.cpp
//
// Library: Net
// Package: Messages
// Module: FilePar... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTMLForm.cpp
//
// Library: Net
// Package: HTML
// Module: HTMLForm
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTMLForm.h"
#include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/Par... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>mation");
}
} } // namespace Poco::Net
<|fim_prefix|>//
// HTTPAuthenticationParams.cpp
//
// Library: Net
// Package: HTTP
// Module: HTTPAuthenticationParams
//
// Copyright (c) 2011, Anton V. Yabchinskiy (arn at bestmx dot ru).
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
// ... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPBasicCredentials.cpp
//
// Library: Net
// Package: HTTP
// Module: HTTPBasicCredentials
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPBasicCredentials.h"
#include "Poco/Net/H... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>har>::eof();
}
int HTTPChunkedStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
{
_chunkBuffer.clear();
NumberFormatter::appendHex(_chunkBuffer, length);
_chunkBuffer.append("\r\n", 2);
_chunkBuffer.append(buffer, static_cast<std::string::size_type>(length));
_chunkBuffer.append(... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|> || _keepAliveCurrentRequest > _keepAliveMaxRequests;
}
bool HTTPClientSession::mustReconnect() const
{
if (!_mustReconnect)
return isKeepAliveExpired(_defaultKeepAliveReliabilityLevel);
return true;
}
void HTTPClientSession::proxyAuthenticate(HTTPRequest& request)
{
proxyAuthentica... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>"1\"");
}
return result;
}
namespace
{
static const std::string ILLEGAL_CHARS("()[]/|\\',;");
}
std::string HTTPCookie::escape(const std::string& str)
{
std::string result;
Poco::URI::encode(str, ILLEGAL_CHARS, result);
return result;
}
std::string HTTPCookie::unescape(const std::string& str)
... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>sBasicCredentials(const HTTPRequest& request)
{
return request.has(HTTPRequest::AUTHORIZATION) && isBasicCredentials(request.get(HTTPRequest::AUTHORIZATION));
}
bool HTTPCredentials::hasDigestCredentials(const HTTPRequest& request)
{
return request.has(HTTPRequest::AUTHORIZATION) && isDigestCredential... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPDigestCredentials.cpp
//
// Library: Net
// Package: HTTP
// Module: HTTPDigestCredentials
//
// Copyright (c) 2011, Anton V. Yabchinskiy (arn at bestmx dot ru).
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPFixedLengthStream.cpp
//
// Library: Net
// Package: HTTP
// Module: HTTPFixedLeng<|fim_suffix|>;
int n = _session.write(buffer, length);
if (n > 0) _count += n;
return n;
}
//
// HTTPFixedLengthIOS
//
HTTPFixedLengthIOS::HTTPFixedLengthIOS(HTTPSession& session, HTTPFixedLengthStreamBuf... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>nputStream::~HTTPHeaderInputStream()
{
}
//
// HTTPHeaderOutputStream
//
HTTPHeaderOutputStream::HTTPHeaderOutputStream(HTTPSession& session):
HTTPHeaderIOS(session, std::ios::out),
std::ostream(&_buf)
{
poco_ios_init(&_buf);
}
HTTPHeaderOutputStream::~HTTPHeaderOutputStream()
{
}
} } // namespace... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPIOStream.<|fim_suffix|>atics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPIOStream.h"
#include "Poco/Net/HTTPClientSession.h"
using Poco::UnbufferedStreamBuf;
namespace Poco {
namespace Net {
HTTPResponseStreamBuf::HTTPR... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPMessage.cpp
//
// Library: Net
// Package: HTTP
// Module: HTTPMessage
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPMessage.h"
#include "Poco/Net/MediaType.h"
#include "Poco/... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>();
std::string::const_iterator end = auth.end();
while (it != end && Poco::Ascii::isSpace(*it)) ++it;
while (it != end && !Poco::Ascii::isSpace(*it)) scheme += *it++;
while (it != end && Poco::Ascii::isSpace(*it)) ++it;
while (it != end) authInfo += *it++;
}
else throw NotAuthenticatedExcepti... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPRequestHandler.cpp
//
// Library: Net
// Package: HTTPServer
// Module: HTTPRequestHandler
//
// Copyright (c) 2005-2006, <|fim_suffix|>bH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPRequestHandler.h"
namespace Poco {
namespace Net {
HTTPRequestH... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPRequestHandlerFactory.cpp
//
// Li<|fim_suffix|> Poco::Net
<|fim_middle|>brary: Net
// Package: HTTPServer
// Module: HTTPRequestHandlerFactory
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPResponse.cpp
//
// Library: Net
// Package: HTTP
// Module: HTTPResponse
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/NetException.h"
#include ... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPServer.cpp
//
// Library: Net
// Package: HTTPServer
// Modu<|fim_suffix|>ConnectionFactory(pParams, pFactory), socket, pParams),
_pFactory(pFactory)
{
}
HTTPServer::HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams:... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>e());
/// all that fuzz is all about to make session close with less timeout than 15s (set in HTTPServerParams c-tor)
if (_pParams->getKeepAlive() && response.getKeepAlive() && session.canKeepAlive())
{
in... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPServerConnectionFactory.cpp
//
// Library: Net
// Package: HTTPServer
// Module: HTTPServerConnectionFactory
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPServerConnectionFact... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>
{
_softwareVersion = softwareVersion;
}
void HTTPServerParams::setTimeout(const Poco::Timespan& timeout)
{
_timeout = timeout;
}
void HTTPServerParams::setKeepAlive(bool keepAlive)
{
_keepAlive = keepAlive;
}
void HTTPServerParams::setKeepAliveTimeout(const Poco::Timespan& timeout)
{
_keepAlive... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>mespace Net {
HTTPServerRequest::HTTPServerRequest()
{
}
HTTPServerRequest::~HTTPServerRequest()
{
}
} } // namespace Poco::Net
<|fim_prefix|>//
// HTTPServerRequest.cpp
//
// Library: Net
// Package: HTTPServer
// Module: HTTPServerRequest
//
// Copyright (c) 2005-2006, Applied Informatics Softwar... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPServerRequestImpl.cpp
//
// Library: Net
// Package: HTTPServer
// Module: HTTPServerRequestImpl
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPServerRequestImpl.h"
#include "P... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>erResponse::~HTTPServerResponse()
{
}
} } // namespace Poco::Net
<|fim_prefix|>//
// HTTPServerResponse.cpp
//
// Library: Net
// Package: HTTPServer
// Module: HTTPServerResponse
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Ident... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>co_assert (!_pStream);
File f(path);
Timestamp dateTime = f.getLastModified();
File::FileSize length = f.getSize();
set("Last-Modified", DateTimeFormatter::format(dateTime, DateTimeFormat::HTTP_FORMAT));
setContentLength64(length);
setContentType(mediaType);
setChunkedTransferEncoding(false);
... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPServerSession.cpp
//
// Library: Net
// Package: HTTPServer
// Module: HTTPServerSession
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPServerSession.h"
namespace Poco {
name... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>zed();
}
void HTTPSession::connect(const SocketAddress& address)
{
_socket.connect(address, _connectionTimeout);
_socket.setReceiveTimeout(_receiveTimeout);
_socket.setSendTimeout(_sendTimeout);
_socket.setReceiveThrottler(_receiveThrottler);
_socket.setSendThrottler(_sendThrottler);
_socket.setNo... | fim | ClickHouse/ClickHouse | cpp |
//
// HTTPSessionFactory.cpp
//
// Library: Net
// Package: HTTPClient
// Module: HTTPSessionFactory
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/HTTPSessionFactory.h"
#include "Poco/Net/HTTPSessionInstantia... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPSessionInstantiator.cpp
//
// Library: Net
// Package: HTTPClient
// Module: HTTPSessionInstantiator
//
// Copyright (c) 2006, Applied Informatics Softw<|fim_suffix|>tantiator::setProxy(const std::string& host, Poco::UInt16 port)
{
_proxyHost = host;
_proxyPort = port;
}
void HTTPSessionIns... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>:
_buf(session, mode)
{
poco_ios_init(&_buf);
}
HTTPIOS::~HTTPIOS()
{
try
{
_buf.close();
}
catch (...)
{
}
}
HTTPStreamBuf* HTTPIOS::rdbuf()
{
return &_buf;
}
//
// HTTPInputStream
//
HTTPInputStream::HTTPInputStream(HTTPSession& session):
HTTPIOS(session, std::ios::in),
std::istream(... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// HTTPStreamFactory<|fim_suffix|>uest.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/HTTPCredentials.h"
#include "Poco/Net/NetException.h"
#include "Poco/URI.h"
#include "Poco/URIStreamOpener.h"
#include "Poco/UnbufferedStreamBuf.h"
#include "Poco/NullStream.h"
#include "Poco/StreamCopier.h"... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>p(HostEntry& hostEntry)
{
std::swap(_name, hostEntry._name);
std::swap(_aliases, hostEntry._aliases);
std::swap(_addresses, hostEntry._addresses);
}
HostEntry::~HostEntry()
{
}
} } // namespace Poco::Net
<|fim_prefix|>//
// HostEntry.cpp
//
// Library: Net
// Package: NetCore
// Module: HostEntry
... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// IPAddress.cpp
//
// Library: Net
// Package: NetCore
// Module: IPAddress
//
// Copyright (c) 2005-2011, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/IPAddress.h"
#include "Poco/Net/NetException.h"
#include "Poco/... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>rt);
std::string scope(addr, pos + 1, addr.size() - start - pos);
Poco::UInt32 scopeId(0);
if (!(scopeId = if_nametoindex(scope.c_str())))
return IPv6AddressImpl();
if (inet_pton(AF_INET6, unscopedAddr.c_str(), &ia) == 1)
return IPv6AddressImpl(&ia, scopeId);
else
return IPv6AddressImpl... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// MediaType.cpp
//
// Library: Net
// Package: Messages
// Module: MediaType
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/MediaType.h"
#include "Poco/Net/MessageHeader.h"
#include "Poc... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// MessageHeader.cpp
//
// Library: Net
// Package: Messages
// Module: MessageHeader
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/MessageHeader.h"
#include "Poco/Net/NetException.h"
#i... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>
flag = uflag != 0;
#endif
}
return flag;
}
void MulticastSocket::setTimeToLive(unsigned value)
{
if (address().af() == AF_INET)
{
unsigned char ttl = (unsigned char) value;
impl()->setOption(IPPROTO_IP, IP_MULTICAST_TTL, ttl);
}
else
{
#if defined(POCO_HAVE_IPv6)
impl()->setOption(IPPRO... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>istream(&_buf)
{
poco_ios_init(&_buf);
}
MultipartInputStream::~MultipartInputStream()
{
}
//
// MultipartReader
//
MultipartReader::MultipartReader(std::istream& istr):
_istr(istr)
{
}
MultipartReader::MultipartReader(std::istream& istr, const std::string& boundary):
_istr(istr),
_boundary(bo... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|> // namespace Poco::Net
<|fim_prefix|>//
// MultipartWriter.cpp
//
// Library: Net
// Package: Messages
// Module: MultipartWriter
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/MultipartWri... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// NameValueCollection.cpp
//
// Library: Net
// Package: Messages
// Module: NameValueCollection
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/NameValueCollection.h"
#include "Poco/Exce... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// Net.cpp
//
// Library: Net
// Package: NetCore
// Module: NetCore
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco<|fim_suffix|>"
#include "Poco/Net/SocketDefs.h"
#include "Poco/Net/NetExc... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>O_IMPLEMENT_EXCEPTION(NoAddressFoundException, DNSException, "No address found")
POCO_IMPLEMENT_EXCEPTION(InterfaceNotFoundException, NetException, "Interface not found")
POCO_IMPLEMENT_EXCEPTION(NoMessageException, NetException, "No message received")
POCO_IMPLEMENT_EXCEPTION(MessageException, NetExcepti... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// NetworkInterface.cpp
//
// Library: Net
// Package: NetCore
// Module: NetworkInterface
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/NetworkInterface.h"
#ifdef POCO_NET_HAS_INTERFA... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// NullPartHandler.cpp
//
// Library: Net
// Package: Messages
// Module: NullPartHandler
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/NullPartHandler.h"
#include "Poco/Net/M<|fim_suffi... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// OAuth10Credentials.cpp
//
// Library: Net
// Package: OAuth
// Module: OAuth10Credentials
//
// Copyright (c) 2014, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/OAuth10Credentials.h"
#include "Poco/Net/HTTPRequest.... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|> {
std::string authScheme;
std::string authInfo;
request.getCredentials(authScheme, authInfo);
if (icompare(authScheme, _scheme) == 0)
{
_bearerToken = authInfo;
}
else throw NotAuthenticatedException("No bearer token in Authorization header", authScheme);
}
else throw NotAuthenticatedE... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>ense-Identifier: BSL-1.0
//
#include "Poco/Net/PartHandler.h"
namespace Poco {
namespace Net {
PartHandler::PartHandler()
{
}
PartHandler::~PartHandler()
{
}
} } // namespace Poco::Net
<|fim_prefix|>//
// PartHandler.cpp
//
// Library: Net
// Package: Messages
// Module: PartHandler
//
// Copyr... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>//
#include "Poco/Net/PartSource.h"
namespace Poco {
namespace Net {
const int PartSource::UNKNOWN_CONTENT_LENGTH = -1;
PartSource::PartSource():
_mediaType("application/octet-stream")
{
}
PartSource::PartSource(const std::string& mediaType):
_mediaType(mediaType)
{
}
PartSource... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// PartStore.cpp
//
// Library: Net
// Package: Messages
// Module: PartStore
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/PartStore.h"
#include "Poco/TemporaryFile.h"
#include "Poco/Fi... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>rase(fd);
_socketMap.erase(fd);
}
void update(const Socket& socket, int mode)
{
Poco::FastMutex::ScopedLock lock(_mutex);
poco_socket_t fd = socket.impl()->sockfd();
for (std::vector<pollfd>::iterator it = _pollfds.begin(); it != _pollfds.end(); ++it)
{
if (it->fd == fd)
{
it->eve... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// QuotedPrintableDecoder.cpp
//
// Library: Net
// Package: Messages
// Module: QuotedPrintableDecoder
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/QuotedPrintableDecoder.h"
#include "... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>_lineLength;
}
else
{
_ostr << "=\r\n" << c;
_lineLength = 1;
}
}
int QuotedPrintableEncoderBuf::close()
{
sync();
return _ostr ? 0 : -1;
}
QuotedPrintableEncoderIOS::QuotedPrintableEncoderIOS(std::ostream& ostr): _buf(ostr)
{
poco_ios_init(&_buf);
}
QuotedPrintableEncoderIOS::~QuotedPrin... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// RawSocket.cpp
//
// Library: Net
// Package: Sockets
// Module: RawSocket
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier<|fim_suffix|> length, int flags)
{
return impl()->sendBytes(buffer, length, flags);
}
int RawSocke... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// RawSocketImpl.cpp
//
// Library: Net
// Package: Sockets
// Module: RawSocketImpl
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/RawSocketImpl.h"
#include "Poco/Net/NetException.h"
using ... | fim | ClickHouse/ClickHouse | cpp |
//
// RemoteSyslogChannel.cpp
//
// Library: Net
// Package: Logging
// Module: RemoteSyslogChannel
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/RemoteSyslogChannel.h"
#include "Poco/Message.h"
#include "Poc... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// RemoteSyslogListener.cpp
//
// Library: Net
// Package: Logging
// Module: RemoteSyslogListener
//
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/RemoteSyslogListener.h"
#include "Poco/Net/Rem... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// ServerSocket.cpp
//
// Library: Net
// Package: Sockets
// Module: ServerSocket
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/ServerSocket.h"
#include "Poco/Net/ServerSocketImpl.h"
#i... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// ServerSocketImpl.cpp
//
// Library: Net
// Package: Sockets
// Module: ServerSocketImpl
//
// Copyright (c)<|fim_suffix|>
} } // namespace Poco::Net
<|fim_middle|> 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>s & EPOLLOUT)
readyWriteList.push_back(*reinterpret_cast<Socket *>(eventsOut[n].data.ptr));
}
std::swap(readList, readyReadList);
std::swap(writeList, readyWriteList);
std::swap(exceptList, readyExceptList);
return readList.size() + writeList.size() + exceptList.size();
#e... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>issing port number");
init(fam, host, resolveService(port));
}
}
void SocketAddress::init(const std::string& hostAndPort)
{
poco_assert (!hostAndPort.empty());
std::string host;
std::string port;
std::string::const_iterator it = hostAndPort.begin();
std::string::const_iterator end = hostAndPor... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>lt.append(":");
NumberFormatter::append(result, ntohs(port()));
return result;
}
#endif // POCO_HAVE_IPv6
#if defined(POCO_OS_FAMILY_UNIX)
//
// LocalSocketAddressImpl
//
LocalSocketAddressImpl::LocalSocketAddressImpl(const struct sockaddr_un* addr)
{
_pAddr = new sockaddr_un;
std::memcpy(_pAd... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>ans an infinite timeout.
if (rc < 0 && lastError() == POCO_EINTR && remainingTime > 0)
{
Poco::Timestamp end;
Poco::Timespan waited = end - start;
if (waited < remainingTime)
remainingTime -= waited;
else
remainingTime = 0;
}
}
while (rc < 0 && lastError() == POCO_EINTR);
if (... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// SocketNotification.cpp
//
// Library: Net
// Package: Reactor
// Module: SocketNotification
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/SocketNotifi<|fim_suffix|>nst Socket& socket)... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// SocketNotifier.cpp
//
// Library: Net
// Package: Reactor
// Module: SocketNotifier
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/SocketNotifier.h"
#include "Poco/Net/SocketReactor.h"... | fim | ClickHouse/ClickHouse | cpp |
<|fim_prefix|>//
// SocketReactor.cpp
//
// Library: Net
// Package: Reactor
// Module: SocketReactor
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/SocketReactor.h"
#include "Poco/Net/SocketNotification.... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>_init(&_buf);
}
SocketIOS::~SocketIOS()
{
try
{
_buf.sync();
}
catch (...)
{
}
}
SocketStreamBuf* SocketIOS::rdbuf()
{
return &_buf;
}
void SocketIOS::close()
{
_buf.sync();
_buf.socketImpl()->close();
}
StreamSocket SocketIOS::socket() const
{
return StreamSocket(_buf.socketImpl());
}... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>treamSocket::shutdownSend()
{
impl()->shutdownSend();
}
void StreamSocket::shutdown()
{
impl()->shutdown();
}
int StreamSocket::sendBytes(const void* buffer, int length, int flags)
{
return impl()->sendBytes(buffer, length, flags);
}
int StreamSocket::sendBytes(FIFOBuffer& fifoBuf)
{
ScopedLock... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>v6)
else if (family == SocketAddress::IPv6)
init(AF_INET6);
#endif
#if defined(POCO_OS_FAMILY_UNIX)
else if (family == SocketAddress::UNIX_LOCAL)
init(AF_UNIX);
#endif
else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to StreamSocketImpl");
}
StreamSocketImpl... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>Source::getContentLength() const
{
return _istr.str().length();
}
} } // namespace Poco::Net
<|fim_prefix|>//
// StringPartSource.cpp
//
// Library: Net
// Package: Messages
// Module: StringPartSource
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
/... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|> }
// Termination request
catch (Poco::InvalidArgumentException& exc)
{
ErrorHandler::logMessage(Message::PRIO_INFORMATION, "Shutting down TCPServer: " + exc.displayText());
}
catch (Poco::Exception& exc)
... | fim | ClickHouse/ClickHouse | cpp |
<|fim_suffix|>Connection::start()
{
try
{
run();
}
catch (Exception& exc)
{
ErrorHandler::handle(exc);
}
catch (std::exception& exc)
{
ErrorHandler::handle(exc);
}
catch (...)
{
ErrorHandler::handle();
}
}
} } // namespace Poco::Net
<|fim_prefix|>//
// TCPServerConnection.cpp
//
// Library: Net
//... | fim | ClickHouse/ClickHouse | cpp |
//
// TCPServerConnectionFactory.cpp
//
// Library: Net
// Package: TCPServer
// Module: TCPServerConnectionFactory
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Net/TCPServerConnectionFactory.h"
namespace... | fim | ClickHouse/ClickHouse | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.