Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP communication #174

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jpeisenbarth
Copy link

@jpeisenbarth jpeisenbarth commented Apr 24, 2017

Hello,

the HTTP communication feature discussed in #165 has been added.

For now we can still use TCP or Unix sockets, it depends on the config file (replace tcp://127.0.0.1:3000 by https://127.0.0.1:3000 for example)

I hope this is OK but do not hesitate to tell me if there is something wrong with the code

EDIT : Oh yes I forgot to say that this needs the 1.8 version of Go. Prior to this they were no shutdown function for an HTTP server.

// Shutdown closes all of the server's connections and shuts down the server.
func (server *ConiksServer) Shutdown() error {
close(server.stop)
if server.httpServer != nil {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this scope to line 199 (https://github.com/coast-team/coniks-go/blob/92c82f41423983acc2e0d2e60fb0858527b5e6e2/keyserver/server.go#L199) as

go func() {
  <-server.stop
  // shutdown httpServer [...]
}()

and remove httpServer from ConiksServer?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is definitely a better solution !

go func() {
httpSrv.Serve(ln)
}()
go func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add server.waitStop.Add(1) before this routine and server.waitStop.Done() after httpSrv.Shutdown().

jpeisenbarth and others added 4 commits April 27, 2017 09:22
* Part of coniks-sys#151

* Add client-auditor messages

* Create audit log structure, query API finished

* Add/Update docs to include auditor, add ReqUnknownDirectory auditor error

* Use single generic verifySTRConsistency to be used by client and auditor

* Add tests for audit log, debug audit log

* Add assertions to validate auditor messages on client

* Add generic STR response handler

* # This is a combination of 2 commits.
# The first commit's message is:

Add TODO to move all generic STR auditing code to a separate module

# The 2nd commit message will be skipped:

#	Use single generic verifySTRConsistency to be used by client and auditor

* Fix documentation

* Use DirSTR instead of merkletree.SignedTreeRoot in auditlog

* Remove all references to auditor-directory communication, make auditor response message generic

* STRList -> STRHistoryRange

* Fail sooner in GetObservedSTRs

* Revert changes to protocol/str.go

* Always request epoch range in AuditingRequest, fix Insert() bug

* Index audit log by hash of directory's initial STR

* Insert latest STR into snapshot map right away

* Fix go vet error

* Change audit log index from byte array to string

* Add test case for getting an STR after an audit log update

* Refactor common functions

* Use slice for initial history inserted, remove IsKnownDirectory

* dirName --> addr, some documentation fixes

* Small fixes

* Revert "Change audit log index from byte array to string"

This reverts commit 7e54087.

Conflicts:
	protocol/auditlog.go

* More fixes for reverting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants