Changeset 168
- Timestamp:
- 05/21/06 15:12:42 (3 years ago)
- Files:
-
- branches/dev-branch/libsyncml/sml_session.c (modified) (3 diffs)
- branches/dev-branch/libsyncml/sml_session.h (modified) (1 diff)
- branches/dev-branch/libsyncml/sml_session_internals.h (modified) (2 diffs)
- branches/dev-branch/tools/syncml-http-server.c (modified) (5 diffs)
- branches/dev-branch/tools/syncml-obex-client.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dev-branch/libsyncml/sml_session.c
r166 r168 859 859 break; 860 860 case SML_PARSER_RESULT_STATUS: 861 if (session->allowLateStatus) 862 goto parse_status; 863 smlErrorSet(error, SML_ERROR_GENERIC, "Received a status after commands"); 861 goto parse_status; 864 862 default: 865 863 goto error_free_cmd; … … 880 878 * wait here for all open statuses, since they have to be added in the correct order and 881 879 * the status for the open buffer is obviously last */ 882 if (session->incomingBuffer || session->noPendingReplies) {880 if (session->incomingBuffer) { 883 881 while (1) { 884 882 unsigned int cmdRef, msgRef = 0; … … 1282 1280 } 1283 1281 1284 void smlSessionSetAllowLateStatus(SmlSession *session, SmlBool allow)1285 {1286 smlTrace(TRACE_ENTRY, "%s(%p, %i)", __func__, session, allow);1287 smlAssert(session);1288 1289 session->allowLateStatus = allow;1290 1291 smlTrace(TRACE_EXIT, "%s", __func__);1292 }1293 1294 void smlSessionSetNoPendingReplies(SmlSession *session, SmlBool set)1295 {1296 smlTrace(TRACE_ENTRY, "%s(%p, %i)", __func__, session, set);1297 smlAssert(session);1298 1299 session->noPendingReplies = set;1300 1301 smlTrace(TRACE_EXIT, "%s", __func__);1302 }1303 1304 1282 void smlSessionSetSendingLimit(SmlSession *session, unsigned int limit) 1305 1283 { branches/dev-branch/libsyncml/sml_session.h
r160 r168 52 52 void smlSessionUseStringTable(SmlSession *session, SmlBool useStringtable); 53 53 void smlSessionUseOnlyReplace(SmlSession *session, SmlBool onlyReplace); 54 void smlSessionSetAllowLateStatus(SmlSession *session, SmlBool allow);55 void smlSessionSetNoPendingReplies(SmlSession *session, SmlBool set);56 54 void smlSessionSetSendingLimit(SmlSession *session, unsigned int limit); 57 55 void smlSessionSetReceivingLimit(SmlSession *session, unsigned int limit); branches/dev-branch/libsyncml/sml_session_internals.h
r160 r168 30 30 SmlSessionType sessionType; 31 31 SmlAssembler *assembler; 32 SmlBool allowLateStatus;33 32 SmlBool onlyReplace; 34 33 … … 85 84 86 85 SmlBool active; 87 88 /* If this variable is set to TRUE, the session will suspend before89 * sending a message, to wait for the replies for the commands from the last90 * message. Be carefull. If you dont add all replies, the session will of course91 * wait forever */92 SmlBool noPendingReplies;93 86 }; 94 87 branches/dev-branch/tools/syncml-http-server.c
r166 r168 65 65 fprintf (stderr, "\t\t\tyou can use more than one session\n\n"); 66 66 fprintf (stderr, "[--recvLimit <limit>]\t\t\tLimit the size of the receiving buffer to this size (Needed for some phones)\n\n"); 67 fprintf (stderr, "[--allowLateStatus]\t\t\tAllows that a phone can send commands before statuses (Needed for some phones)\n\n");68 67 fprintf (stderr, "[--maxObjSize <limit>]\t\t\tThe maximum size of a object that we can receive (Needed for some phones)\n\n"); 69 fprintf (stderr, "[--noPendingReplies]\t\t\tRequire that no pending replies are allowed (Needed for some phones)\n\n");70 68 fprintf (stderr, "[--dumpinfo]\t\t\tPrint info about the phone at the end which can be sent to the developers\n"); 71 69 fprintf (stderr, "Example: %s --port 9999 --sync vcal /events --sync vcard /addressbook --multi --san\n", name); … … 232 230 unsigned int recvLimit = 0; 233 231 unsigned int maxObjSize = 0; 234 SmlBool lateStatus = FALSE;235 SmlBool noPending = FALSE;236 232 SmlBool dumpinfo = FALSE; 237 233 SmlProtocolVersion sessionVersion = SML_VERSION_UNKNOWN; … … 265 261 if (maxObjSize) 266 262 smlSessionSetReceivingMaxObjSize(session, maxObjSize); 267 268 if (lateStatus)269 smlSessionSetAllowLateStatus(session, lateStatus);270 271 if (noPending)272 smlSessionSetNoPendingReplies(session, noPending);273 263 break; 274 264 case SML_MANAGER_SESSION_FINAL: … … 405 395 i += 2; 406 396 continue; 407 } else if (!strcmp (arg, "--allowLateStatus")) {408 lateStatus = TRUE;409 } else if (!strcmp (arg, "--noPendingReplies")) {410 noPending = TRUE;411 397 } else if (!strcmp (arg, "--dumpinfo")) { 412 398 dumpinfo = TRUE; … … 566 552 printf("ReceiveLimit: %i\n", recvLimit); 567 553 printf("MaxObjSize: %i\n", maxObjSize); 568 printf("AllowLateStatus: %s\n", lateStatus ? "yes" : "no");569 printf("NoPendingReplies: %s\n", noPending ? "yes" : "no");570 554 printf("Connection used: Obex\n"); 571 555 printf("\nDatabases:\n"); branches/dev-branch/tools/syncml-obex-client.c
r166 r168 75 75 fprintf (stderr, "[--recvLimit <limit>]\t\t\tLimit the size of the receiving buffer to this size (Needed for some phones)\n\n"); 76 76 fprintf (stderr, "[--maxObjSize <limit>]\t\t\tThe maximum size of a object that we can receive (Needed for some phones)\n\n"); 77 fprintf (stderr, "[--allowLateStatus]\t\t\tAllows that a phone can send commands before statuses (Needed for some phones)\n\n");78 fprintf (stderr, "[--noPendingReplies]\t\t\tRequire that no pending replies are allowed (Needed for some phones)\n\n");79 77 fprintf (stderr, "[--noStringTable]\t\t\tDont use wbxml string tables (Needed for some phones)\n\n"); 80 78 fprintf (stderr, "[--dumpinfo]\t\t\tPrint info about the phone at the end which can be sent to the developers\n"); … … 248 246 unsigned int recvLimit = 0; 249 247 unsigned int maxObjSize = 0; 250 SmlBool lateStatus = FALSE;251 SmlBool noPending = FALSE;252 248 SmlBool dumpinfo = FALSE; 253 249 SmlBool noStringTable = FALSE; … … 281 277 if (maxObjSize) 282 278 smlSessionSetReceivingMaxObjSize(session, maxObjSize); 283 284 if (lateStatus)285 smlSessionSetAllowLateStatus(session, lateStatus);286 287 if (noPending)288 smlSessionSetNoPendingReplies(session, noPending);289 279 290 280 if (noStringTable) … … 501 491 usage (argv[0], 1); 502 492 maxObjSize = atoi(argv[i]); 503 } else if (!strcmp (arg, "--allowLateStatus")) {504 lateStatus = TRUE;505 } else if (!strcmp (arg, "--noPendingReplies")) {506 noPending = TRUE;507 493 } else if (!strcmp (arg, "--noStringTable")) { 508 494 noStringTable = TRUE; … … 701 687 printf("ReceiveLimit: %i\n", recvLimit); 702 688 printf("MaxObjSize: %i\n", maxObjSize); 703 printf("AllowLateStatus: %s\n", lateStatus ? "yes" : "no");704 printf("NoPendingReplies: %s\n", noPending ? "yes" : "no");705 689 printf("Connection used: Obex\n"); 706 690 printf("Identifier: %s\n", identifier);
