Commit Graph

21 Commits

Author SHA1 Message Date
intractable
3aa835a6f2 Expose GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH channel arg (#35)
* Expose the max receive message length channel argument + unittest

* Remove unused `MultiWayIf` ext
2017-10-20 16:39:26 -05:00
intractable
918e3a8d5a Derive Read instance for StatusCode (#27) 2017-08-05 23:46:12 -05:00
Connor Clark
b550607f60 gRPC 1.2.0 compatibility (#12)
* update for reorganized headers in gRPC v1.1: https://github.com/grpc/grpc/pull/7559

* update nix files

* rename all gpr_slice to grpc_slice since we can't be backwards compatible anyway

* use gRPC 1.1.4

* now compatible with gRPC 1.2.0

* use nixpkgs 17.03 to get protobuf3_2, newer proto3-* deps, fix some warnings

* another warning
2017-04-14 19:28:01 -07:00
intractable
5caae587e5 Remove a bunch of compilation warnings. (#9)
* Remove a bunch of compilation warnings

* Fix typo in `cabal configure` invocation
2017-03-16 12:42:51 -05:00
Connor Clark
3366dde7ab Connor/security (#68)
* begin security bindings

* secure channel creation

* SSL credentials support

* add client-side ssl support

* ssl test

* read file before passing to channel credentials, free credentials when done creating

* use localhost key/cert for test

* WIP sketch of callbacks for metadata plugins

* conversion from Haskell auth processor to C

* add test for custom server metadata auth processor

* wip auth failure test

* rebase tweak

* working test of custom auth metadata server processor

* improve security docs, clean up

* add unsafe layer client-side auth metadata plugin functionality

* add client config option for custom auth metadata

* WIP client-side metadata auth plugin. Crashing when calling C callback.

* get initial version of client-side metadata plugins working

* replace String with ByteString in a few places, add function for getting AuthProperty

* AuthContext utilities and more documentation

* end-to-end test of client and server auth plugins

* remove redundant tests

* function for parents in unary calls, add deactivated failing test for auth metadata propagation from parent to child

* some cleanup

* tweaks

* more tweaks

* remove unused file

* docs tweak

* consolidate exports

* update protobuf-wire commit
2016-08-17 09:55:06 -07:00
Connor Clark
b9b548d8eb Fix metadata marshalling bug, add QuickCheck properties (#63)
* make metadatamap a newtype of multimap

* update tests for new MetadataMap

* remove multimap dependency, reproduce needed functionality instead

* add repeated key to payload test

* QuickCheck properties for C bindings, fix bug in metadata FFI wrappers

* add quickcheck bound

* fix merge
2016-08-17 09:54:46 -07:00
Connor Clark
d66a4f98b3 Update to gRPC 0.15 (#61)
* update channel arg names, add compression level arg support, add compression level arg test

* switch to temp test demonstrating bug in grpc 0.15.0

* memset op array to 0

* switch examples back

* Switch to newer `grpc` and enable tests in `release.nix`

* Split out `simple-server` test into separate shell script

* Fix bash invocation

* Add intermediate `./default-tests.nix` build

* Add `tests.patch` to version control

* Split `python` command into separate script

* Provide `python` via `nix`
2016-08-05 09:29:20 -07:00
Connor Clark
f8bbe3abd2 Connor/metadata improvements (#52)
* make metadatamap a newtype of multimap

* update tests for new MetadataMap

* remove multimap dependency, reproduce needed functionality instead

* add repeated key to payload test

* bump LTS version for sorted-list, use SortedList for MetadataMap

* remove unneeded conversion

* MetadataMap documentation

* minor fixes
2016-08-01 12:38:35 -07:00
Connor Clark
ab4dea344d Server performance and stability improvements (#48)
* concurrent echo client for stress testing

* update examples for benchmarking, tweak cabal file

* mark frequently-used call as unsafe for performance boost

* add unsafe annotation to non-blocking C calls on critical path

* more unsafe annotations -- server performance almost doubled now

* one CQ for all call ops

* unsafe annotation on start_batch

* wait for all client threads, replace error with fail

* add -O2
2016-07-21 12:55:16 -07:00
Connor Clark
e4a28e9e4b High-level unregistered concurrent interface (#41)
* remove parent ptr from unregistered calls -- unneeded

* begin unregistered high level server loop

* undo changes to highlevel server, add mkConfig for unregistered server

* move call CQ create/destroy into call create/destroy

* async normal call function

* preliminary unregistered server loop for non-streaming methods

* working unregistered highlevel example

* loop counters for benchmarking

* changes for benchmarking, add ruby example server for benchmarking

* async version of withCall, refactor unregistered server loop to handle all method types

* unregistered client streaming

* add remaining streaming modes

* unregistered server streaming test

* unregistered streaming tests

* add error logging

* fix bug in add example

* remove old TODOs

* fix bug: don't assume slices are null-terminated

* add TODO re: unregistered client streaming functions
2016-07-14 09:53:28 -07:00
Connor Clark
b7a02a63e7 Fix Linux tests (#38)
* fix debug mode

* handle deadline differently depending on OS

* remove unneeded tests
2016-07-11 11:20:13 -07:00
Connor Clark
accc8b8573 fix all warnings (#35) 2016-06-23 16:35:11 -05:00
Connor Clark
a530faf912 Channel options: user agents and compression (#32)
* get_peer: fix todo

* add documentation for server registered call function

* test roundtrip conversion of larger bytestrings (32 mb)

* Add channel args interface: currently supports user agents and compression.

* fix build failure after stack clean
2016-06-22 13:07:38 -07:00
Connor Clark
f6e244912a Server call deadlines (#28)
* functions for getting call deadline, checking for expiry

* server registered calls: populate deadline correctly, isExpired predicate

* update debugServerCall
2016-06-16 14:45:55 -05:00
Connor Clark
5ba5c8a42a fix wrong endpoint test, add test, tweak handler types (#29)
* fix testWrongEndpoint

* test that unregistered requests are ignored by request_registered_call

* handler returns status code, drop Grpc prefix from status codes
2016-06-16 10:23:54 -05:00
Connor Clark
4ce7497a33 Fix test failure: remove timeout from runOps, make timeout optional in pluck. (#27) 2016-06-15 10:30:17 -07:00
Connor Clark
58661adf8b Add tests, fix some Valgrind errors (#25)
* add tests for server misbehavior

* fix leaks in pluck and next

* fix deadline leak

* fix slice leak

* always free metadata

* add full TODO in case we get rid of unregistered code

* shorter deadline to make test faster

* update for grpc 0.14.0

* fix another valgrind complaint
2016-06-13 09:25:32 -05:00
Connor Clark
9ffdec4c56 Add ability to send metadata for server registered calls (#15)
* projections from CallDetails

* refactor Call, refactor clientRegisteredRequest, handle null error

* split ServerCall into separate reg/unreg types

* pass method name to unreg call handler, finish destroyServerUnregCall

* function for checking client connection

* test metadata transmission

* send initial metadata for registered calls

* projections from CallDetails

* refactor Call, refactor clientRegisteredRequest, handle null error

* split ServerCall into separate reg/unreg types

* pass method name to unreg call handler, finish destroyServerUnregCall

* function for checking client connection

* test metadata transmission

* send initial metadata for registered calls
2016-06-02 08:55:29 -07:00
Connor Clark
3746383976 Fix payload test bugs (#8)
* fix memory mgmt bug in status details strings

* remove flags

* allow server to specify status details
2016-05-25 13:11:30 -07:00
Connor Clark
2ad0465df6 Begin safe low-level Haskell layer (#7)
* grpc_server_request_call

* basic slice functionality

* rename function to emphasize side effects

* add docs

* ByteBuffer function bindings

* replace unsafeCoerce with more specific function, add docs, tests.

* add newtypes for Tag and Reserved void pointers

* manually fix request_registered_call binding

* use nocode keyword to fix Ptr () problems

* decouple copying Slice from freeing slice

* Add time ops

* remove nocode decls

* Start Op module, fix c2hs preprocessing order

* metadata manipulation operations

* metadata free function, test

* helper functions for constructing ops of each type

* bindings for op creation functions

* finish up Op creation functions, implement Op destruction, add docs.

* tweak documentation

* rework Op creation functions to work with an array of ops, for ease of use with grpc_call_start_batch

* forgot to change return types

* wrap hook lines, fix types to op creation functions

* implement part of the payload test

* hideous, but working, end to end test

* bindings for connectivity state checks, split test into two threads

* various cleanup

* rename Core to Unsafe for emphasis, clean up tests more

* begin safe low-level facilities

* begin completion queue and server stuff

* Finish server start/stop, cq start/stop, add tests

* facilities for safely executing op batches

* reorganize LowLevel modules, begin explicit export list

* client functionality, stub payload test, various refactors

* tweak cabal file, add test

* add more documentation

* doc tweaks

* begin refactor to improve CompletionQueue safety

* export only thread-safe CQ functions, add registered call creation and other CQ utilities

* begin refactor to use GRPCIO monad, fix missing push semaphore, fix mem leak in server calls

* switch to explicit Either where needed

* add crashing tests, continue fleshing out serverHandleNormalCall

* fix haddock error, finish first draft of request handling function

* reduce GHC warnings

* non-registered client request helpers

* initial request/response test working

* don't pass tags around; generate where needed

* server call bracket functions

* correct order of semaphore acquisition and shutdown check

* simple debug flag logging, simplify Call type

* fix various registered method issues (but still not working)

* cleanup

* delete old code

* remove old todo

* use MetadataMap synonym pervasively

* more comments

* update TODOs

* tweak safety caveat

* docs tweaks

* improve haddocks

* add casts to eliminate clang warnings, remove unused function

* update options to eliminate cabal warnings

* remove outdated todo

* remove unneeded exports from CompletionQueue

* rename to GRPCIOCallError, re-add create/shutdown exports (needed for Server module)

* newtypes for hosts and method names

* more newtypes

* more debug logging

* Fix flag name collision

* instrument uses of free

* more debug

* switch to STM for completion queue stuff

* reduce warnings

* more debugging, create/destroy call tests

* refactor, fix failure cleanup for server call creation. More tests passing.

* formatting tweaks
2016-05-24 13:34:50 -07:00
Connor Clark
90a527f4e0 Finish up bindings to most core gRPC functions (#1)
* grpc_server_request_call

* basic slice functionality

* rename function to emphasize side effects

* add docs

* ByteBuffer function bindings

* replace unsafeCoerce with more specific function, add docs, tests.

* add newtypes for Tag and Reserved void pointers

* manually fix request_registered_call binding

* use nocode keyword to fix Ptr () problems

* decouple copying Slice from freeing slice

* Add time ops

* remove nocode decls

* Start Op module, fix c2hs preprocessing order

* metadata manipulation operations

* metadata free function, test

* helper functions for constructing ops of each type

* bindings for op creation functions

* finish up Op creation functions, implement Op destruction, add docs.

* tweak documentation

* rework Op creation functions to work with an array of ops, for ease of use with grpc_call_start_batch

* forgot to change return types

* wrap hook lines, fix types to op creation functions

* implement part of the payload test

* hideous, but working, end to end test

* bindings for connectivity state checks, split test into two threads

* various cleanup

* rename Core to Unsafe for emphasis, clean up tests more

* add requested comment

* remove slice_unref binding, use sliceFree when converting buffer to bytestring
2016-05-13 09:12:37 -07:00