Commit Graph

71 Commits

Author SHA1 Message Date
Derek Collison
dbde2479c2 Add in headers to consumer delivered messages
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-30 15:03:54 -07:00
Derek Collison
019c105ca7 Updates based on feedback, more tests, few bug fixes
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
f5ceab339a Server support for headers between routes
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
55c77d1e4e Added support for delivery of HMSG and support for older clients
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
d51566881e First pass at headers awareness for server
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:33:06 -07:00
Derek Collison
dd116fcfd4 JetStream first pass basics.
This is the first checkin for JetStream. Has some rudimentary basics working.

TODO
1. Push vs pull mode for observables. (work queues)
2. Disk/File store, memory only for now.
3. clustering code - design shaping up well.
4. Finalize account import semantics.
5. Lots of other little things.

Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:06:29 -07:00
Matthias Hanel
a57bfc4d56 Remove double trace on split buffer
The trace in question was not there prior to tracing change.
Fixes #1310, by removing it.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-13 21:06:30 -04:00
Matthias Hanel
6a1c3fc29b Moving inbound tracing to the caller (client.parse)
Tracing for outgoing operations is always done while
holding the client lock.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 17:31:18 -05:00
Matthias Hanel
f5bd07b36c [FIXED] trace/debug/sys_log reload will affect existing clients
Fixed #1296, by altering client state on reload

Detect a trace level change on reload and update all clients.
To avoid data races, read client.trace while holding the lock,
pass the value into functionis that trace while not holding the lock.
Delete unused client.debug.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 13:54:15 -05:00
Matthias Hanel
c18a5a2582 Fixing typos, copyright date and changed type in log.go/Error func
added comment and changed type Error(c,sc)

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-24 19:37:25 -05:00
Matthias Hanel
d1d34d2638 Suggestion to improve tracing in nats-server through wrapping errors
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-24 16:00:46 -05:00
Matthias Hanel
329cc7225b Use constant for error
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-02-18 10:54:12 -05:00
Ivan Kozlovic
53fd02919b Added split test buffer that shows the subject overwritte
With this test, and with previous cloneArg() code, the parsing
will cause subject to become "fff" because c.pa.subject points
to somewhere in the underlying buffer that is now overwritten
with the body payload. With proper cloneArg(), the c.pa.subject
(and other) point to the copy of argBuf.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-11-18 14:46:09 -07:00
Ivan Kozlovic
977c290bf2 [FIXED] Handling of split buffer for LEAF messages
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-11-18 11:55:18 -07:00
Derek Collison
52430c304a System level services for debugging.
This is the first pass at introducing exported services to the system account for generally debugging of blackbox systems.
The first service reports number of subscribers for a given subject. The payload of the request is the subject, and optional queue group, and can contain wildcards.

Signed-off-by: Derek Collison <derek@nats.io>
2019-09-17 09:37:35 -07:00
Ivan Kozlovic
97ee89cc67 Check inbound GW connection connected state in parser
If the first protocol for an inbound gateway connection is not
CONNECT, reject with auth violation.

Fixes #1006

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-22 12:31:16 -06:00
Derek Collison
bacb73a403 First pass at leaf nodes. Basic functionality working, including gateways.
What is not completed:
1. TLS
2. config to bind local account.
3. Info updates for solicitor to track topology changes like a client.
4. CONNECT sent after INFO for nonce authroization.
5. Authorization
6. Services and Streams tests.
7. config file parsing.

Signed-off-by: Derek Collison <derek@nats.io>
2019-03-25 08:54:47 -07:00
Neven Miculinic
5344e1384e Added parser type safety 2019-02-18 17:36:54 +01:00
Derek Collison
af78552549 Move ints to proper sizes for all
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-05 15:19:59 -08:00
Derek Collison
b8e7b9b68e Some Optimizations
1. Change outbound client structure to be smaller and more cache friendly.
2. Snapshot MaxControlLine into client structure (mcl) to avoid server opts lookup.

Signed-off-by: Derek Collison <derek@nats.io>
2019-02-04 17:07:49 -08:00
Derek Collison
934b28de1c Don't allow overruns for message payloads, fixes #884
Signed-off-by: Derek Collison <derek@nats.io>
2019-01-30 18:31:32 -08:00
Ivan Kozlovic
a23ef5b740 Switch to send-all-subs when number of RS- gets too big
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-03 13:15:11 -07:00
Derek Collison
574fd62e01 Allow servers to send and receive messages directly
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-29 12:15:08 -08:00
Ivan Kozlovic
52c724a83c Updates based on comments
- Solve RS+ with wildcards
- Solve issue with messages not send to remote gateways queue subs
  if there was a qsub on local server.
