6.0.0-git
2019-03-24

[#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 2013-06-20 (2103 days ago)
Due
Updated 2013-06-21 (2102 days ago)
Assigned 2013-06-20 (2103 days ago)
Resolved 2013-06-21 (2102 days ago)
Milestone
Patch No

History
2013-06-21 12:40:31 Michael Rubinsky State ⇒ Not A Bug
 
2013-06-21 08:28:14 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)
2013-06-21 05:43:47 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.
2013-06-20 19:24:37 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.

2013-06-20 18:42:27 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.
2013-06-20 18:39:43 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?
2013-06-20 17:18:12 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.
2013-06-20 17:15:29 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?
2013-06-20 17:13:38 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?
2013-06-20 17:09:03 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.

2013-06-20 16:43:09 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?
2013-06-20 15:30:06 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
2013-06-20 14:57:13 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()
2013-06-20 14:29:52 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.

2013-06-20 14:22:53 Michael Rubinsky Comment #2
State ⇒ Not A Bug
Priority ⇒ 1. Low
Reply to this comment
What you are seeing are the CR/LF after the HTTP response headers. 
This is normal.
2013-06-20 09:23:41 l (dot) kiraly (at) madalbal (dot) hu Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ activesync wbxml content begint with two 0x0a
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
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