Skip to content

Commit

Permalink
file
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Arrow committed Apr 22, 2016
1 parent 0ffb341 commit ff56aea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion paradise/paradise.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type DefaultFileSystem struct {
}

func (dfs DefaultFileSystem) GetFiles() []string {
files := make([]string, 5)
files := make([]string, 6)

return files
}
Expand Down
2 changes: 1 addition & 1 deletion server/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (p *Paradise) HandleList() {
func (p *Paradise) dirList() ([]byte, error) {
var buf bytes.Buffer

files := []int{1, 2, 3, 4, 5} // change to real list of files
files := FileManager.GetFiles()
for _, _ = range files {

if false { // change to really test for isDir
Expand Down
18 changes: 9 additions & 9 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package server

import (
"bufio"
"fmt"
"io"
"net"
"strings"
"sync"
"time"
)
import "bufio"
import "fmt"
import "io"
import "net"
import "strings"
import "sync"
import "time"
import "github.com/andrewarrow/paradise_ftp/paradise"

var Settings ParadiseSettings
var CommandMap map[string]func(*Paradise)
var ConnectionMap map[string]*Paradise
var PassiveCount int
var UpSince int64
var FileManager *paradise.FileManager

type Paradise struct {
writer *bufio.Writer
Expand Down
4 changes: 2 additions & 2 deletions server/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ func genClientID() string {
b := make([]byte, 16)
random.Read(b)
random.Close()
return fmt.Sprintf("%x-%x-%x-%x-%x",
b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
}

func Start(fm *paradise.FileManager) {
fmt.Println("starting...")
FileManager = fm
url := fmt.Sprintf("localhost:%d", 2121) // change to 21 in production
var listener net.Listener
listener, err := net.Listen("tcp", url)
Expand Down

0 comments on commit ff56aea

Please sign in to comment.