From: <svn...@op...> - 2009-09-14 17:47:14
|
Author: bellmich Date: Mon Sep 14 19:47:00 2009 New Revision: 1271 URL: http://libsyncml.opensync.org/changeset/1271 Log: Some clients (especially OBEX servers) want to enforce their source. Therefore it must be possible to update the source of a session if the session was created automatically. Modified: trunk/libsyncml/sml_session.c trunk/libsyncml/sml_session.h Modified: trunk/libsyncml/sml_session.c ============================================================================== --- trunk/libsyncml/sml_session.c Mon Sep 14 19:45:08 2009 (r1270) +++ trunk/libsyncml/sml_session.c Mon Sep 14 19:47:00 2009 (r1271) @@ -1795,6 +1795,17 @@ return session->source; } +void +smlSessionSetSource (SmlSession *session, + SmlLocation *source) +{ + if (!source) + return; + if (session->source) + g_object_unref(session->source); + session->source = g_object_ref(source); +} + SmlLocation* smlSessionGetTarget (SmlSession *session) { Modified: trunk/libsyncml/sml_session.h ============================================================================== --- trunk/libsyncml/sml_session.h Mon Sep 14 19:45:08 2009 (r1270) +++ trunk/libsyncml/sml_session.h Mon Sep 14 19:47:00 2009 (r1271) @@ -81,6 +81,7 @@ void smlSessionSetType (SmlSession *session, SmlSessionType type); void smlSessionDispatchEvent (SmlSession *session, SmlSessionEventType type, SmlCommand *cmd, SmlCommand *parent, SmlStatus *headerreply, const GError *error); SmlLocation* smlSessionGetSource (SmlSession *session); +void smlSessionSetSource (SmlSession *session, SmlLocation *source); SmlLocation* smlSessionGetTarget (SmlSession *session); /* This function MUST NOT be used for servers. * This function is only used to set the credentials for a client. |