Update to the latest WITs and adapter.#543
Conversation
4528908 to
24b0d26
Compare
Changes:
- `inspect-options` moved from `http-req` to `security`.
- Some error types are renamed:
- `bad-handle` is now `auxiliary-error`
- `optional-none` is now `cannot-read`
- `log.write` is now infallible.
- `cache.replace-entry` is now a separate resource rather than a
type alias.
24b0d26 to
7be2e04
Compare
| Err(e) => e.into(), | ||
| endpoint_handle.write(msg); | ||
| unsafe { | ||
| *main_ptr!(nwritten_out) = msg_len; |
There was a problem hiding this comment.
In the error case, nwritten_out can be less than msg_len?
There was a problem hiding this comment.
The WIT interface also changes log.write to be infallible, so there is no error case.
There was a problem hiding this comment.
Ah, okay. This is only returns to witx. The final wit doesn't return nwritten to the user. All good.
| // rather than bubbling it up through the log API. | ||
| match endpoint.write_entry(&msg) { | ||
| Ok(()) => {} | ||
| Err(err) => tracing::error!("Error writing log message: {:?}", err), |
There was a problem hiding this comment.
If there is a buffer overflow, is it possible that we didn't write the whole msg?
There was a problem hiding this comment.
It's possible that we didn't write all the bytes to the ultimate destination, but applications aren't in a position to do anything useful about it. So instead, we log it, using tracing::error, where the error will hopefully be seen by the person running viceroy, who is in a better position to do something about it.
Changes:
inspect-optionsmoved fromhttp-reqtosecurity.bad-handleis nowauxiliary-erroroptional-noneis nowcannot-readlog.writeis now infallible.cache.replace-entryis now a separate resource rather than a type alias.