Commit Graph

1096 Commits

Author SHA1 Message Date
Tyler Treat
b95dd5dfd0 Add tests around config reload 2017-05-30 21:09:35 -05:00
Tyler Treat
9902c3da84 First pass at implementing config reload 2017-05-30 16:18:36 -05:00
Derek Collison
d6069447d2 Merge pull request #498 from nats-io/stop_http_server_on_shutdown
[FIXED] Ensure Shutdown() always stops http server
2017-05-25 19:38:21 -05:00
Ivan Kozlovic
773b25af85 [FIXED] Shutdown stops http server when started manually
In case one creates a server instance with New() and then starts
the http server manually (s.StartHTTPMonitoring()), calling
s.Shutdown() would not stop the http server because Shutdown()
would return without doing anything if `running` was not true.
This boolean was set to true only in `s.Start()`.

Also added StartMonitoring() to perform the options check and
selectively start http or https server to replace individual calls.
This is useful for NATS Streaming server that will now be able
to call s.StartMonitoring() without having to duplicate code
about options checks and http server code.

This is related to PR #481
2017-05-25 17:01:35 -06:00
Derek Collison
1acdd2379c Merge pull request #497 from nats-io/fix_specify_http_and_https_ports
[FIXED] Specifying HTTP and HTTPs ports produces unexpected behavior
2017-05-24 23:58:56 -05:00
Ivan Kozlovic
513c0a0971 [FIXED] Specifying HTTP and HTTPs ports produces unexpected behavior
The server will now print a Fatal error if user tries to configure
both HTTP and HTTPs ports.

Resolves #495
2017-05-24 13:06:04 -06:00
Ivan Kozlovic
4cef2dddd0 Merge pull request #492 from nats-io/fix_negative_offset_limit_panic
[FIXED] Check for negative Offset and/or Limit when processing Connz
2017-05-18 14:07:27 -06:00
Tyler Treat
0415221fe1 Merge pull request #493 from nats-io/auth_timeout_tls_fix
[FIXED] Authorization Timeout and TLS
2017-05-18 10:25:18 -05:00
Tyler Treat
fa50a2c145 [FIXED] Authorization Timeout and TLS
When TLS and authorization is enabled, the authorization timeout can
fire during the TLS handshake, causing the server to write the
authorization timeout error string into the client socket, injecting
what becomes bad data into the TLS handshake. This creates misleading
errors on the client such as tls: oversized record received with length
21024.

This moves the authorization timeout scheduling to after the TLS
handshake to avoid the race. This should be safe since TLS has its own
handshake timeout. Added a unit test that fails with the old behavior
and passes with the new. LMK if you can think of a better way to test
this.

Fixes #432
2017-05-17 14:38:02 -05:00
Ivan Kozlovic
a87050c546 [FIXED] Check for negative Offset and/or Limit when processing Connz
Ensure that if the offset is negative, it is set to 0. If the limit
is negative, it is set to the default value.

Resolves #491
2017-05-17 12:05:54 -06:00
Derek Collison
01d2f1d12c Merge pull request #478 from miraclesu/improve_route_sid_parse
[IMPROVED] Route sid parse performance
2017-05-09 08:55:02 -07:00
miraclesu
26ef3f8a70 Revise queue msg action
We think it marks a queue subscription via QRSID prefix.
2017-05-09 16:16:15 +08:00
miraclesu
b570f8de9b Add test for invalid queue sid 2017-05-09 16:16:15 +08:00
miraclesu
29d1573124 [IMPROVED] Route sid parse performance 2017-05-09 16:16:15 +08:00
Derek Collison
6a12c218cd Merge pull request #488 from nats-io/change_write_deadline_config_type
Changed write_deadline configuration type
2017-05-06 14:18:29 -07:00
Ivan Kozlovic
3b6dc5eb2f Changed write_deadline configuration type
Changing from being the number of seconds to a time.Duration.
For backward compatibility, the configuration with the number
of seconds is still accepted but an error message is printed
asking the user to convert to duration.

Resolves #487
2017-05-06 14:20:01 -06:00
Derek Collison
11d3eedda7 Merge pull request #481 from nats-io/expose_monitor_handler
[ADDED] Ability to get the server's HTTP Handler
2017-04-30 11:58:27 -07:00
Derek Collison
0635937a81 Merge pull request #482 from ericpromislow/master
Issue 477: Improve handling of escaped substrings
2017-04-30 11:52:04 -07:00
Eric Promislow
bcf8b7532b [477] - Bring up coverage. 2017-04-28 13:33:35 -07:00
Eric Promislow
122b697e41 Issue 477: Improve handling of escaped substrings
This involves evaluating and interpolating \-escaped sequences
in double-quoted and undelimited strings.

Added tests on various edge-conditions, as well as ruling out bare
strings like '\true' as a bool.
2017-04-27 18:04:47 -07:00
Ivan Kozlovic
09f4b85a66 [ADDED] Ability to get the server's HTTP Handler
This will allow applications (for instance NATS Streaming Server)
to add new endpoints to the NATS http server.

