6.0.0-beta1
7/4/25

[#12377] activesync wbxml content begint with two 0x0a
Summary activesync wbxml content begint with two 0x0a
Queue Synchronization
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester l.kiraly (at) madalbal (dot) hu
Created 06/20/2013 (4397 days ago)
Due
Updated 06/21/2013 (4396 days ago)
Assigned 06/20/2013 (4397 days ago)
Resolved 06/21/2013 (4396 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/21/2013 12:40:31 PM Michael Rubinsky State ⇒ Not A Bug
 
06/21/2013 08:28:14 AM l (dot) kiraly (at) madalbal (dot) hu Comment #15 Reply to this comment
finally I found the cause of the error. It was in my local setting 
(ending php tag)
06/21/2013 05:43:47 AM l (dot) kiraly (at) madalbal (dot) hu Comment #14 Reply to this comment
I extended the test script to:

<?php

require_once('lib/Application.php');

    $conf['cookie']['path'] = '/Microsoft-Server-ActiveSync';
     $serverType = 'ActiveSync';
     $nocompress = true;
     $session_control = 'none';
     $cache_control = 'private';

Horde_Registry::appInit('horde', array(
     'authentication' => 'none',
     'nocompress' => $nocompress,
     'session_control' => $session_control,
     'session_cache_limiter' => $cache_control
));

header('Content-Length: 451');
header('Content-Type: application/vnd.ms-sync.wbxml');
echo file_get_contents('/tmp/ob_data.txt');

?>

-------------------------

Now I can reproduce this bug in my system. If I uncomment the 
Horde_Registry::appInit stuff, the wbxml content is good. If I use 
Horde_Registry::appInit then I get ONE extra linefeed in the beginning 
of the wbxml content.
06/20/2013 07:24:37 PM l (dot) kiraly (at) madalbal (dot) hu Comment #13
New Attachment: test.pcapng Download
Reply to this comment
I made a simple test.php:

header('Content-Type: application/vnd.ms-sync.wbxml');
print(chr(0x03));


in the tcpdump file there is no linefeed char at the beginning of the 
wbxml content, but if I put a return; after a 
$this->_encoder->StartWBXML(); in the FolderSync.php I get the extra 
linefeeds.


I suspect the key is in the http header fields.

06/20/2013 06:42:27 PM l (dot) kiraly (at) madalbal (dot) hu Comment #12 Reply to this comment
You didn't by any chance edit some horde files and accidentally add 
some line feeds to the beginning of the file (before the opening 
<?php tag) did you?
No I didn't do that.
06/20/2013 06:39:43 PM l (dot) kiraly (at) madalbal (dot) hu Comment #11 Reply to this comment
Do you have any idea, how can I figure out what setting is wrong?
No, as I seriously doubt your issue  is due to a setting or configuration.
Then what is your opinion?
06/20/2013 05:18:12 PM Michael Rubinsky Comment #10 Reply to this comment
Do you have any idea, how can I figure out what setting is wrong?
No, as I seriously doubt your issue  is due to a setting or configuration.
06/20/2013 05:15:29 PM l (dot) kiraly (at) madalbal (dot) hu Comment #9 Reply to this comment
Do you have any idea, how can I figure out what setting is wrong?
06/20/2013 05:13:38 PM Michael Rubinsky Comment #8 Reply to this comment
You didn't by any chance edit some horde files and accidentally add 
some line feeds to the beginning of the file (before the opening <?php 
tag) did you?
06/20/2013 05:09:03 PM Michael Rubinsky Comment #7 Reply to this comment
Then this means that the "extra" 0x0a is not coming from the 
Horde_ActiveSync library, but some other part of the webserver 
response.  The only difference what you did makes is that your 
temporary file will contain *only* what is sent from the code in 
Horde_ActiveSync, while your tcpdump contains *everything* that is 
sent as part of the http response.

06/20/2013 04:43:09 PM l (dot) kiraly (at) madalbal (dot) hu Comment #6 Reply to this comment
I just changed the 
framework/Core/lib/Horde/Core/Factory/ActiveSyncServer.php file.
I changed the 13. line from new 
Horde_ActiveSync_Wbxml_Encoder(fopen('php://output', 'w+')) to
new Horde_ActiveSync_Wbxml_Encoder(fopen('/tmp/xbxml.txt', 'w+')) and 
checked the file. It doesn't have the two 0x0a in the beginning. I 
assume this is because of the "php://output" fopen option. Maybe some 
php.ini setting?
06/20/2013 03:30:06 PM l (dot) kiraly (at) madalbal (dot) hu Comment #5 Reply to this comment

[Show Quoted Text - 9 lines]
Umm yes. Sorry. I already fixed this config issue. I put a fresh 
syslog to http://proxy.madalbal.hu/syslog.txt
06/20/2013 02:57:13 PM Michael Rubinsky Comment #4
State ⇒ Feedback
Reply to this comment
What you are seeing are the CR/LF after the HTTP response headers.
This is normal.
No. After the CR/LF. Please check the log file with wireshark. You will see.
I won't be able to view this until I get back home. In the meantime, 
your horde.log contains the following error, so I'm not really sure 
where the activesync logs you gave me were from since according to 
this, your server was unable to create them.:

Jun 17 11:15:46 test HORDE: [horde] PHP ERROR: 
fopen(/tmp/activesync.log/androidc1096662271.txt): failed to open 
stream: Nincs ilyen fájl vagy könyvtár [pid 6938 on line 41 of 
"/usr/local/src/horde/framework/Core/lib/Horde/Core/ActiveSync/Logger/Factory.php"]
Jun 17 11:15:46 test HORDE: 1. Horde_Rpc_ActiveSync->getResponse() 
/usr/local/src/horde/horde/rpc.php:156 2. 
Horde_ActiveSync->handleRequest() 
/usr/local/src/horde/framework/Rpc/lib/Horde/Rpc/ActiveSync.php:141 3. 
Horde_ActiveSync->_setLogger() 
/usr/local/src/horde/framework/ActiveSync/lib/Horde/ActiveSync.php:549 
4. Horde_Core_ActiveSync_Logger_Factory->create() 
/usr/local/src/horde/framework/ActiveSync/lib/Horde/ActiveSync.php:498 
5. fopen() 
/usr/local/src/horde/framework/Core/lib/Horde/Core/ActiveSync/Logger/Factory.php:41 6. 
Horde_ErrorHandler::errorHandler()
06/20/2013 02:29:52 PM l (dot) kiraly (at) madalbal (dot) hu Comment #3 Reply to this comment
What you are seeing are the CR/LF after the HTTP response headers. 
This is normal.
No. After the CR/LF. Please check the log file with wireshark. You will see.

06/20/2013 02:22:53 PM Michael Rubinsky Comment #2
Priority ⇒ 1. Low
State ⇒ Not A Bug
Reply to this comment
What you are seeing are the CR/LF after the HTTP response headers. 
This is normal.
06/20/2013 09:23:41 AM l (dot) kiraly (at) madalbal (dot) hu Comment #1
Priority ⇒ 3. High
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ activesync wbxml content begint with two 0x0a
Type ⇒ Bug
Queue ⇒ Synchronization
Reply to this comment
tcpdump log: http://proxy.madalbal.hu/sync.log
ActiveSync logs: http://proxy.madalbal.hu/activesync.tar.bz2

You can see that after a Cmd=FolderSync request, the rpc.php sends WBXML
content starting with two hexa 0x0a. It should be the version number 
of the actual
WBXML but it's two newline char. After that begins the real WBXML content.




Saved Queries