Changeset 122
- Timestamp:
- 04/12/06 22:01:45 (3 years ago)
- Files:
-
- branches/development-branch/libsyncml/parser/sml_xml_assm.c (modified) (5 diffs)
- branches/development-branch/libsyncml/parser/sml_xml_parse.c (modified) (1 diff)
- branches/development-branch/libsyncml/sml_defines.h (modified) (1 diff)
- branches/development-branch/libsyncml/sml_elements.h (modified) (1 diff)
- branches/development-branch/tools/syncml-http-server.c (modified) (8 diffs)
- branches/development-branch/tools/syncml-obex-client.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/development-branch/libsyncml/parser/sml_xml_assm.c
r120 r122 219 219 220 220 //Meta 221 if (complete_size) {221 /*if (complete_size) { 222 222 if (!_smlXmlAssemblerStartNode(assm, SML_ELEMENT_META, error)) 223 223 goto error; … … 229 229 if (!_smlXmlAssemblerEndNode(assm, error)) 230 230 goto error; 231 } 231 }*/ 232 232 233 233 if (smlItemHasData(item)) { … … 385 385 goto error; 386 386 387 /*if (change->size) {387 if (change->size) { 388 388 if (!_smlXmlAssemblerAddID(assm, SML_ELEMENT_SIZE, change->size, error)) 389 389 goto error; 390 } */390 } 391 391 392 392 //META … … 422 422 } 423 423 424 425 if (!_smlXmlAssemblerStartNode(assm, SML_ELEMENT_META, error)) 426 goto error; 427 428 if (!_smlXmlAssemblerAddIDNS(assm, NULL, SML_ELEMENT_MAXOBJSIZE, SML_NAMESPACE_METINF, 786432, error)) 429 goto error; 430 431 //META 432 if (!_smlXmlAssemblerEndNode(assm, error)) 433 goto error; 424 printf("max obj %i, version %i %i\n", assm->session->incomingMaxObjSize, assm->session->version, SML_VERSION_10); 425 if (assm->session->incomingMaxObjSize && assm->session->version != SML_VERSION_10) { 426 if (!_smlXmlAssemblerStartNode(assm, SML_ELEMENT_META, error)) 427 goto error; 428 429 if (!_smlXmlAssemblerAddIDNS(assm, NULL, SML_ELEMENT_MAXOBJSIZE, SML_NAMESPACE_METINF, assm->session->incomingMaxObjSize, error)) 430 goto error; 431 432 //META 433 if (!_smlXmlAssemblerEndNode(assm, error)) 434 goto error; 435 } 434 436 435 437 if (!smlLocationAssemble(cmd->target, assm, SML_ELEMENT_TARGET, error)) … … 1942 1944 1943 1945 //UTC 1946 /* Note: We dont check for devinf version 1.1 here, since there are some 1947 * (buggy) phones which _reqqire_ the utc tag even if it is devinf 1.0. */ 1944 1948 if (devinf->supportsUTC) { 1945 1949 if (!_smlXmlAssemblerAddString(assm, SML_ELEMENT_UTC, "", error)) branches/development-branch/libsyncml/parser/sml_xml_parse.c
r120 r122 508 508 if (!_smlXmlParserGetID(parser, maxobjsize, SML_ELEMENT_MAXOBJSIZE, error)) 509 509 goto error; 510 } else if (!strcmp((char *)xmlTextReaderConstName(parser->reader), SML_ELEMENT_MEM)) { 511 /* Ignored for now */ 512 if (xmlTextReaderNext(parser->reader) != 1) { 513 smlErrorSet(error, SML_ERROR_GENERIC, "Unable to skip mem node"); 514 goto error; 515 } 510 516 } else { 511 517 smlErrorSet(error, SML_ERROR_GENERIC, "wrong initial node: %s", xmlTextReaderConstName(parser->reader)); branches/development-branch/libsyncml/sml_defines.h
r120 r122 67 67 #define SML_ELEMENT_MAXOBJSIZE "MaxObjSize" 68 68 #define SML_ELEMENT_MOREDATA "MoreData" 69 #define SML_ELEMENT_MEM "Mem" 70 #define SML_ELEMENT_FREEID "FreeID" 69 71 70 72 /* For devinf */ branches/development-branch/libsyncml/sml_elements.h
r120 r122 44 44 SmlBool smlItemHasData(SmlItem *item); 45 45 SmlBool smlItemGetData(SmlItem *item, char **data, unsigned int *size, SmlError **error); 46 SmlBool smlItemStealData(SmlItem *item, char **data, unsigned int *size, SmlError **error); 46 47 47 48 void smlItemSetSource(SmlItem *item, SmlLocation *source); branches/development-branch/tools/syncml-http-server.c
r121 r122 62 62 fprintf (stderr, "[--recvLimit <limit>]\t\t\tLimit the size of the receiving buffer to this size (Needed for some phones)\n\n"); 63 63 fprintf (stderr, "[--allowLateStatus]\t\t\tAllows that a phone can send commands before statuses (Needed for some phones)\n\n"); 64 fprintf (stderr, "[--maxObjSize <limit>]\t\t\tThe maximum size of a object that we can receive (Needed for some phones)\n\n"); 65 fprintf (stderr, "[--addUTC]\t\t\tAdd the UTC tag to the device information (Needed for some phones)\n\n"); 64 66 fprintf (stderr, "[--noPendingReplies]\t\t\tRequire that no pending replies are allowed (Needed for some phones)\n"); 65 67 fprintf (stderr, "Example: %s --port 9999 --sync vcal /events --sync vcard /addressbook --multi --san\n", name); … … 220 222 221 223 unsigned int recvLimit = 0; 224 unsigned int maxObjSize = 0; 222 225 SmlBool lateStatus = FALSE; 223 226 SmlBool noPending = FALSE; … … 243 246 if (recvLimit) 244 247 smlSessionSetReceivingLimit(session, recvLimit); 248 249 if (maxObjSize) 250 smlSessionSetReceivingMaxObjSize(session, maxObjSize); 245 251 246 252 if (lateStatus) … … 331 337 332 338 SmlError *error = NULL; 333 339 SmlBool addUTC = TRUE; 340 334 341 if (!g_thread_supported ()) g_thread_init (NULL); 335 342 … … 352 359 usage (argv[0], 1); 353 360 recvLimit = atoi(argv[i]); 361 } else if (!strcmp (arg, "--maxObjSize")) { 362 i++; 363 if (!argv[i]) 364 usage (argv[0], 1); 365 maxObjSize = atoi(argv[i]); 354 366 } else if (!strcmp (arg, "--multi")) { 355 367 once = FALSE; … … 359 371 } else if (!strcmp (arg, "--allowLateStatus")) { 360 372 lateStatus = TRUE; 373 } else if (!strcmp (arg, "--addUTC")) { 374 addUTC = TRUE; 361 375 } else if (!strcmp (arg, "--noPendingReplies")) { 362 376 noPending = TRUE; … … 398 412 goto error_free_manager; 399 413 414 smlDevInfSetSupportsUTC(devinf, addUTC); 415 400 416 agent = smlDevInfAgentNew(devinf, &error); 401 417 if (!agent) … … 462 478 if (!datastore) 463 479 goto error; 464 480 465 481 switch (type) { 466 482 case SML_CONTENT_TYPE_VCAL: branches/development-branch/tools/syncml-obex-client.c
r120 r122 71 71 fprintf (stderr, "[--wbxml]\t\t\tUse wbxml (WAP Binary XML) instead of plain xml\n\n"); 72 72 fprintf (stderr, "[--recvLimit <limit>]\t\t\tLimit the size of the receiving buffer to this size (Needed for some phones)\n\n"); 73 fprintf (stderr, "[--maxObjSize <limit>]\t\t\tThe maximum size of a object that we can receive (Needed for some phones)\n\n"); 74 fprintf (stderr, "[--addUTC]\t\t\tAdd the UTC tag to the device information (Needed for some phones)\n\n"); 73 75 fprintf (stderr, "[--allowLateStatus]\t\t\tAllows that a phone can send commands before statuses (Needed for some phones)\n\n"); 74 76 fprintf (stderr, "[--noPendingReplies]\t\t\tRequire that no pending replies are allowed (Needed for some phones)\n"); … … 237 239 238 240 unsigned int recvLimit = 0; 241 unsigned int maxObjSize = 0; 239 242 SmlBool lateStatus = FALSE; 240 243 SmlBool noPending = FALSE; … … 262 265 if (recvLimit) 263 266 smlSessionSetReceivingLimit(session, recvLimit); 267 268 if (maxObjSize) 269 smlSessionSetReceivingMaxObjSize(session, maxObjSize); 264 270 265 271 if (lateStatus) … … 392 398 393 399 SmlMimeType type = SML_MIMETYPE_XML; 400 SmlBool addUTC = FALSE; 394 401 395 402 SmlError *error = NULL; … … 455 462 usage (argv[0], 1); 456 463 recvLimit = atoi(argv[i]); 464 } else if (!strcmp (arg, "--maxObjSize")) { 465 i++; 466 if (!argv[i]) 467 usage (argv[0], 1); 468 maxObjSize = atoi(argv[i]); 457 469 } else if (!strcmp (arg, "--allowLateStatus")) { 458 470 lateStatus = TRUE; 459 471 } else if (!strcmp (arg, "--noPendingReplies")) { 460 472 noPending = TRUE; 473 } else if (!strcmp (arg, "--addUTC")) { 474 addUTC = TRUE; 461 475 } else if (!strcmp (arg, "--version")) { 462 476 i++; … … 510 524 if (!devinf) 511 525 goto error_free_manager; 526 527 smlDevInfSetSupportsUTC(devinf, addUTC); 512 528 513 529 agent = smlDevInfAgentNew(devinf, &error);
