mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
added implementation of getattr stub
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
#include "wsfsp/operation/error.h"
|
||||
#include <jansson.h>
|
||||
#include "wsfsp/request.h"
|
||||
|
||||
void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
int status)
|
||||
{
|
||||
(void) request;
|
||||
(void) status;
|
||||
json_t * response = json_object();
|
||||
json_t * error = json_object();
|
||||
json_object_set_new(error, "code", json_integer(status));
|
||||
json_object_set_new(response, "error", error);
|
||||
json_object_set_new(response, "id", json_integer(request->id));
|
||||
|
||||
// ToDo: implement me
|
||||
request->respond(response, request->user_data);
|
||||
|
||||
json_decref(response);
|
||||
wsfsp_request_dispose(request);
|
||||
}
|
||||
|
||||
@@ -9,11 +9,19 @@ void wsfsp_getattr(
|
||||
json_t * params,
|
||||
int id)
|
||||
{
|
||||
(void) context;
|
||||
(void) params;
|
||||
(void) id;
|
||||
size_t const count = json_array_size(params);
|
||||
if (1 == count)
|
||||
{
|
||||
json_t * inode_holder = json_array_get(params, 0);
|
||||
|
||||
puts("getattr");
|
||||
if ((NULL != inode_holder) && (json_is_integer(inode_holder)))
|
||||
{
|
||||
ino_t inode = (ino_t) json_integer_value(inode_holder);
|
||||
struct wsfsp_request * request = wsfsp_request_create(context->request, id);
|
||||
|
||||
context->provider->getattr(request, inode, context->user_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wsfsp_getattr_default(
|
||||
|
||||
Reference in New Issue
Block a user