Skip to content

Commit

Permalink
Serialization so far working. Event issue AFAIK solved. Some testing …
Browse files Browse the repository at this point in the history
…will be done to ensure that it really is solved. Culprits: nullptr and non-referenced script
  • Loading branch information
sereni-ty committed Jun 7, 2017
1 parent b473c9c commit f3344d3
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 64 deletions.
43 changes: 28 additions & 15 deletions SkyUtilities/Net/HTTP/RequestManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace SKU::Net::HTTP {

Plugin::Log(LOGL_VERBOSE, "(HTTP) RequestManager: Start");

should_run = true; // TODO: Initialize and should_run should be placed somewhere else
should_run = true;

if (processing_thread.valid() == false
|| processing_thread.wait_for(std::chrono::seconds(0)) != std::future_status::timeout)
Expand All @@ -159,7 +159,6 @@ namespace SKU::Net::HTTP {
void RequestManager::Process()
{
RequestManager::Ptr &mgr = Plugin::GetInstance()->GetNetInterface()->GetHTTPRequestManager();
std::list<Request::Ptr> requests;
int handle_reset_counter = 0, no_request_counter = 0;

mgr->curl_last_error = CURLM_OK;
Expand Down Expand Up @@ -396,7 +395,7 @@ namespace SKU::Net::HTTP {
Request::Ptr request = GetRequestByHandle(info->easy_handle);

if (request == nullptr) // Request not found.
{ // TODO: Remove request ..
{
Plugin::Log(LOGL_WARNING, "(HTTP) RequestManager: Request was answered but (internally) not found.");

curl_easy_cleanup(info->easy_handle); // Let the dead rest.
Expand Down Expand Up @@ -452,7 +451,11 @@ namespace SKU::Net::HTTP {

void RequestManager::OnRequestAdded(Request::Ptr request)
{
Start();
if (Plugin::GetInstance()->IsActive() == true)
{
Plugin::Log(LOGL_VERBOSE, "(HTTP) RequestManager: Starting..");
Start();
}
}

void RequestManager::OnRequestRemoval(Request::Ptr request)
Expand Down Expand Up @@ -541,7 +544,7 @@ namespace SKU::Net::HTTP {
SerializeIntegral(serialized, request->GetHandler()->GetTypeID());
SerializeString(serialized, ctx->url);
SerializeString(serialized, ctx->body);
SerializeIntegral(serialized, ctx->method);
SerializeIntegral<uint32_t>(serialized, ctx->method);

if (std::get<ISerializeable::idStream>(serialized).fail() == true)
{
Expand All @@ -565,12 +568,16 @@ namespace SKU::Net::HTTP {
{
int unfinished_requests = 0;

int id;
uint32_t timeout, handler_type_id, method;
std::string url, body;

if (IsRequestedSerialization(serialized) == false)
{
return;
}

if (std::get<ISerializeable::idStream>(serialized).tellg() == std::streampos(0))
if (std::get<ISerializeable::idStream>(serialized).tellp() == std::streampos(0))
{
Plugin::Log(LOGL_VERBOSE, "(HTTP) RequestManager: Nothing to load.");
return;
Expand All @@ -583,10 +590,11 @@ namespace SKU::Net::HTTP {

for (int i = 0; i < unfinished_requests; i++)
{
int id;
uint32_t timeout, handler_type_id;
std::string url, body;
RequestProtocolContext::Method method;
Plugin::Log(LOGL_DETAILED, "(HTTP) RequestManager: Deserializing Request..");

id = timeout = handler_type_id = method = 0;
url.clear();
body.clear();

DeserializeIntegral(serialized, id);
DeserializeIntegral(serialized, timeout);
Expand All @@ -595,8 +603,14 @@ namespace SKU::Net::HTTP {
DeserializeString(serialized, body);
DeserializeIntegral(serialized, method);

Plugin::Log(LOGL_DETAILED, "(HTTP) RequestManager: Deserialized.. ID=%d, Timeout=%d, Handler=%d, URL=%s, Body=%s, Method=%d",
id, timeout, handler_type_id, url.c_str(), body.c_str(), method);
if (std::get<ISerializeable::idStream>(serialized).fail() == true)
{
Plugin::Log(LOGL_WARNING, "(HTTP) RequestManager: Failed to deserialize data.. Aborting.");
return;
}

Plugin::Log(LOGL_DETAILED, "(HTTP) RequestManager: Deserialized.. ID=%d, Timeout=%d, Handler=%d, URL=%s, Body=%d (length), Method=%d",
id, timeout, handler_type_id, url.c_str(), body.length(), method);

Request::Ptr request = Request::Create<RequestProtocolContext>(id);
HTTP::RequestProtocolContext::Ptr ctx = request->GetProtocolContext<RequestProtocolContext>();
Expand All @@ -622,9 +636,8 @@ namespace SKU::Net::HTTP {
}

request->SetTimeout(timeout);
ctx->Initialize(method, url, body);

AddRequest(request);
ctx->Initialize(static_cast<HTTP::RequestProtocolContext::Method>(method), url, body);
AddRequest(std::move(request));
}

if (std::get<ISerializeable::idStream>(serialized).fail() == true)
Expand Down
2 changes: 1 addition & 1 deletion SkyUtilities/Net/HTTP/RequestManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define RESPONSE_MAX_SIZE 1024 * 256 // TODO: Configuration

namespace SKU::Net::HTTP { // TODO: (protection) request creation frequency // TODO: request accessor class instead of lock.. move ptr around and back on "release" <-- ctx only accessible through that one
namespace SKU::Net::HTTP { // TODO: request accessor class instead of lock.. move ptr around and back on "release" <-- ctx only accessible through that one
class RequestManager : public SKU::Net::RequestManagerBase, public ISerializeable
{
public:
Expand Down
6 changes: 5 additions & 1 deletion SkyUtilities/Net/HTTP/RequestProtocolContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
#include <exception>

namespace SKU::Net::HTTP {
RequestProtocolContext::RequestProtocolContext()
: curl_handle(nullptr), curl_last_error(CURLE_OK), method(mNotSet)
{}

RequestProtocolContext::~RequestProtocolContext()
{
Cleanup();
// Cleanup();
}

void RequestProtocolContext::Initialize()
Expand Down
2 changes: 2 additions & 0 deletions SkyUtilities/Net/HTTP/RequestProtocolContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ namespace SKU::Net::HTTP {
using Ptr = std::shared_ptr<RequestProtocolContext>;

public:
RequestProtocolContext();
~RequestProtocolContext();

public:
enum Method
{
mNotSet,
mPOST = 0,
mGET,
};
Expand Down
18 changes: 13 additions & 5 deletions SkyUtilities/Net/NetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ namespace SKU::Net { // TODO: Consider writing class with control management (St
Plugin::GetInstance()->GetPapyrusEventManager()->Register(GetEventString(evHTTPRequestFinished));
Plugin::GetInstance()->GetPapyrusEventManager()->Register(GetEventString(evModInfoRetrieval));

http_requestmanager = std::make_unique<HTTP::RequestManager>();
if (http_requestmanager == nullptr)
{
http_requestmanager = std::make_unique<HTTP::RequestManager>();
}

http_requestmanager->Start(); // in case there were requests loaded.
}

void Interface::Stop()
Expand All @@ -44,7 +49,7 @@ namespace SKU::Net { // TODO: Consider writing class with control management (St
Plugin::GetInstance()->GetPapyrusEventManager()->Unregister(GetEventString(evHTTPRequestFinished));

// request manager
this->http_requestmanager.reset();
this->http_requestmanager = std::make_unique<HTTP::RequestManager>();

// internal state
Plugin::Log(LOGL_VERBOSE, "Net: Stopped.");
Expand Down Expand Up @@ -76,9 +81,10 @@ namespace SKU::Net { // TODO: Consider writing class with control management (St
}

long Interface::HTTPRequest(uint32_t request_handler_type_id, TESForm *form, HTTP::RequestProtocolContext::Method method, std::string url, std::string body, long timeout)
{// TODO: check if scripts are paused, too..
{
// TODO: check if scripts are paused, too..
// TODO: own class for script call frequency check and blacklist..
using namespace std::chrono;

struct ScriptCallsTimeInformation
{
std::vector<steady_clock::time_point> last_known_calls;
Expand Down Expand Up @@ -153,7 +159,7 @@ namespace SKU::Net { // TODO: Consider writing class with control management (St
request->SetTimeout(timeout);
request->GetProtocolContext<HTTP::RequestProtocolContext>()->Initialize(method, url, body);

if (HTTP::LLabModInfoRequestEventHandler::TypeID < request_handler_type_id // TODO: Fix this whole TypeID mess.
if (HTTP::LLabModInfoRequestEventHandler::TypeID < request_handler_type_id
|| true == Plugin::GetInstance()->GetNetInterface()->http_requestmanager->AddRequest(request))
{
if (form != nullptr)
Expand Down Expand Up @@ -285,6 +291,8 @@ namespace SKU::Net { // TODO: Consider writing class with control management (St

bool Interface::IsRequestedSerialization(ISerializeable::SerializationEntity &serialized)
{
http_requestmanager = std::make_unique<HTTP::RequestManager>();

return http_requestmanager->IsRequestedSerialization(serialized);
}

Expand Down
8 changes: 0 additions & 8 deletions SkyUtilities/Net/Request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ namespace SKU::Net {
return handler;
}

void Request::SetID(int id) noexcept // TODO: check if it's still used
{
if (GLOBAL_REQUEST_ID_COUNTER < id)
GLOBAL_REQUEST_ID_COUNTER = id + 10;

this->id = id;
}

void Request::SetState(State state) noexcept
{
this->state = state;
Expand Down
3 changes: 1 addition & 2 deletions SkyUtilities/Net/Request.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace SKU::Net {
};

public:
Request(int pre_set_id = -1) noexcept;
explicit Request(int pre_set_id) noexcept;
~Request();

public:
Expand All @@ -51,7 +51,6 @@ namespace SKU::Net {
typename ProtocolContextType::Ptr GetProtocolContext();

public:
void SetID(int id) noexcept;
void SetState(State state) noexcept;
void SetTimeout(unsigned ms) noexcept;
void SetHandler(RequestEventHandler::Ptr handler);
Expand Down
2 changes: 1 addition & 1 deletion SkyUtilities/Net/Request.inl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Request::Ptr Request::Create(int pre_set_id)
throw std::bad_exception();
}

new_request->proto_ctx = std::make_shared<ProtocolContextType>();
new_request->proto_ctx = std::make_shared<ProtocolContextType>(); // TODO: read if it even returns a nullptr.. most likely throws a f.. an exception

if (new_request->proto_ctx == nullptr)
{
Expand Down
12 changes: 9 additions & 3 deletions SkyUtilities/Net/RequestEventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@
#define REQUEST_EVENT_HANDLER_DEF(type_id)\
public:\
const static uint32_t TypeID = type_id;\
inline uint32_t GetTypeID(){ return type_id; }
virtual inline uint32_t GetTypeID() final { return type_id; }

namespace SKU::Net {
class Request;

class RequestEventHandler // TODO: implement request into class
{
REQUEST_EVENT_HANDLER_DEF(0)

public:
using Ptr = std::shared_ptr<RequestEventHandler>;

public:
virtual void OnRequestFinished(std::shared_ptr<Request> request)
{}

public:
const static uint32_t TypeID = 0;

virtual inline uint32_t GetTypeID()
{
return 0;
}
};
}
15 changes: 10 additions & 5 deletions SkyUtilities/Net/RequestManagerBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
#include "Plugin.h"

namespace SKU::Net {
RequestManagerBase::RequestManagerBase()
: pool()
{}

bool RequestManagerBase::AddRequest(Request::Ptr request) noexcept
{
try
{
pool.Get().insert(request);
if (pool.AddRequest(request).second == true)
{
OnRequestAdded(request);
return true;
}
}
catch (std::exception e)
{
return false;
}

OnRequestAdded(request);

return true;
return false;
}

void RequestManagerBase::RemoveRequest(Request::Ptr request)
Expand Down
3 changes: 3 additions & 0 deletions SkyUtilities/Net/RequestManagerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
namespace SKU::Net {
class RequestManagerBase
{
public:
RequestManagerBase();

public:
bool AddRequest(Request::Ptr request) noexcept;
virtual void RemoveRequest(Request::Ptr request);
Expand Down
9 changes: 9 additions & 0 deletions SkyUtilities/Net/RequestPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#include <algorithm>

namespace SKU::Net {
RequestPool::RequestPool()
: pool()
{}

Request::Ptr RequestPool::GetRequestByID(int id)
{
auto& request_pos = std::find_if(pool.begin(), pool.end(), [&] (Request::Ptr request) -> bool
Expand Down Expand Up @@ -51,6 +55,11 @@ namespace SKU::Net {
});
}

std::pair< std::set<Request::Ptr>::iterator, bool > RequestPool::AddRequest(Request::Ptr request)
{
return pool.emplace(request);
}

std::set<Request::Ptr> &RequestPool::Get() noexcept
{
return pool;
Expand Down
6 changes: 6 additions & 0 deletions SkyUtilities/Net/RequestPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ namespace SKU::Net {
public:
Request::Ptr GetRequestByID(int id);

public:
RequestPool();

public:
std::vector<Request::Ptr> GetRequestsByState(Request::State state);

public:
int GetCountByState(Request::State state);
int GetCountByStateExceptions(std::initializer_list<Request::State> state_list);

public:
std::pair< std::set<Request::Ptr>::iterator, bool > AddRequest(Request::Ptr request);

public:
std::set<Request::Ptr> &Get() noexcept;

Expand Down
9 changes: 6 additions & 3 deletions SkyUtilities/PapyrusEventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ namespace SKU {
Plugin::Log(LOGL_VERBOSE, "PapyrusEventManager: Adding recipient '%s' to event '%s'.",
recipient->GetFullName(), event_name.c_str());

recipient_map.at(event_name).emplace(recipient_handle);
if (recipient_map.at(event_name).emplace(recipient_handle).second == true)
{
policy->AddRef(recipient_handle);
}

return true;
}
Expand Down Expand Up @@ -242,7 +245,7 @@ namespace SKU {
return;
}

if (std::get<ISerializeable::idStream>(serialized).tellg() == std::streampos(0))
if (std::get<ISerializeable::idStream>(serialized).tellp() == std::streampos(0))
{
Plugin::Log(LOGL_VERBOSE, "PapyrusEventManager: No events were registered.");
return;
Expand All @@ -258,7 +261,7 @@ namespace SKU {
DeserializeString(serialized, event_name);
DeserializeIntegral(serialized, recipient_amount);

Plugin::Log(LOGL_DETAILED, "PapyrusEventManager: Setting up event '%d' with %d recipients",
Plugin::Log(LOGL_DETAILED, "PapyrusEventManager: Setting up event '%s' with %d recipients",
event_name.c_str(), recipient_amount);

if (recipient_amount > 0)
Expand Down
2 changes: 1 addition & 1 deletion SkyUtilities/PapyrusEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace SKU {
virtual bool IsRequestedSerialization(ISerializeable::SerializationEntity &serialized) final;

private:
using RecipientMap = std::unordered_map</* event name: */std::string, std::unordered_set< PapyrusEventRecipient > >;
using RecipientMap = std::unordered_map</* event name: */std::string, std::unordered_set< PapyrusEventRecipient > >; // TODO: turn around.. makes more sense
using EventMap = std::unordered_map </* event name: */std::string, std::unordered_set< std::unique_ptr<PapyrusEvent> > >;
using EventKeyMap = std::unordered_map < std::string, BSFixedString >;

Expand Down

2 comments on commit f3344d3

@sereni-ty
Copy link
Owner Author

@sereni-ty sereni-ty commented on f3344d3 Jun 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was loading a savegame several times successfully.
Logfile:


[    INFO] Waiting for Debugger to attach..
[    INFO] Debugger attached.
[      ->| Net: Registered Papyrus functions.
[    INFO] Plugin: Loading.
[ VERBOSE] Plugin: Deserialization (record: RMSU)..
[ VERBOSE] (HTTP) RequestManager: Loading 5 requests from save.
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=30, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 30): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 30) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=29, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 29): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 29) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=33, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 33): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 33) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=32, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 32): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 32) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=31, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 31): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 31) URL="http://www.google.de/?q=24"
[ VERBOSE] Plugin: Deserialization (record: PESU)..
[ VERBOSE] PapyrusEventManager: Loading 2 registrered events from save.
[      ->| PapyrusEventManager: Setting up event 'OnHTTPRequestFinished' with 1 recipients
[ VERBOSE] PapyrusEventManager: Registered event 'OnHTTPRequestFinished'.
[      ->| PapyrusEventManager: Setting up event 'OnModInfoRetrieval' with 1 recipients
[ VERBOSE] PapyrusEventManager: Registered event 'OnModInfoRetrieval'.
[    INFO] Plugin: Loaded.
[    INFO] Net: Initializing.
[ VERBOSE] PapyrusEventManager: Registered event 'OnHTTPRequestFinished'.
[ VERBOSE] PapyrusEventManager: Registered event 'OnModInfoRetrieval'.
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] (HTTP) RequestManager: Starting Thread (again)
[ VERBOSE] (HTTP) RequestManager: Starting to process requests
[ VERBOSE] (HTTP) RequestManager: 5 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 32)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 30)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 31)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 33)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 29)
[ VERBOSE] (HTTP) RequestManager: 5 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] Request (id: 132): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 132) URL="http://www.google.de/?q=25"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] (HTTP) RequestManager: 1 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 132)
[ VERBOSE] (HTTP) RequestManager: 1 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 32) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 30) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 31) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 33) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 29) was answered with 15740 bytes.
[ VERBOSE] Request (id: 133): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 133) URL="http://www.google.de/?q=25"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 134): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 134) URL="http://www.google.de/?q=25"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 135): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 135) URL="http://www.google.de/?q=25"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 136): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 136) URL="http://www.google.de/?q=25"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 137): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 137) URL="http://www.google.de/?q=25"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] (HTTP) RequestManager: 5 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 137)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 135)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 134)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 136)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 133)
[ VERBOSE] (HTTP) RequestManager: 5 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 32) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 30) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 31) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 33) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 29) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 32) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 32) was answered with 2299 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 32) was answered with 335 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 32) was answered with 9765 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 30) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 30) was answered with 2366 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 30) was answered with 319 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 30) was answered with 9708 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 31) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 31) was answered with 2184 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 31) was answered with 436 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 31) was answered with 11127 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 33) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 33) was answered with 2300 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 33) was answered with 258 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 33) was answered with 9849 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 29) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 29) was answered with 2175 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 29) was answered with 184 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 29) was answered with 10137 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 132) was answered with 15740 bytes.
[ VERBOSE] Request (id: 138): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 138) URL="http://www.google.de/?q=26"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 139): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 139) URL="http://www.google.de/?q=26"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 140): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 140) URL="http://www.google.de/?q=26"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 141): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 141) URL="http://www.google.de/?q=26"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 142): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 142) URL="http://www.google.de/?q=26"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 143): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 143) URL="http://www.google.de/?q=26"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[      ->| Request (id: 32, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 32) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 32).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '32' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 32): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 32).
[      ->| Request (id: 30, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 30) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 30).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '30' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 30): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 30).
[      ->| Request (id: 31, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 31) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 31).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '31' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 31): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 31).
[      ->| Request (id: 33, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 33) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 33).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '33' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 33): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 33).
[      ->| Request (id: 29, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 29) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 29).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '29' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 29): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 29).
[ VERBOSE] (HTTP) RequestManager: 6 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 141)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 139)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 143)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 140)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 138)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 142)
[ VERBOSE] (HTTP) RequestManager: 6 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 132) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 137) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 135) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 134) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 136) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 133) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 132) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 132) was answered with 2289 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 132) was answered with 148 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 132) was answered with 10027 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 137) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 135) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 134) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 136) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 133) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 141) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 139) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 143) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 140) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 138) was answered with 15740 bytes.
[      ->| Request (id: 132, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 132) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 132).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '132' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 132): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 132).
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 137) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 137) was answered with 2381 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 137) was answered with 320 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 137) was answered with 9707 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 135) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 135) was answered with 2204 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 135) was answered with 182 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 135) was answered with 10084 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 134) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 134) was answered with 2116 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 134) was answered with 300 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 134) was answered with 11372 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 136) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 136) was answered with 2297 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 136) was answered with 259 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 136) was answered with 9850 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 133) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 133) was answered with 2267 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 133) was answered with 160 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 133) was answered with 10059 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 141) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 139) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 143) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 140) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 138) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 142) was answered with 15740 bytes.
[      ->| Request (id: 137, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 137) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 137).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '137' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 137): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 137).
[      ->| Request (id: 135, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 135) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 135).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '135' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 135): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 135).
[      ->| Request (id: 134, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 134) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 134).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '134' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 134): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 134).
[      ->| Request (id: 136, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 136) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 136).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '136' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 136): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 136).
[      ->| Request (id: 133, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 133) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 133).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '133' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 133): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 133).
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 141) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 141) was answered with 2530 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 141) was answered with 221 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 141) was answered with 10988 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 139) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 139) was answered with 2354 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 139) was answered with 326 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 139) was answered with 9752 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 143) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 143) was answered with 2505 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 143) was answered with 222 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 143) was answered with 11037 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 140) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 140) was answered with 2298 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 140) was answered with 147 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 140) was answered with 9995 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 138) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 138) was answered with 2329 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 138) was answered with 326 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 138) was answered with 9737 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 142) was answered with 16384 bytes.
[      ->| Request (id: 141, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 141) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 141).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '141' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 141): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 141).
[      ->| Request (id: 139, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 139) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 139).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '139' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 139): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 139).
[      ->| Request (id: 143, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 143) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 143).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '143' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 143): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 143).
[      ->| Request (id: 140, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 140) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 140).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '140' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 140): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 140).
[      ->| Request (id: 138, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 138) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 138).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '138' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 138): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 138).
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 142) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 142) was answered with 2318 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 142) was answered with 150 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 142) was answered with 9972 bytes.
[      ->| Request (id: 142, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 142) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 142).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '142' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 142): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 142).
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] Request (id: 144): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 144) URL="http://www.google.de/?q=27"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] (HTTP) RequestManager: Request processing thread finished its work or was interrupted (error code: 0)
[ VERBOSE] Request (id: 145): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 145) URL="http://www.google.de/?q=27"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] (HTTP) RequestManager: Starting Thread (again)
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] (HTTP) RequestManager: Starting to process requests
[ VERBOSE] (HTTP) RequestManager: 2 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 145)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 144)
[ VERBOSE] (HTTP) RequestManager: 2 requests ready to be added to the multi handle
[ VERBOSE] Request (id: 146): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 146) URL="http://www.google.de/?q=27"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 147): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 147) URL="http://www.google.de/?q=27"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 148): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 148) URL="http://www.google.de/?q=27"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] Request (id: 149): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 149) URL="http://www.google.de/?q=27"
[ VERBOSE] (HTTP) RequestManager: Starting..
[ VERBOSE] (HTTP) RequestManager: Start
[ VERBOSE] PapyrusEventManager: Adding recipient '(null)' to event 'OnHTTPRequestFinished'.
[ VERBOSE] (HTTP) RequestManager: 4 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 148)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 146)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 149)
[ VERBOSE] (HTTP) RequestManager: Setting up request (id: 147)
[ VERBOSE] (HTTP) RequestManager: 4 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 145) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 144) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 145) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 144) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 148) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 146) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 149) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 147) was answered with 15740 bytes.
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 145) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 145) was answered with 2162 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 145) was answered with 182 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 145) was answered with 10128 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 144) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 144) was answered with 2291 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 144) was answered with 154 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 144) was answered with 10011 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 148) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 146) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 149) was answered with 16384 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 147) was answered with 16384 bytes.
[      ->| Request (id: 145, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 145) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 145).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '145' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 145): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 145).
[      ->| Request (id: 144, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 144) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 144).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '144' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 144): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 144).
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request (id: 148) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 148) was answered with 2338 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 148) was answered with 326 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 148) was answered with 9737 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 146) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 146) was answered with 2183 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 146) was answered with 185 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 146) was answered with 10134 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 149) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 149) was answered with 2165 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 149) was answered with 176 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 149) was answered with 10179 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 147) was answered with 644 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 147) was answered with 2304 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 147) was answered with 143 bytes.
[ VERBOSE] (HTTP) RequestManager: Request (id: 147) was answered with 10000 bytes.
[      ->| Request (id: 148, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 148) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 148).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '148' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 148): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 148).
[      ->| Request (id: 146, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 146) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 146).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '146' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 146): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 146).
[      ->| Request (id: 149, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 149) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 149).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '149' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 149): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 149).
[      ->| Request (id: 147, error code: 0) has finished successfully
[ VERBOSE] (HTTP) RequestManager: Calling request (id: 147) handler.
[ VERBOSE] BasicRequestEventHandler: Handling request (id: 147).
[ VERBOSE] PapyrusEventManager: Sending event 'OnHTTPRequestFinished' with 4 arguments.
[ VERBOSE] PapyrusEvent: Arguments (count: 4) for papyrus event are being set up.
[      ->| PapyrusEvent: Argument #1 is '147' (int).
[      ->| PapyrusEvent: Argument #2 is 'false' (bool).
[      ->| PapyrusEvent: Argument #3 is '200' (int).
[      ->| PapyrusEvent: Argument #4 is a string (std::string).
[ VERBOSE] Request (id: 147): Cleaning up request.
[ VERBOSE] (HTTP) RequestProtocolContext: Cleaning up request (id: 147).
[ VERBOSE] (HTTP) RequestManager: 0 requests waiting for setup
[ VERBOSE] (HTTP) RequestManager: 0 requests ready to be added to the multi handle
[ VERBOSE] (HTTP) RequestManager: Request processing thread finished its work or was interrupted (error code: 0)
[ VERBOSE] PapyrusEventManager: Removing every recipient for any event.
[ VERBOSE] Net: Stopping.
[ VERBOSE] Net: Removing Events.
[ VERBOSE] (HTTP) RequestManager: Cleaning up..
[ VERBOSE] (HTTP) RequestManager: Cleaned up..
[ VERBOSE] Net: Stopped.
[    INFO] Plugin: Loading.
[ VERBOSE] (HTTP) RequestManager: Cleaning up..
[ VERBOSE] (HTTP) RequestManager: Cleaned up..
[ VERBOSE] Plugin: Deserialization (record: RMSU)..
[ VERBOSE] (HTTP) RequestManager: Loading 5 requests from save.
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=30, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 30): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 30) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=29, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 29): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 29) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=33, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 33): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 33) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=32, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 32): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 32) URL="http://www.google.de/?q=24"
[      ->| (HTTP) RequestManager: Deserializing Request..
[      ->| (HTTP) RequestManager: Deserialized.. ID=31, Timeout=2500, Handler=1112687944, URL=http://www.google.de/?q=24, Body=0 (length), Method=1
[ VERBOSE] Request (id: 31): Request created
[ VERBOSE] (HTTP) RequestProtocolContext: Request (id: 31) URL="http://www.google.de/?q=24"
[ VERBOSE] Plugin: Deserialization (record: PESU)..
[ VERBOSE] PapyrusEventManager: Loading 2 registrered events from save.
[      ->| PapyrusEventManager: Setting up event 'OnHTTPRequestFinished' with 1 recipients
[ VERBOSE] PapyrusEventManager: Registered event 'OnHTTPRequestFinished'.
[      ->| PapyrusEventManager: Setting up event 'OnModInfoRetrieval' with 1 recipients
[ VERBOSE] PapyrusEventManager: Registered event 'OnModInfoRetrieval'.
[    INFO] Plugin: Loaded

@sereni-ty
Copy link
Owner Author

@sereni-ty sereni-ty commented on f3344d3 Jun 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with:

int get_counter = 0

event OnInit()
  ; Net Tests  
  SKUNet.GetLLabModInfo(self, "150")
  SKUNet.GetNexusModInfo(self, "75861") ; Adult
  SKUNet.GetNexusModInfo(self, "68000") ; Non Adult

  RegisterForSingleUpdate(0.5)
endEvent

event OnModInfoRetrieval(int request_id, bool request_failed, string mod_name, string mod_version, string mod_last_updated, string mod_added, string mod_downloads, string mod_views)
  MiscUtil.PrintConsole("Mod Information: " + mod_name + " (" + mod_version + ") - last updated: " + mod_last_updated + ", added: " + mod_added + ", downloads " + mod_downloads + ", views: " + mod_views)
endEvent

event OnUpdate()
  if get_counter < 20
    RegisterForSingleUpdate(0.5)
  endIf

  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter+20), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter+20), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter+20), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter+20), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter+20), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter+20), 2500)
  get_counter += 1
endEvent

event OnHTTPRequestFinished(int request_id, bool request_failed, int response_code, string response_body) 
  string request_status_text = "finished successfully"

  if request_failed == true
    request_status_text = "failed"
  endIf

  MiscUtil.PrintConsole("Request " + request_id + " has " + request_status_text + " (http response: "+ response_code +"): Response: " + response_body)
  Debug.Trace("Request " + request_id + " has " + request_status_text + " (http response: "+ response_code +"): Response: " + response_body)
endEvent

Please sign in to comment.