- Made rcache a perAccountCache since it is now used by routes and
  gateways
- Order outbound gateways only on RTT updates
- Print a server's gateway name on startup
- Augment/add some tests
- Update TLS handling: when connecting, use hostname for ServerName
  if url is not IP, otherwise use a hostname that we saved when
  parsing/adding URLs for the remote gateway.
- Send big buffer in chunks if needed.
- Add caching for qsubs match

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-11-27 19:39:41 -07:00
Ivan Kozlovic
10fd3ca0c6 Gateways [WIP]
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-11-27 19:00:03 -07:00
Derek Collison
a2e310ffc1 Vendor jwt, fixes for nkey, jwt changes
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-21 19:22:04 -08:00
Derek Collison
0ee714ce28 Add JWT support for users, accounts and import activations.
Add in trusted keys options and binary stamp
User JWT and Account fetch with AccountResolver
Account and User expiration
Account Imports/Exports w/ updates
Import activation expiration

Signed-off-by: Derek Collison <derek@nats.io>
2018-11-21 10:36:32 -08:00
Ivan Kozlovic
0c11279946 Fixed data race with client trace flag
This was introduced with ec3115ad21

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-11-07 16:33:30 -07:00
Derek Collison
57904107b2 Added L1 cache to routes
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-01 13:31:12 -07:00
Derek Collison
4058948185 Updates based on feedback
Signed-off-by: Derek Collison <derek@nats.io>
2018-10-29 13:51:21 -07:00
Derek Collison
ec3115ad21 Fix double trace
Signed-off-by: Derek Collison <derek@nats.io>
2018-10-25 09:30:13 -07:00
Derek Collison
47963303f8 First pass at new cluster design
Signed-off-by: Derek Collison <derek@nats.io>
2018-10-24 21:29:29 -07:00
Derek Collison
f6cb706c68 First pass req/reply across accounts
Signed-off-by: Derek Collison <derek@nats.io>
2018-09-29 13:04:19 +02:00
Derek Collison
ec8e2636de Track closed connections and reason for closing
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-25 17:56:07 -07:00
Derek Collison
c218d9b0ec Fix for #278
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-20 22:41:05 -07:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Tyler Treat
648b7367c0 Fix data race 2017-06-07 17:40:17 -05:00
Tyler Treat
9902c3da84 First pass at implementing config reload 2017-05-30 16:18:36 -05:00
Ivan Kozlovic
c6d37ecf8f [IMPROVED] Route performance for larger messages 2016-08-01 19:01:34 -06:00
Derek Collison
d31d9f41c7 Check for proper dereference 2016-07-11 12:16:05 -07:00
Derek Collison
e3b5713ab9 Check for control line violations and memory attacks 2016-07-11 12:03:49 -07:00
Ivan Kozlovic
a8ff707aff Fix INFO_ARG parsing
In split buffer conditions, a buffer is used to accumulate bytes.
After processing, this buffer needs to be reset.

Resolves #270
2016-05-11 15:51:29 -06:00
Derek Collison
768f23b5b4 dynamic read buffers 2016-04-03 14:30:17 -07:00
Colin Sullivan
2baac47820 Address issues found by golint.
* No functional changes
* Did not address the ALL_CAPS issues
* Did not modify public APIs and field names.
2016-03-15 15:21:13 -06:00
Waldemar Quevedo
86824713c6 Add UNSUB_SPC parser state 2016-02-02 21:39:30 -08:00
Waldemar Quevedo
c1ebd4efd8 Fix and tests for proto snippet function 2015-12-06 22:05:35 -08:00
Waldemar Quevedo
498df401af Return empty string when can't take slice for snippet from buffer 2015-11-29 20:47:47 -08:00
Waldemar Quevedo
18f932620f Avoid cap out of range error when handling split buffer 2015-11-29 11:11:17 -08:00
Derek Collison
8fb92dc7e2 Fix parser bug around MSG protocol.
Make sure we do the right thing when no args are presented for an MSG, e.g. MSG <spc>.
Also do not parse at all of this is a client, only valid for routes.
2015-08-26 23:04:10 -07:00
Derek Collison
90d1d6d572 Much improved large message performance 2015-06-25 13:51:53 -07:00