Skip to content

Commit

Permalink
Provide the node path to session_new
Browse files Browse the repository at this point in the history
  • Loading branch information
scummos authored and aburgm committed Aug 31, 2014
1 parent e234f8d commit 100254e
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 deletions.
1 change: 1 addition & 0 deletions infinoted/plugins/infinoted-plugin-note-chat.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ infinoted_plugin_note_chat_session_new(InfIo* io,
InfSessionStatus status,
InfCommunicationGroup* sync_group,
InfXmlConnection* sync_connection,
const gchar* path,
gpointer user_data)
{
InfChatBuffer* buffer;
Expand Down
1 change: 1 addition & 0 deletions infinoted/plugins/infinoted-plugin-note-text.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ infinoted_plugin_note_text_session_new(InfIo* io,
InfSessionStatus status,
InfCommunicationGroup* sync_group,
InfXmlConnection* sync_connection,
const gchar* path,
gpointer user_data)
{
InfTextSession* session;
Expand Down
1 change: 1 addition & 0 deletions libinfinity/adopted/inf-adopted-session-replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ inf_adopted_session_replay_set_record(InfAdoptedSessionReplay* replay,
INF_SESSION_SYNCHRONIZING,
INF_COMMUNICATION_GROUP(priv->client_group),
INF_XML_CONNECTION(priv->client_conn),
NULL,
plugin->user_data
)
);
Expand Down
8 changes: 8 additions & 0 deletions libinfinity/client/infc-browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2742,6 +2742,7 @@ infc_browser_subscribe_session(InfcBrowser* browser,
InfcBrowserPrivate* priv;
InfcSessionProxy* proxy;
InfBrowserIter iter;
GString* path;
InfSession* session;

priv = INFC_BROWSER_PRIVATE(browser);
Expand All @@ -2750,6 +2751,9 @@ infc_browser_subscribe_session(InfcBrowser* browser,
g_assert(node->shared.known.plugin != NULL);
g_assert(node->shared.known.session == NULL);

path = g_string_sized_new(128);
infc_browser_node_get_path_string(node, path);

if(initial_sync)
{
session = node->shared.known.plugin->session_new(
Expand All @@ -2758,6 +2762,7 @@ infc_browser_subscribe_session(InfcBrowser* browser,
INF_SESSION_SYNCHRONIZING,
INF_COMMUNICATION_GROUP(group),
connection,
path->str,
node->shared.known.plugin->user_data
);
}
Expand All @@ -2769,10 +2774,13 @@ infc_browser_subscribe_session(InfcBrowser* browser,
INF_SESSION_RUNNING,
NULL,
NULL,
path->str,
node->shared.known.plugin->user_data
);
}

g_string_free(path, TRUE);

proxy = g_object_new(INFC_TYPE_SESSION_PROXY, "session", session, NULL);

inf_communication_group_set_target(
Expand Down
1 change: 1 addition & 0 deletions libinfinity/client/infc-note-plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ typedef InfSession*(*InfcNotePluginSessionNew)(InfIo*,
InfSessionStatus,
InfCommunicationGroup*,
InfXmlConnection*,
const char*,
gpointer);

typedef struct _InfcNotePlugin InfcNotePlugin;
Expand Down
28 changes: 24 additions & 4 deletions libinfinity/server/infd-directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,8 @@ infd_directory_create_session_proxy(InfdDirectory* directory,
InfSessionStatus status,
InfCommunicationHostedGroup* sync_g,
InfXmlConnection* sync_conn,
InfCommunicationHostedGroup* sub_g)
InfCommunicationHostedGroup* sub_g,
const char* path)
{
InfdDirectoryPrivate* priv;
InfSession* session;
Expand All @@ -1837,6 +1838,7 @@ infd_directory_create_session_proxy(InfdDirectory* directory,
status,
INF_COMMUNICATION_GROUP(sync_g),
sync_conn,
path,
plugin->user_data
);

Expand Down Expand Up @@ -3910,6 +3912,7 @@ infd_directory_add_subreq_add_node(InfdDirectory* directory,
{
InfdDirectorySubreq* subreq;
InfdSessionProxy* proxy;
gchar* path;
gboolean ensured;

if(session != NULL)
Expand All @@ -3922,14 +3925,19 @@ infd_directory_add_subreq_add_node(InfdDirectory* directory,
}
else
{
infd_directory_node_make_path(parent, name, &path, NULL);

proxy = infd_directory_create_session_proxy(
directory,
plugin,
INF_SESSION_RUNNING,
NULL,
NULL,
group
group,
path
);

g_free(path);
}

ensured = infd_directory_session_proxy_ensure(
Expand Down Expand Up @@ -3982,8 +3990,11 @@ infd_directory_add_subreq_sync_in(InfdDirectory* directory,
{
InfdDirectorySubreq* subreq;
InfdSessionProxy* proxy;
gchar* path;
gboolean ensured;

infd_directory_node_make_path(parent, name, &path, NULL);

/* Keep proxy in PRESYNC state, until we have the confirmation from the
* remote site that the chosen method is OK and we can go on. */
proxy = infd_directory_create_session_proxy(
Expand All @@ -3992,9 +4003,12 @@ infd_directory_add_subreq_sync_in(InfdDirectory* directory,
INF_SESSION_PRESYNC,
sync_group,
connection,
sub_group
sub_group,
path
);

g_free(path);

ensured = infd_directory_session_proxy_ensure(
directory,
parent,
Expand Down Expand Up @@ -4542,6 +4556,7 @@ infd_directory_node_add_note(InfdDirectory* directory,
const gchar* method;
InfdDirectorySubreq* subreq;
InfdSessionProxy* proxy;
gchar* path;
gboolean ensured;
GError* local_error;

Expand Down Expand Up @@ -4648,14 +4663,19 @@ infd_directory_node_add_note(InfdDirectory* directory,
}
else
{
infd_directory_node_make_path(parent, name, &path, NULL);

proxy = infd_directory_create_session_proxy(
directory,
plugin,
INF_SESSION_RUNNING,
NULL,
NULL,
group
group,
path
);

g_free(path);
}

ensured = infd_directory_session_proxy_ensure(
Expand Down
1 change: 1 addition & 0 deletions libinfinity/server/infd-note-plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef InfSession*(*InfdNotePluginSessionNew)(InfIo*,
InfSessionStatus,
InfCommunicationGroup*,
InfXmlConnection*,
const char*,
gpointer);

typedef InfSession*(*InfdNotePluginSessionRead)(InfdStorage*,
Expand Down

0 comments on commit 100254e

Please sign in to comment.