evgenido / stomp

STOMP client library written in C
GNU Lesser General Public License v3.0
15 stars 15 forks source link

Correction for accessing the members of stomp_session_t from third-party applications. #3

Open userlocalhost opened 8 years ago

userlocalhost commented 8 years ago

Currently, the definition of _stomp_session doesn't exist in stomp.h which is exposed to third-party applications. By this implementation, an user-application cound't access the member of stomp_session_t,

Here is a callback implementation to handle ERROR frame in an user-application. This may occur an error of 'dereferencing pointer to incomplete type'

void callback_error(stomp_session_t *s, void *callback_ctx, void *session_ctx) {
  s->run = 0; // couldn't access the member of stomp_session_t
}

For accessing members of stomp_session_t, I wrote thier definitions in exposed header files.