diff --git a/gobex/gobex.c b/gobex/gobex.c
index 1c74ec0..70a5bb5 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
GSList *req_handlers;
- GObexRequestFunc req_func;
- gpointer req_func_data;
-
GObexFunc disconn_func;
gpointer disconn_func_data;
return TRUE;
}
-void g_obex_set_request_function(GObex *obex, GObexRequestFunc func,
- gpointer user_data)
-{
- obex->req_func = func;
- obex->req_func_data = user_data;
-}
-
void g_obex_set_disconnect_function(GObex *obex, GObexFunc func,
gpointer user_data)
{
static void handle_request(GObex *obex, GObexPacket *req)
{
+ GObexPacket *rsp;
GSList *match;
guint8 opcode;
return;
}
- if (obex->req_func)
- obex->req_func(obex, req, obex->req_func_data);
+ rsp = g_obex_packet_new(G_OBEX_RSP_NOT_IMPLEMENTED, TRUE, NULL);
+ g_obex_send(obex, rsp, NULL);
}
static gboolean read_stream(GObex *obex, GError **err)
diff --git a/gobex/gobex.h b/gobex/gobex.h
index 110231f..034213f 100644
--- a/gobex/gobex.h
+++ b/gobex/gobex.h
gboolean g_obex_cancel_req(GObex *obex, guint req_id,
gboolean remove_callback);
-void g_obex_set_request_function(GObex *obex, GObexRequestFunc func,
- gpointer user_data);
void g_obex_set_disconnect_function(GObex *obex, GObexFunc func,
gpointer user_data);
gint g_obex_add_request_function(GObex *obex, guint8 opcode,
diff --git a/unit/test-gobex.c b/unit/test-gobex.c
index 3a544ed..d65d8a8 100644
--- a/unit/test-gobex.c
+++ b/unit/test-gobex.c
create_endpoints(&obex, &io, transport_type);
- g_obex_set_request_function(obex, handle_connect_req, &gerr);
+ g_obex_add_request_function(obex, G_OBEX_OP_CONNECT,
+ handle_connect_req, &gerr);
g_obex_set_disconnect_function(obex, handle_connect_err, &gerr);
status = g_io_channel_write_chars(io, (gchar *) pkt_connect_req,