some modal changes, adding memory leak to fix stop/drop issue

This commit is contained in:
2018-03-05 22:48:16 -05:00
parent ca1ed925d3
commit a56a507ca2
6 changed files with 26 additions and 28 deletions

View File

@@ -37,12 +37,12 @@
DisableEncryption = false DisableEncryption = false
ForceEncryption = false ForceEncryption = false
PreferNoEncryption = true PreferNoEncryption = false
[torrentClientConfig] [torrentClientConfig]
DownloadDir = 'downloading' #the full OR relative path where the torrent server stores in-progress torrents 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. # Never send chunks to peers.
NoUpload = false #boolean NoUpload = false #boolean

View File

@@ -93,7 +93,6 @@ const inlineStyle = {
} }
render() { render() {
//const { classes, onRequestClose, handleRequestClose, handleSubmit } = this.props;
if (this.props.RSSList.length > 0 && this.state.showList == false){ if (this.props.RSSList.length > 0 && this.state.showList == false){
console.log("Setting list to show....") console.log("Setting list to show....")
this.setState({showList: true}) this.setState({showList: true})

View File

@@ -74,7 +74,7 @@ export default class addTorrentPopup extends React.Component {
} }
render() { render() {
const { classes, onRequestClose, handleRequestClose, handleSubmit } = this.props; const { classes, onClose, handleRequestClose, handleSubmit } = this.props;
return ( return (
<div style={inlineStyle}> <div style={inlineStyle}>
<IconButton onClick={this.handleClickOpen} color="primary" data-tip="Add Magnet Link" style={button} centerRipple aria-label="Add Magnet Link" > <IconButton onClick={this.handleClickOpen} color="primary" data-tip="Add Magnet Link" style={button} centerRipple aria-label="Add Magnet Link" >

View File

@@ -86,7 +86,7 @@ export default class Login extends React.Component {
} }
render() { render() {
const { classes, onRequestClose, handleRequestClose, handleSubmit } = this.props; const { classes, onClose, handleRequestClose, handleSubmit } = this.props;
return ( return (
<Dialog open={this.state.open} onClose={this.handleRequestClose} ignoreBackdropClick={true} disableBackdrop={true}> <Dialog open={this.state.open} onClose={this.handleRequestClose} ignoreBackdropClick={true} disableBackdrop={true}>
<DialogTitle>Login Here</DialogTitle> <DialogTitle>Login Here</DialogTitle>

View File

@@ -121,13 +121,13 @@ func main() {
httpAddr := Config.HTTPAddr httpAddr := Config.HTTPAddr
os.MkdirAll(Config.TFileUploadFolder, 0755) //creating a directory to store uploaded torrent files 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 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 tclient, err := torrent.NewClient(&Config.TorrentConfig) //pulling out the torrent specific config to use
if err != nil { if err != nil {
Logger.WithFields(logrus.Fields{"error": err}).Fatalf("Error creating torrent client: %s") 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 db, err := storm.Open("storage.db") //initializing the boltDB store that contains all the added torrents
if err != nil { if err != nil {
Logger.WithFields(logrus.Fields{"error": err}).Fatal("Error opening/creating storage.db") 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 := Storage.FetchTorrentFromStorage(db, singleTorrent.InfoHash().String())
oldTorrentInfo.TorrentStatus = "Stopped" oldTorrentInfo.TorrentStatus = "Stopped"
oldTorrentInfo.MaxConnections = 0 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 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") Logger.WithFields(logrus.Fields{"oldMaxConnections": oldMax, "torrent": singleTorrent}).Info("Forcing connections to zero for torrent")
Storage.UpdateStorageTick(db, oldTorrentInfo) //Updating the torrent status Storage.UpdateStorageTick(db, oldTorrentInfo) //Updating the torrent status

View File

@@ -175,11 +175,11 @@ func FullClientSettingsNew() FullClientSettings {
pushBulletToken := viper.GetString("notifications.PushBulletToken") pushBulletToken := viper.GetString("notifications.PushBulletToken")
//Rate Limiters //Rate Limiters
var uploadRateLimiter *rate.Limiter //var uploadRateLimiter *rate.Limiter
var downloadRateLimiter *rate.Limiter //var downloadRateLimiter *rate.Limiter
uploadRate := viper.GetString("serverConfig.UploadRateLimit") //uploadRate := viper.GetString("serverConfig.UploadRateLimit")
downloadRate := viper.GetString("serverConfig.DownloadRateLimit") //downloadRate := viper.GetString("serverConfig.DownloadRateLimit")
downloadRateLimiter, uploadRateLimiter = calculateRateLimiters(uploadRate, downloadRate) //downloadRateLimiter, uploadRateLimiter = calculateRateLimiters(uploadRate, downloadRate)
//Internals //Internals
dataDir := filepath.ToSlash(viper.GetString("torrentClientConfig.DownloadDir")) //Converting the string literal into a filepath 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 dataDirAbs, err := filepath.Abs(dataDir) //Converting to an absolute file path
@@ -220,8 +220,8 @@ func FullClientSettingsNew() FullClientSettings {
DHTConfig: dhtServerConfig, DHTConfig: dhtServerConfig,
NoUpload: noUpload, NoUpload: noUpload,
Seed: seed, Seed: seed,
UploadRateLimiter: uploadRateLimiter, //UploadRateLimiter: uploadRateLimiter,
DownloadRateLimiter: downloadRateLimiter, //DownloadRateLimiter: downloadRateLimiter,
PeerID: peerID, PeerID: peerID,
DisableUTP: disableUTP, DisableUTP: disableUTP,
DisableTCP: disableTCP, DisableTCP: disableTCP,