[haiku-commits] haiku: hrev51288 - src/apps/serialconnect

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 16 Jul 2017 16:12:13 +0200 (CEST)

hrev51288 adds 1 changeset to branch 'master'
old head: cd4d3a3010394751db49c96528a76888dbd328db
new head: ae2c5eeeab5f445bdef20042cdf3cc8d1312a748
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=ae2c5eeeab5f+%5Ecd4d3a301039

----------------------------------------------------------------------------

ae2c5eeeab5f: SerialConnect: handle cancelled file transfers.
  
  The remote can cancel a file transfer by sending a CAN character.
  Handle this by stopping the transfer and hiding the progress bar.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev51288
Commit:      ae2c5eeeab5f445bdef20042cdf3cc8d1312a748
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ae2c5eeeab5f
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Jul 16 14:11:47 2017 UTC

----------------------------------------------------------------------------

1 file changed, 11 insertions(+)
src/apps/serialconnect/XModem.cpp | 11 +++++++++++

----------------------------------------------------------------------------

diff --git a/src/apps/serialconnect/XModem.cpp 
b/src/apps/serialconnect/XModem.cpp
index 22a4a90..4184c68 100644
--- a/src/apps/serialconnect/XModem.cpp
+++ b/src/apps/serialconnect/XModem.cpp
@@ -19,6 +19,7 @@ static const char kSOH =  1;
 static const char kEOT =  4;
 static const char kACK =  6;
 static const char kNAK = 21;
+static const char kCAN = 24;
 static const char kSUB = 26;
 
 static const int kBlockSize = 128;
@@ -91,6 +92,16 @@ XModemSender::BytesReceived(const uint8_t* data, size_t 
length)
                                }
                                break;
 
+                       case kCAN:
+                       {
+                               BMessage msg(kMsgProgress);
+                               msg.AddInt32("pos", 0);
+                               msg.AddInt32("size", 0);
+                               msg.AddString("info", "Remote cancelled 
transfer");
+                               fListener.SendMessage(&msg);
+                               return true;
+                       }
+
                        default:
                                break;
                }


Other related posts:

  • » [haiku-commits] haiku: hrev51288 - src/apps/serialconnect - pulkomandy