|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-02 16:07 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 23:00:01 2025 UTC |
Description: ------------ We have a commercial PHP-based product, basically a web app which interfaces with our Counterpoint point of sale product, and is designed to run on wireless handheld devices. Communications with Counterpoint is handled via an application server, which we communicate with from PHP via a socket connection. Of the different types of messages we pass back and forth between PHP and the application server, is a transaction describing a complex item with multiple dimensions (size, color, etc). When retreiving this large block of data from the socket using fread, we get unexpected data. Each packet which is exchanged consists of a beginning 1 byte marker ("\x02") which denotes the beginning of a package, followed by a protocol version (internal designator), followed by 2 bytes indicating the length of the packet. We then fread that number of bytes from the socket, followed by 12 bytes of additional data tacked onto the end of the information. Certain communications are multi-packet, so the code loops until we either hit an feof condition or do not receive the expected beginning marker (which is an error). Using PHP 4.3.1 and earlier, down to 4.1.1, the code works fine. With PHP 4.3.2 and newer, including 4.3.5RC3, the code chokes on large packets. That's as precise as I've been able to be to date. We are not using a debug tool as of yet, so I can't be very precise. The code necessary to reproduce the problem would require Counterpoint and our application server be installed, which isn't feasible. Perhaps someone could look for changes in fread since 4.3.1 and see if there is a problem?