Changeset 499

Show
Ignore:
Timestamp:
07/16/08 15:27:37 (4 months ago)
Author:
bellmich
Message:

fixed the send function more correctly
errors will now be signalled

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libsyncml/transports/obex_server.c

    r498 r499  
    652652        smlAssert(userdata); 
    653653        SmlLinkObexServerEnv *linkenv = userdata; 
     654        SmlError *local_error = NULL; 
     655 
     656        if (link != NULL) { 
     657                linkenv = link; 
     658        } else { 
     659                /* send is called before connect succeeded */ 
     660                smlErrorSet(&local_error, SML_ERROR_GENERIC, 
     661                        "The OBEX server tries to send before a connection with a client was established."); 
     662                goto error; 
     663        } 
    654664         
    655665        if (error) { 
     
    662672         
    663673        if (linkenv->send_data) { 
    664                 smlErrorSet(&error, SML_ERROR_GENERIC, "We already have waiting data"); 
     674                smlErrorSet(&local_error, SML_ERROR_GENERIC, "We already have waiting data"); 
    665675                goto error; 
    666676        } 
     
    673683         
    674684error: 
    675         smlErrorDeref(&error); 
    676         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(&error)); 
     685        smlTransportReceiveEvent(linkenv->env->tsp, linkenv->link, SML_TRANSPORT_EVENT_ERROR, NULL, local_error); 
     686        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(&local_error)); 
     687        smlErrorDeref(&local_error); 
    677688        return; 
    678689}