Skip to content

Commit

Permalink
release: airup v0.10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sisungo committed Jun 29, 2024
1 parent d9038a5 commit 9e8a9d1
Show file tree
Hide file tree
Showing 41 changed files with 79 additions and 461 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Changes in v0.10.5:
* cli: refactor `debug` subcommand and removed unnecessary interfaces
* rpc: reset request size limit \(2M to 128K\)
* developer: remove old airup sdk for c to prepare for the new c sdk

Changes in v0.10.4:
* fix: line pipers loses lines when receiving multi lines in one `read`

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Supported Versions
The `HEAD` and the latest release are supported by the Airup developers. The maintained versions are:
- Mainline: `0.10.4`
- Stable: `0.10.4`
- Mainline: `0.10.5`
- Stable: `0.10.5`

## Reporting a Vulnerability
Please [contact @sisungo](mailto:[email protected]) to report a vulnerability.
8 changes: 4 additions & 4 deletions airup-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["sisungo <[email protected]>"]
description = "SDK library of Airup"
documentation = "https://docs.rs/airup-sdk"
repository = "https://github.com/sisungo/airup"
version = "0.10.4"
version = "0.10.5"
edition = "2021"
license = "MIT"

Expand All @@ -14,11 +14,11 @@ license = "MIT"
crate-type = ["rlib", "cdylib"]

[features]
_internal = ["tokio-1", "ffi"]
_internal = ["tokio-1", "blocking", "ffi"]
ffi = ["blocking"]
blocking = []
nonblocking = []
ffi = ["blocking"]
tokio-1 = ["tokio", "nonblocking"]
tokio-1 = ["dep:tokio", "nonblocking"]

[dependencies]
cfg-if = "1"
Expand Down
51 changes: 0 additions & 51 deletions airup-sdk/include/airup.h

This file was deleted.

14 changes: 7 additions & 7 deletions airup-sdk/src/blocking/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pub mod files;
pub mod fs;
pub mod ipc;
pub mod rpc;

use crate::{
error::ApiError,
ipc::{Error as IpcError, Request},
rpc::{Error as IpcError, Request},
};
use ipc::{MessageProtoRecvExt, MessageProtoSendExt};
use rpc::{MessageProtoRecvExt, MessageProtoSendExt};
use serde::{de::DeserializeOwned, Serialize};
use std::{
ops::{Deref, DerefMut},
Expand All @@ -16,13 +16,13 @@ use std::{
/// A high-level wrapper of a connection to `airupd`.
#[derive(Debug)]
pub struct Connection {
underlying: ipc::Connection,
underlying: rpc::Connection,
}
impl Connection {
/// Connects to the specific path.
pub fn connect<P: AsRef<Path>>(path: P) -> std::io::Result<Self> {
Ok(Self {
underlying: ipc::Connection::connect(path)?,
underlying: rpc::Connection::connect(path)?,
})
}

Expand All @@ -48,12 +48,12 @@ impl Connection {
self.underlying.send(&req)?;
Ok(self
.underlying
.recv::<crate::ipc::Response>()?
.recv::<crate::rpc::Response>()?
.into_result())
}
}
impl Deref for Connection {
type Target = ipc::Connection;
type Target = rpc::Connection;

fn deref(&self) -> &Self::Target {
&self.underlying
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
error::ApiError,
ipc::{Error as IpcError, MessageProto, Request, Response},
rpc::{Error as IpcError, MessageProto, Request, Response},
};
use serde::{de::DeserializeOwned, Serialize};
use std::{
Expand Down
154 changes: 0 additions & 154 deletions airup-sdk/src/ffi/error.rs

This file was deleted.

17 changes: 0 additions & 17 deletions airup-sdk/src/ffi/info.rs

This file was deleted.

52 changes: 0 additions & 52 deletions airup-sdk/src/ffi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,52 +0,0 @@
//! # Airup SDK for C
//! This module contains Airup SDK for the C programming language.
pub mod error;
pub mod info;
pub mod system;
pub mod util;

/// # Safety
/// The caller must guarantee the pointer `path` is valid.
#[no_mangle]
pub unsafe extern "C" fn airup_connect(
path: *const libc::c_char,
) -> Option<Box<super::blocking::Connection>> {
let path = std::ffi::CStr::from_ptr(path);
match super::blocking::Connection::connect(&*path.to_string_lossy()) {
Ok(conn) => Some(Box::new(conn)),
Err(err) => {
error::set_last_error(err.into());
None
}
}
}

#[no_mangle]
pub extern "C" fn airup_disconnect(conn: Box<super::blocking::Connection>) {
drop(conn);
}

#[no_mangle]
pub extern "C" fn airup_build_manifest() -> *const libc::c_char {
static VALUE: std::sync::OnceLock<std::ffi::CString> = std::sync::OnceLock::new();

let default = || {
std::ffi::CString::new(include_str!("../../../build_manifest.json"))
.expect("`build_manifest.json` should never contain NUL")
};

VALUE.get_or_init(default).as_ptr()
}

#[no_mangle]
pub extern "C" fn airup_default_path() -> *const libc::c_char {
static VALUE: std::sync::OnceLock<std::ffi::CString> = std::sync::OnceLock::new();

let default = || {
std::ffi::CString::new(&*crate::socket_path().to_string_lossy())
.expect("`AIRUP_SOCK` should never contain NUL")
};

VALUE.get_or_init(default).as_ptr()
}
Loading

0 comments on commit 9e8a9d1

Please sign in to comment.