-
Notifications
You must be signed in to change notification settings - Fork 41
Update to the latest WITs and adapter. #543
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the error case, nwritten_out can be less than msg_len?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WIT interface also changes log.write to be infallible, so there is no error case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a buffer overflow, is it possible that we didn't write the whole msg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.