Changeset 428
- Timestamp:
- 04/11/08 16:30:30 (7 months ago)
- Files:
-
- trunk/libsyncml/transports/obex_client.c (modified) (4 diffs)
- trunk/libsyncml/transports/obex_client_internals.h (modified) (1 diff)
- trunk/tools/syncml-obex-client.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libsyncml/transports/obex_client.c
r423 r428 391 391 break; 392 392 case OBEX_CMD_DISCONNECT:; 393 /* FIXME: Why is this commented out? 394 * FIMXE: Perhaps because disconnect is signalled always as LINKERR with RSP==0 395 */ 396 //smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); 393 if (!env->isDisconnected) 394 { 395 env->busy = FALSE; 396 env->isDisconnected = TRUE; 397 smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); 398 } 397 399 break; 398 400 case OBEX_CMD_GET:; … … 452 454 { 453 455 /* This is a disconnect. */ 454 smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); 456 if (!env->isDisconnected) 457 { 458 env->busy = FALSE; 459 env->isDisconnected = TRUE; 460 smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); 461 } 455 462 } else { 456 463 /* This is a normal error. */ … … 662 669 int obex_intf_cnt; 663 670 obex_interface_t *obex_intf; 671 env->isDisconnected = FALSE; 664 672 665 673 if (env->type == SML_TRANSPORT_CONNECTION_TYPE_NET) { … … 895 903 } 896 904 } 897 smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL);905 /* Note: the disconnect is signaled by OBEX_EV_LINKERR or OBEX_CMD_DISCONNECT */ 898 906 899 907 smlTrace(TRACE_EXIT, "%s", __func__); trunk/libsyncml/transports/obex_client_internals.h
r414 r428 65 65 SmlBool error; 66 66 SmlMimeType mimetype; 67 SmlBool isDisconnected; 67 68 } SmlTransportObexClientEnv; 68 69 trunk/tools/syncml-obex-client.c
r419 r428 216 216 goto error; 217 217 } else if (slow) { 218 /* SLOW-SYNC enforced by tool */ 218 219 printf("Slowsyncing\n"); 219 220 if (!smlDsSessionSendAlert(dsession, SML_ALERT_SLOW_SYNC, last, next, _recv_alert_reply, NULL, &error)) … … 223 224 return FALSE; 224 225 } else { 225 if (!smlDsSessionSendAlert(dsession, SML_ALERT_TWO_WAY_BY_SERVER, last, next, _recv_alert_reply, NULL, &error)) 226 /* We only support SLOW-SYNC and TWO-WAY-SYNC */ 227 /* FIXME: Why do we use alert 206? */ 228 /* FIXME: Usually 200 and 201 are the correct alert codes. */ 229 if (type != SML_ALERT_SLOW_SYNC && 230 type != SML_ALERT_TWO_WAY && 231 type != SML_ALERT_TWO_WAY_BY_SERVER) 232 { 233 smlErrorSet(&error, SML_ERROR_GENERIC, "Unsupported alert type %d.", type); 234 goto error; 235 } 236 if (!smlDsSessionSendAlert(dsession, type, last, next, _recv_alert_reply, NULL, &error)) 226 237 goto error; 227 238 }
