From a56a507ca26263de51066b29d6213226b5042daa Mon Sep 17 00:00:00 2001 From: deranjer Date: Mon, 5 Mar 2018 22:48:16 -0500 Subject: [PATCH] some modal changes, adding memory leak to fix stop/drop issue --- config.toml | 4 +- .../TopMenu/Modals/RSSModal/RSSFeedList.js | 1 - .../src/TopMenu/Modals/addTorrentLinkModal.js | 2 +- goTorrentWebUI/src/login.js | 2 +- main.go | 5 +-- settings/settings.go | 40 +++++++++---------- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/config.toml b/config.toml index dc614d96..00d0680d 100644 --- a/config.toml +++ b/config.toml @@ -37,12 +37,12 @@ DisableEncryption = false ForceEncryption = false - PreferNoEncryption = true + PreferNoEncryption = false [torrentClientConfig] DownloadDir = 'downloading' #the full OR relative path where the torrent server stores in-progress torrents - Seed = true #boolean #seed after download + Seed = false #boolean #seed after download # Never send chunks to peers. NoUpload = false #boolean diff --git a/goTorrentWebUI/src/TopMenu/Modals/RSSModal/RSSFeedList.js b/goTorrentWebUI/src/TopMenu/Modals/RSSModal/RSSFeedList.js index c12e6fc8..64beb352 100644 --- a/goTorrentWebUI/src/TopMenu/Modals/RSSModal/RSSFeedList.js +++ b/goTorrentWebUI/src/TopMenu/Modals/RSSModal/RSSFeedList.js @@ -93,7 +93,6 @@ const inlineStyle = { } render() { - //const { classes, onRequestClose, handleRequestClose, handleSubmit } = this.props; if (this.props.RSSList.length > 0 && this.state.showList == false){ console.log("Setting list to show....") this.setState({showList: true}) diff --git a/goTorrentWebUI/src/TopMenu/Modals/addTorrentLinkModal.js b/goTorrentWebUI/src/TopMenu/Modals/addTorrentLinkModal.js index e5d43d7c..33d8ffa5 100644 --- a/goTorrentWebUI/src/TopMenu/Modals/addTorrentLinkModal.js +++ b/goTorrentWebUI/src/TopMenu/Modals/addTorrentLinkModal.js @@ -74,7 +74,7 @@ export default class addTorrentPopup extends React.Component { } render() { - const { classes, onRequestClose, handleRequestClose, handleSubmit } = this.props; + const { classes, onClose, handleRequestClose, handleSubmit } = this.props; return (
diff --git a/goTorrentWebUI/src/login.js b/goTorrentWebUI/src/login.js index b4efbc5c..0b2f5088 100644 --- a/goTorrentWebUI/src/login.js +++ b/goTorrentWebUI/src/login.js @@ -86,7 +86,7 @@ export default class Login extends React.Component { } render() { - const { classes, onRequestClose, handleRequestClose, handleSubmit } = this.props; + const { classes, onClose, handleRequestClose, handleSubmit } = this.props; return ( Login Here diff --git a/main.go b/main.go index 4cfbe8bd..05bff958 100644 --- a/main.go +++ b/main.go @@ -121,13 +121,13 @@ func main() { httpAddr := Config.HTTPAddr os.MkdirAll(Config.TFileUploadFolder, 0755) //creating a directory to store uploaded torrent files os.MkdirAll(Config.TorrentWatchFolder, 0755) //creating a directory to watch for added .torrent files - Logger.WithFields(logrus.Fields{"Config": Config}).Info("Torrent Client Config has been generated...") + //Logger.WithFields(logrus.Fields{"Config": Config}).Info("Torrent Client Config has been generated...") tclient, err := torrent.NewClient(&Config.TorrentConfig) //pulling out the torrent specific config to use if err != nil { Logger.WithFields(logrus.Fields{"error": err}).Fatalf("Error creating torrent client: %s") } - + fmt.Printf("%+v\n", Config.TorrentConfig) db, err := storm.Open("storage.db") //initializing the boltDB store that contains all the added torrents if err != nil { Logger.WithFields(logrus.Fields{"error": err}).Fatal("Error opening/creating storage.db") @@ -466,7 +466,6 @@ func main() { oldTorrentInfo := Storage.FetchTorrentFromStorage(db, singleTorrent.InfoHash().String()) oldTorrentInfo.TorrentStatus = "Stopped" oldTorrentInfo.MaxConnections = 0 - fmt.Println("Running Command...", "oldMax=singleTorrent.SetMaxEstablishedConns(0)") oldMax := singleTorrent.SetMaxEstablishedConns(0) //Forcing the max amount of connections allowed to zero effectively stopping it Logger.WithFields(logrus.Fields{"oldMaxConnections": oldMax, "torrent": singleTorrent}).Info("Forcing connections to zero for torrent") Storage.UpdateStorageTick(db, oldTorrentInfo) //Updating the torrent status diff --git a/settings/settings.go b/settings/settings.go index f2bfad3d..fc6e4a9f 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -175,11 +175,11 @@ func FullClientSettingsNew() FullClientSettings { pushBulletToken := viper.GetString("notifications.PushBulletToken") //Rate Limiters - var uploadRateLimiter *rate.Limiter - var downloadRateLimiter *rate.Limiter - uploadRate := viper.GetString("serverConfig.UploadRateLimit") - downloadRate := viper.GetString("serverConfig.DownloadRateLimit") - downloadRateLimiter, uploadRateLimiter = calculateRateLimiters(uploadRate, downloadRate) + //var uploadRateLimiter *rate.Limiter + //var downloadRateLimiter *rate.Limiter + //uploadRate := viper.GetString("serverConfig.UploadRateLimit") + //downloadRate := viper.GetString("serverConfig.DownloadRateLimit") + //downloadRateLimiter, uploadRateLimiter = calculateRateLimiters(uploadRate, downloadRate) //Internals dataDir := filepath.ToSlash(viper.GetString("torrentClientConfig.DownloadDir")) //Converting the string literal into a filepath dataDirAbs, err := filepath.Abs(dataDir) //Converting to an absolute file path @@ -213,21 +213,21 @@ func FullClientSettingsNew() FullClientSettings { } tConfig := torrent.Config{ - DataDir: dataDirAbs, - ListenAddr: listenAddr, - DisablePEX: disablePex, - NoDHT: noDHT, - DHTConfig: dhtServerConfig, - NoUpload: noUpload, - Seed: seed, - UploadRateLimiter: uploadRateLimiter, - DownloadRateLimiter: downloadRateLimiter, - PeerID: peerID, - DisableUTP: disableUTP, - DisableTCP: disableTCP, - DisableIPv6: disableIPv6, - Debug: debug, - EncryptionPolicy: encryptionPolicy, + DataDir: dataDirAbs, + ListenAddr: listenAddr, + DisablePEX: disablePex, + NoDHT: noDHT, + DHTConfig: dhtServerConfig, + NoUpload: noUpload, + Seed: seed, + //UploadRateLimiter: uploadRateLimiter, + //DownloadRateLimiter: downloadRateLimiter, + PeerID: peerID, + DisableUTP: disableUTP, + DisableTCP: disableTCP, + DisableIPv6: disableIPv6, + Debug: debug, + EncryptionPolicy: encryptionPolicy, } Config := FullClientSettings{