Resolves #480
2017-04-27 16:37:01 -06:00
Derek Collison
a94b5e0f4c Merge pull request #479 from nats-io/fix_script_code_cov
Fix code coverage script (remove auth package that no longer exists)
2017-04-27 15:05:34 -07:00
Ivan Kozlovic
aac1e74eb8 Fix code coverage script (remove auth package that no longer exists) 2017-04-27 09:19:01 -06:00
Derek Collison
55404c70b0 Merge pull request #475 from nats-io/updates
Fixes for staticcheck tests, added misspell check and fixes.
2017-04-21 09:37:04 -07:00
Derek Collison
f7ba3d175e Correct invocation of misspell with fixes 2017-04-21 09:21:33 -07:00
Derek Collison
ddd1b472e2 Removed need for ignore check on staticcheck, added misspell check 2017-04-21 09:11:28 -07:00
Derek Collison
345b463cee Merge pull request #474 from nats-io/auth_cleanup
Authorization cleanup
2017-04-20 19:00:05 -07:00
Derek Collison
acb740dbe9 Use checkClusterFormed 2017-04-20 18:34:08 -07:00
Derek Collison
0fa0003c9e Fixes for routes test with bcrypt and auth 2017-04-20 16:55:44 -07:00
Derek Collison
45d523e800 Fixups for auth always being checked now 2017-04-20 13:26:59 -07:00
Derek Collison
eae0834669 lower bcrypt costs for race tests, raise timeouts 2017-04-20 13:20:45 -07:00
Derek Collison
76de921f65 Cleanup for Auth 2017-04-20 12:41:48 -07:00
Derek Collison
e35c4204fc Merge pull request #471 from nats-io/fix_issue_470
[FIXED] Release on linux amd64 is the only one dynamically linked
2017-04-07 12:01:35 -07:00
Ivan Kozlovic
67a4a37616 [FIXED] Release on linux amd64 is the only one dynamically linked
We are using the tool from https://github.com/mitchellh/gox
for cross compilation. When we issue a new release, we create a
tag and trigger Travis build which will then invoke the script and
upload the files to GH.

We were affected by https://github.com/mitchellh/gox/issues/55

Invoking the script on a Linux amd64 would produce this:

file pkg/gnatsd-linux-amd64/gnatsd
pkg/gnatsd-linux-amd64/gnatsd: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

With the fix, you'll get this:

file pkg/gnatsd-linux-amd64/gnatsd
pkg/gnatsd-linux-amd64/gnatsd: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), statically linked, stripped

Resolves #470
2017-04-07 12:51:59 -06:00
Derek Collison
64dcdd6a7e Merge pull request #465 from nats-io/add_token_config_support
[ADDED] Support for token in configuration file
2017-03-30 11:22:52 -07:00
Ivan Kozlovic
0cf8455a3a [ADDED] Support for token in configuration file
So far, it was only possible to use token from the command line.

Resolves #464
2017-03-30 11:23:07 -06:00
Derek Collison
91f4997795 Merge pull request #461 from nats-io/improve_code_coverage
Increase code coverage
2017-03-24 14:19:06 -07:00
Ivan Kozlovic
474cacad90 Increase code coverage
- Two files were showing poor code coverage affecting the overall
total.
- Fix to a route test that would fail on Windows.

Resolves #460
2017-03-24 11:58:58 -06:00
Derek Collison
b11ba5b118 Merge pull request #456 from wallyqs/gometalinter-checks
Fixes to a couple of `gometalinter` checks
2017-03-24 09:35:09 -07:00
Derek Collison
e1abaa5152 Merge pull request #459 from nats-io/fix_ping_to_tls_conn
[FIXED] Server not sending PINGs to TLS connections (clients or routes)
2017-03-24 09:30:47 -07:00
Ivan Kozlovic
a0245fc0c8 [FIXED] Server not sending PINGs to TSL connections (clients or routes)
- Removed unnecessary cast check to (*net.TCPConn). When the timer
fires, the connection is already established. Replaced with check
that connection has not been closed.
- Add PING test that checks that pings are sent to TLS connections.
- Changed Go version to 1.7.5 in travis.
- Removed test package from code coverage.
2017-03-24 09:49:42 -06:00
Waldemar Quevedo
ed05c357fc Remove unused type 2017-03-23 20:41:47 -07:00
Waldemar Quevedo
8926fa0ff1 Fix unconvert checks in server 2017-03-23 20:41:38 -07:00
Derek Collison
42a539f1c1 Merge pull request #454 from nats-io/add-spc-readme
Readme fixups
2017-03-22 22:32:26 -07:00
Derek Collison
2e7682a43c Merge pull request #455 from nats-io/fix_gosimple_error
Fix gosimple report
2017-03-22 22:31:57 -07:00
Ivan Kozlovic
a804516540 Fix gosimple report 2017-03-22 22:52:33 -06:00
Waldemar Quevedo
19e6216cbc Remove -DV from non debugging sections in readme 2017-03-22 19:08:37 -07:00
Waldemar Quevedo
a4fc1b648b Fixups to readme
Add missing space before title
2017-03-22 16:54:18 -07:00
Larry McQueary
902fb62166 Add ROADMAP.md (#448)
* Add initial ROADMAP.md
2017-03-10 13:25:36 -07:00
Peter Miron
4fa3b94645 Merge pull request #445 from nats-io/fix-monitoring-data-races
Use atomic.Load to access fields used in /varz and /subsz requests.
2017-03-03 14:44:28 -05:00