unclejack
62d5779aab
server_standalone: handle readonly properly
...
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-15 12:45:09 -07:00
John Eikenberry
8f9da7f630
quick fix to get benchmarks running
...
benchmarks were broken due to double closing of a channel in some tests.
I just commented out the problematic closes which probably means it's
leaking in the tests but at least they run now. Should probably try to
figure out what happened here at some point.
2017-03-14 12:27:51 -07:00
John Eikenberry
7aa3e48656
Have example sftp servers handle session EOF
...
As the EOF is expected when the client quits the session, have the
example servers handle it more gracefully so it is less confusing.
Fixes #169
2017-03-07 12:29:34 -08:00
John Eikenberry
b5277106cc
users in example servers should be the same
2017-03-07 12:28:52 -08:00
John Eikenberry
1077779d44
Revert "rename files with OS specific request test code"
...
Tests pass but doesn't build. :P
Need to figure out better way to organize this code.
This reverts commit 322a18e28b
.
2017-03-01 20:54:40 -08:00
George Xie
725c6ac61d
make path more Unix like on windows servers
2017-03-01 20:04:44 -08:00
John Eikenberry
322a18e28b
rename files with OS specific request test code
...
Added _test so they will only be compiled as part of the tests.
2017-03-01 19:53:59 -08:00
John Eikenberry
81c5ef6a75
rework fileinfo.Sys() output test for windows
...
split out the unix specific test code
2017-03-01 19:51:32 -08:00
John Eikenberry
f025fae65c
rework build tags for unix request test support code
2017-03-01 19:50:37 -08:00
John Eikenberry
c690dc3a0d
mv windows only code into windows only file
...
related to issue #160
2017-03-01 11:22:04 -08:00
John Eikenberry
1189af5787
missed commit in fix for #157
...
Adding the change to the fakeFileInfoSys() on windows to return the
windows type.
2017-02-28 11:56:06 -08:00
unclejack
94df0a367c
client,packet: remove redundant select & return
...
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-02-25 12:56:13 -08:00
John Eikenberry
e1c86753b9
OS specific syscall.Stat_t use into separate file
...
The use of Stat_t in request-example.go is unix specific and broke the
Windows OS builds. This is the minimal change to fix that.
This fixes #157 .
2017-02-24 20:06:51 -08:00
John Eikenberry
2eb63db49d
travis limited to current, previous stable and tip
...
This closes #161
2017-02-24 16:55:41 -08:00
John Eikenberry
14edf2c3f1
Merge pull request #130 from eikenb/request
...
Request based server.
2017-02-18 18:33:50 -08:00
John Eikenberry
a4eb07c029
NewRequest() now takes method as first param
2017-02-18 18:20:37 -08:00
John Eikenberry
044c5f4c92
make linter happy with NewRequest comment
2017-02-18 18:20:37 -08:00
John Eikenberry
5d2bc88197
use modtime field instead of time.Now()
2017-02-18 18:20:37 -08:00
John Eikenberry
df02b6e10d
make NewRequest public
2017-02-18 18:20:37 -08:00
John Eikenberry
7e76fd5451
close reader/writer when deleting request
2017-02-18 18:20:37 -08:00
John Eikenberry
352ba90280
use proper newRequest in test
2017-02-18 18:20:37 -08:00
John Eikenberry
016dabfa49
golint and go vet fixes
2017-02-18 18:20:37 -08:00
John Eikenberry
117dcd5916
refactor request setup into init and update
...
More understandable and adds additional type safety.
2017-02-18 18:20:37 -08:00
John Eikenberry
ce4586e8a5
convert request to be pass by value
...
Encapsulate stateful data into sub-structures with pointer references
from the Request structure. This allows me to pass by value in most
cases to keep non-stateful (write once) data data race free and tightly
controlling access to stateful data to ease locking.
2017-02-18 18:20:37 -08:00
John Eikenberry
889f6b990a
getRequest should use an RLock
2017-02-18 18:20:37 -08:00
John Eikenberry
887fd76631
remove old code
2017-02-18 18:20:37 -08:00
John Eikenberry
f436ee1e89
change package path back to original again
2017-02-18 18:20:37 -08:00
John Eikenberry
8cd6e6229d
add lock to file access
2017-02-18 18:20:37 -08:00
John Eikenberry
94ae9c6822
fix issue with out-of-order packets
2017-02-18 18:20:37 -08:00
John Eikenberry
99921c4e1d
add delay to writes based on length
...
To mimic write delays server side and introduce ordering errors.
2017-02-18 18:20:37 -08:00
John Eikenberry
4f479d7876
tests use unix domain sockets instead of io.Pipe
...
Needed to be able to test out of order/synchronization issues which
io.Pipe wouldn't allow. So changed server tests to use unix sockets.
2017-02-18 18:20:37 -08:00
John Eikenberry
f4432147d1
fix issue with leaking requests in handle cache
2017-02-18 18:20:37 -08:00
John Eikenberry
b6f2e2d29e
fix testing error
...
Mistakenly treated Readdir return value as list (ordered) instead of map
(unordered).
2017-02-18 18:20:37 -08:00
John Eikenberry
fb75f9f3f6
documentation tweak
2017-02-18 18:20:37 -08:00
John Eikenberry
52e562230f
fix import in example
2017-02-18 18:20:37 -08:00
John Eikenberry
23acc34b25
change back to using int as handle key
...
Was using a filename as a placeholder for something that would allow for
stateless servers but decided the amount of work wasn't worth it at this
point. So I went back to the auto-inc number as it doesn't have the size
issues (max handle length is 256).
2017-02-18 18:20:37 -08:00
John Eikenberry
f18f3a1b48
govet fixes
2017-02-18 18:20:37 -08:00
John Eikenberry
bf94760e22
golinter suggested name fix
2017-02-18 18:20:37 -08:00
John Eikenberry
9962211713
linter fixes
2017-02-18 18:20:37 -08:00
John Eikenberry
15d5c4cfef
gofmt hook having issues
2017-02-18 18:20:37 -08:00
John Eikenberry
7fe33ffe26
fixed formatting, added todo
2017-02-18 18:20:37 -08:00
John Eikenberry
abd44045b6
comment out tracing/debugging prints
2017-02-18 18:20:37 -08:00
John Eikenberry
fc6b6be2f4
initial stab at docs for request based server
2017-02-18 18:20:37 -08:00
John Eikenberry
96da577ac9
remove superfluous pflags field from request
...
Pflags specify file open operations which don't make sense for the
request based interface and they were never used.
2017-02-18 18:20:37 -08:00
John Eikenberry
56a1ff0d31
more tests
2017-02-18 18:20:37 -08:00
John Eikenberry
4974c76d49
remove some debug prints
2017-02-18 18:20:37 -08:00
John Eikenberry
b387807529
Revert "have Stat() mimic os.Stat()'s error"
...
did this to make sure client received file not found error. changed
things so previous os.ErrNotExist works.
2017-02-18 18:20:37 -08:00
John Eikenberry
69cd74c3d1
os.ErrorNotExist should convert to ssh_FX_NO_SUCH_FILE
2017-02-18 18:20:37 -08:00
John Eikenberry
34d67613fb
fix readlink name reference
2017-02-18 18:20:37 -08:00
John Eikenberry
80a7e6e68a
gofmt tweaks
2017-02-18 18:20:37 -08:00