mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 06:35:57 +08:00
Check that last_send buffer is large enough in addition to whether or not we have sent data.
Avoids a crash at reconnect, leaves an error message from printer (currently use M110 0 to get back to a good state) Fixes #4009
This commit is contained in:
parent
2ee32bb244
commit
b6708e87f0
@ -359,7 +359,7 @@ GCodeSender::on_read(const boost::system::error_code& error,
|
||||
boost::algorithm::trim_left_if(line, !boost::algorithm::is_digit());
|
||||
size_t toresend = boost::lexical_cast<size_t>(line.substr(0, line.find_first_not_of("0123456789")));
|
||||
toresend++; // N is 0-based
|
||||
if (toresend >= this->sent - this->last_sent.size()) {
|
||||
if (toresend >= this->sent - this->last_sent.size() && toresend < this->last_sent.size()) {
|
||||
{
|
||||
boost::lock_guard<boost::mutex> l(this->queue_mutex);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user