]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Tracker/Types.hs
misc cleanups in Http tracker
[functorrent.git] / src / FuncTorrent / Tracker / Types.hs
index 49e63e32c86f80f1081b718a931c2493b88ebc29..cc86e7814c64dfed1d6d2623fae44aad80873b98 100644 (file)
@@ -1,4 +1,23 @@
 {-# LANGUAGE OverloadedStrings #-}
+{-
+Copyright (C) 2015-2016 Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
+
+This file is part of FuncTorrent.
+
+FuncTorrent is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+FuncTorrent is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with FuncTorrent; if not,  see <http://www.gnu.org/licenses/>
+-}
+
 module FuncTorrent.Tracker.Types
        ( TrackerProtocol(..)
        , TrackerResponse(..)
@@ -9,6 +28,7 @@ module FuncTorrent.Tracker.Types
        , Port
        ) where
 
+import Data.ByteString (ByteString)
 import Control.Concurrent.MVar (MVar)
 
 import FuncTorrent.Peer (Peer(..))
@@ -23,10 +43,11 @@ data TrackerProtocol = Http
 
 data TrackerEventState = None
                        | Started
-                       | Stopped
                        | Completed
+                       | Error ByteString
                        deriving (Show, Eq)
-data TrackerMsg = GetStatusMsg
+
+data TrackerMsg = GetStatusMsg TrackerEventState
                 | GetConnectedPeersMsg (MVar [Peer])
 
 data TState = TState { left :: Integer