Commit Graph

11610 Commits

Author SHA1 Message Date
Jōshin
fcd2604b44
khan: code review input
Add a pail callback for poke vailure. Add some comments. Switch from
sync to async newt reads.
2021-10-26 20:15:48 +00:00
Jōshin
f47c00abbc
newt: decode no longer crashes on bad length
Replaced the assert with a return of c3n, which the call site responds
to by logging the message, calling bal_f, and freeing the buffer.
2021-10-26 20:14:17 +00:00
Jōshin
0237415d04
khan: bail properly
Fixed a stupid bug in the handle-other case (left an ampersand when I
stripped out the ->mor_u). void* considered awesome.
2021-10-23 06:16:46 +00:00
Jōshin
cf8b54dd20
khan: bail on unknown effects
Also move sev_l into kick, and do some whitespace cleanup.
2021-10-22 21:53:32 +00:00
Jōshin
2e12d3792e
khan: special case removing chan at list head 2021-10-22 21:45:11 +00:00
Jōshin
ed7c33e070
khan: store connection number on u3_shan
Prevents us resetting connection count to 1 if all connections
disconnect.
2021-10-22 21:39:18 +00:00
Jōshin
a12970a77b
khan: remove %set-config stub 2021-10-22 20:50:08 +00:00
Jōshin
c198c19902
khan: u3z in _khan_ef_handle 2021-10-22 17:57:42 +00:00
Jōshin
b26a1ead01
khan: comment 2021-10-22 17:47:25 +00:00
Jōshin
65c25995ad
khan: send errors over socket
Also:

- More precise TODOs.

- Send %cue-none rather than %'bad jar' on cue failure.
2021-10-22 17:45:02 +00:00
Jōshin
2d03b40b4c
khan: no we don't 2021-10-22 05:29:08 +00:00
Jōshin
0107c83252
khan: full round trip achieved
We now take %avow effects and send them back over the wire as a jammed
noun.

At this point the basic driver functionality is in place and should be
working. Still needed to finish this off are:

- Error-handling in the case of a malformed jammed noun.

- Handling requests to close the connection.

- Code review.
2021-10-22 05:27:45 +00:00
Jōshin
21b60615d1 khan: skeleton for effect parsing
This is a direct port from http.c, including _reck_lily, which should
probably get factored out.

We parse sequence numbers even though they aren't yet stored on the C
side, just in case we wind up needing them later.

Still not actually handling effects.
2021-10-21 07:11:26 +00:00
Jōshin
64730a3b30 khan: close stream on EOF
Also removes debug print in _khan_moor_poke.
2021-10-21 07:11:26 +00:00
Jōshin
c10e2319be khan: log on unlink on exit 2021-10-21 07:11:26 +00:00
Jōshin
a48e627951 khan: constant first 2021-10-21 07:11:26 +00:00
Jōshin
b3e71b1e55 khan: send as %fyrd
With this, you can now send a jammed `[%mas ~]` with length over the
socket, and %khan will recognize it as a `%fyrd` and print out
`[%todo %mas ~]`.
2021-10-21 07:11:26 +00:00
Jōshin
1dab3898f1 khan: sending requests to vane
The vane is of course bailing all over the place, and we probably need
to handle errors better (and maybe also count task numbers / introduce
the concept of a 'request' at C level?), but we're moving...
2021-10-21 07:11:26 +00:00
Jōshin
f51137d663 khan: cue, remove obsolete read_cb 2021-10-21 07:11:26 +00:00
Jōshin
f1fee9e1d0 khan: remove ioctl include 2021-10-21 07:11:26 +00:00
Jōshin
eab4ed9477 khan: do not unlink / close unless live 2021-10-21 07:11:26 +00:00
Jōshin
77db31f187 khan: use u3_moor 2021-10-21 07:11:26 +00:00
Jōshin
b3f12cf9ba khan: minor formatting cleanup 2021-10-21 07:11:26 +00:00
Jōshin
33d269f493 khan: wip use u3_moat instead of raw uv_pipe_t
This may be scrapped or redone as I grok newt.c. All that this
accomplishes is putting the different data structure in place, declaring
intent to use.
2021-10-21 07:11:26 +00:00
Jōshin
ba76bcbc32 khan: close on uv_read_start failure
Also do some minor cleanup.
2021-10-21 07:11:26 +00:00
Jōshin
e56ab9da1d khan: refactor, fix memory issues
Goes ahead and makes the socket its own separate data structure linked
from u3_khan. Makes it easier to get proper links to everything without
fiddling with offsetof. Seems to resolve the memory corruption issues we
were seeing.

