return TRUE;
}
-gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err)
+gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err,
+ guint8 first_hdr_type, ...)
{
GObexPacket *rsp;
+ va_list args;
- rsp = g_obex_packet_new(rspcode, TRUE, G_OBEX_HDR_INVALID);
+ va_start(args, first_hdr_type);
+ rsp = g_obex_packet_new_valist(rspcode, TRUE, first_hdr_type, args);
+ va_end(args);
return g_obex_send(obex, rsp, err);
}
gboolean g_obex_cancel_req(GObex *obex, guint req_id,
gboolean remove_callback);
-gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err);
+gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err,
+ guint8 first_hdr_type, ...);
void g_obex_set_disconnect_function(GObex *obex, GObexFunc func,
gpointer user_data);
if (data->fd < 0) {
g_printerr("open(%s): %s\n", name, strerror(errno));
g_free(data);
- g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL);
+ g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL,
+ G_OBEX_HDR_INVALID);
return;
}
if (data->fd < 0) {
g_printerr("open(%s): %s\n", name, strerror(errno));
g_free(data);
- g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL);
+ g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL,
+ G_OBEX_HDR_INVALID);
return;
}