Commit Graph

11 Commits

Author SHA1 Message Date
Cassondra Foesch 5e8f9f4960 MarshalBinary now gives a 4-byte header for length, marshalPacket gives a two-stage write 2021-02-22 12:04:43 +00:00
Nicola Murino 1acb74f50a remove redundant types declaration 2020-07-25 10:17:41 +02:00
Nicola Murino b4ea0fd6f6 fix lint issues
These lint issues remain:

- request-errors.go, aliases for new error types
- request-attrs.go, UidGid. Changing this will break compatibility
2019-08-30 17:04:37 +02:00
John Eikenberry 7f7e75b40d ensure packet responses in same order as requests
Previous code used the request ids to do ordering. This worked until a
client came along that used un-ordered request ids. This reworks the
ordering to use an internal counter (per session) to order all packets
ensuring that responses are sent in the same order as the requests were
received.

Fixes #260
2018-08-01 13:18:57 -07:00
John Eikenberry fe27ce6214 Remove bad test
TestCloseOutOfOrder was supposed to test handling the case where the
client sends a write packet after the close packet for that file. It did
this poorly and the test is unneeded as what should happen is an error,
and this is what does happen. The RFC specifies that once the close
packet is sent, that's it and so it should be up to the client to
properly finish writing before closing.
2018-03-03 18:32:05 -08:00
John Eikenberry c325f9a7fe nicer debugging output for a few packet types 2017-07-19 19:25:49 -07:00
John Eikenberry e97b9a47e1 avoid data race in worker creation
There is a data race with the waitgroup (wg) object used to synchronize
the workers with the server exit. The workers called wg.Add()
asynchronously and it was possible for the Wait() to get hit before any
of the Add() calls were made in certain conditions. I only ever saw this
sporatically in the travis tests.

This fixes it by making the wg.Add() calls synchronous.
2017-07-03 17:53:55 -07:00
John Eikenberry 5024cb048c Move packer ordering code into packet-manager
The worker/packet mangement code needs to be in the packet manager so
the request-server can utilize it as well. This also improves the
encapsulation of the method as it relied on internal data that should be
better isolated inside the file/struct.
2017-04-23 13:47:05 -07:00
John Eikenberry 447b7fabc1 small naming and output tweaks for tests 2017-04-23 11:32:22 -07:00
John Eikenberry a91edeefac incoming out of order packet manager test 2017-04-05 14:38:13 -07:00
John Eikenberry ded0784f45 code that manages incoming/outgoing packet order
Makes sure that outgoing packets order matches incoming packets order.
This is not required by spec but some clients seem to require it (eg.
winscp).
2017-03-23 16:15:04 -07:00