Also make an effort to shutdown / close resources on exit.
2021-10-21 07:11:26 +00:00
Jōshin
dd5b833b2d khan: fix pointer reference
Using offsetof is very gross and probably suggests something is wrong
somewhere. Maybe we should store the server configuration on a separate
object from the khan configuration? But in the case of khan there isn't
really a concept of multiple servers...

N.B. We still have memory corruption.
2021-10-21 07:11:26 +00:00
Jōshin
005f80ae0d khan: wip driver implementation
Implements the connection callback, which accepts and opens up the read
end of the pipe, then just waits. Stores open connections on u3_khan.
Uses simple incrementing connection numbers.

I noticed in here that vere/newt.c seems to implement a protocol much
like the one we're looking for; may try to switch to using that more
explicitly.

Needs more well-thought-out error handling policy in connection
callback. What do we do -- bail? Deliver a non-fatal error and drop the
connection?
2021-10-21 07:11:26 +00:00
Jōshin
4d237ca65f khan: error handling
Ye olde C style nested gotos. Have not tested edge cases thoroughly yet;
should do prior to release.
2021-10-21 07:11:26 +00:00
Jōshin
296c8f0e94 khan: open socket on %born completion 2021-10-21 07:11:26 +00:00
Jōshin
1ac2a15201 khan: use u3_Host.dir_c consistently 2021-10-21 07:11:26 +00:00
Jōshin
0922e66111 khan: thinking intensifies 2021-10-21 07:11:26 +00:00
Jōshin
d0fd562102 khan: thoughts in conn_cb 2021-10-21 07:11:25 +00:00
Jōshin
f169e48cb3 khan: no uv_connect_t, spacing 2021-10-21 07:11:25 +00:00
Jōshin
368c09d86d khan: sequence number before socket open 2021-10-21 07:11:25 +00:00
Jōshin
9a9455d442 khan: TODO, init pipe after unlink 2021-10-21 07:11:25 +00:00
Jōshin
bcc97b728e khan: assert name 2021-10-21 07:11:25 +00:00
Jōshin
0fa6a70801 khan: unlink socket on close
Made URB_SOCK_PATH an array instead of pointer as well, to be able to
use sizeof.
2021-10-21 07:11:25 +00:00
Jōshin
c1f38c7397 http: check return of snprintf
Purely cautionary / defensive programming; no reason to think this would
have been a problem.
2021-10-21 07:11:25 +00:00
Jōshin
fc95d7ded7 khan: listening on socket 2021-10-21 07:11:25 +00:00
Jōshin
f2df8b83d5 khan: io driver skeleton 2021-10-21 07:11:25 +00:00
Jōshin
0102bb271f behn: comment spacing 2021-10-21 07:11:25 +00:00
Joe Bryan
94878e695e ur: fixes preorder handle destructor in jam handle destructor 2021-10-12 11:34:09 -04:00
Joe Bryan
9cb53597fb ur: fixes "stack" overflow in preorder traversal, simplifies "stack" 2021-10-12 11:33:12 -04:00
Joe Bryan
9a1b9b4450 Merge branch 'master' into release/next-vere
* master: (595 commits)
  grid: updating glob
  landscape: updating glob
  graph-store: clean up merge artefact
  interface: reduce %all-stats correctly
  docket: correctly en-vase a docket definition
  kiln: don't +mean the tang noun alongside the tang
  hood: scry for list of desks with empty desk name
  hood: remove needless weld
  hood: report %kids desk hash in +report-vats
  landscape: fix joining indicator in statusbar
  interface: reduce %saw-place correctly
  app-prefs: fixing logic around enabled
  pull-hook: add nice flag to kick poke
  graph-pull-hook: renegotiate subscriptions
  graph-store: Handle missing update-logs gracefully in scries
  arvo: update jamfiles
  landscape: correctly freeze graph-update-2
  jael: on rekey, update life if moon
  tmp/ jamfiles
  btc: updating glob
  ...
2021-10-05 11:33:08 -04:00
Hunter Miller
f5fc13706a grid: updating glob 2021-10-04 15:16:57 -05:00
Hunter Miller
3d8bd05499 landscape: updating glob 2021-10-04 15:12:15 -05:00
fang
ea6147bd66
graph-store: clean up merge artefact 2021-10-05 00:00:13 +04:00
fang
aa48973c6a
Merge branch 'release/next-userspace' 2021-10-04 23:45:45 +04:00
fang
0a847c11f2
Merge pull request #5281 from urbit/lf/landscape-fix
landscape: fix chats not bumping, hide spinner correctly
2021-10-04 21:25:29 +02:00