mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 15:13:58 -06:00
A *lot* of import fixes for flatpak (#3909)
* A *lot* of import fixes for flatpak Aside, thank you @hadess for the majority of these fixes. You are the base point for a lot of issues fixed during the creation of this flatpak. * Use slic3r::load_string_file Boost 1.84 removed `boost::fs::load_string_file` so use the func located in Utils.hpp
This commit is contained in:
parent
4110ecc968
commit
951fc8e98a
114 changed files with 214 additions and 45 deletions
|
@ -1,6 +1,7 @@
|
|||
#ifndef slic3r_Http_App_hpp_
|
||||
#define slic3r_Http_App_hpp_
|
||||
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include <stack>
|
||||
|
||||
|
@ -12,7 +13,6 @@
|
|||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
using namespace boost;
|
||||
using namespace boost::system;
|
||||
using namespace boost::asio;
|
||||
|
||||
|
@ -73,21 +73,21 @@ public:
|
|||
|
||||
class session
|
||||
{
|
||||
asio::streambuf buff;
|
||||
boost::asio::streambuf buff;
|
||||
http_headers headers;
|
||||
|
||||
static void read_body(std::shared_ptr<session> pThis)
|
||||
{
|
||||
int nbuffer = 1000;
|
||||
std::shared_ptr<std::vector<char>> bufptr = std::make_shared<std::vector<char>>(nbuffer);
|
||||
asio::async_read(pThis->socket, boost::asio::buffer(*bufptr, nbuffer), [pThis](const boost::beast::error_code& e, std::size_t s)
|
||||
boost::asio::async_read(pThis->socket, boost::asio::buffer(*bufptr, nbuffer), [pThis](const boost::beast::error_code& e, std::size_t s)
|
||||
{
|
||||
});
|
||||
}
|
||||
|
||||
static void read_next_line(std::shared_ptr<session> pThis)
|
||||
{
|
||||
asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s)
|
||||
boost::asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s)
|
||||
{
|
||||
std::string line, ignore;
|
||||
std::istream stream{ &pThis->buff };
|
||||
|
@ -100,7 +100,7 @@ class session
|
|||
if (pThis->headers.content_length() == 0)
|
||||
{
|
||||
std::shared_ptr<std::string> str = std::make_shared<std::string>(pThis->headers.get_response());
|
||||
asio::async_write(pThis->socket, boost::asio::buffer(str->c_str(), str->length()), [pThis, str](const boost::beast::error_code& e, std::size_t s)
|
||||
boost::asio::async_write(pThis->socket, boost::asio::buffer(str->c_str(), str->length()), [pThis, str](const boost::beast::error_code& e, std::size_t s)
|
||||
{
|
||||
std::cout << "done" << std::endl;
|
||||
});
|
||||
|
@ -119,7 +119,7 @@ class session
|
|||
|
||||
static void read_first_line(std::shared_ptr<session> pThis)
|
||||
{
|
||||
asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s)
|
||||
boost::asio::async_read_until(pThis->socket, pThis->buff, '\r', [pThis](const boost::beast::error_code& e, std::size_t s)
|
||||
{
|
||||
std::string line, ignore;
|
||||
std::istream stream{ &pThis->buff };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue