Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002060 [Quercus] minor always 10-10-07 17:53 10-17-07 13:26
Reporter koreth View Status public  
Assigned To mo
Priority normal Resolution fixed  
Status closed   Product Version 3.1.3
Summary 0002060: fseek() not supported on a socket stream
Description PHP's fseek() is supposed to be able to discard data on a socket. Test case part 1, run on command line to set up a listen socket that will spew out some data when you connect to it:

$ echo "1234567890" | nc -l -p 8000

Test case part 2:

<?php
$sock = fsockopen("127.0.0.1", "8000");
fseek($sock, 5, SEEK_CUR);
print fgets($sock);

Vanilla PHP prints "67890". Quercus throws an exception:

java.lang.UnsupportedOperationException: com.caucho.vfs.SocketStream
Additional Information
Attached Files

- Relationships

- Notes
(0002340)
mo
10-12-07 12:52

This test case generates the following stack trace:

java.lang.UnsupportedOperationException: com.caucho.vfs.SocketStream
        at com.caucho.vfs.StreamImpl.seekStart(StreamImpl.java:232)
        at com.caucho.vfs.ReadStream.setPosition(ReadStream.java:232)
        at com.caucho.quercus.lib.file.AbstractBinaryInputOutput.setPosition(AbstractBinaryInputOutput.java:259)
        at com.caucho.quercus.lib.file.AbstractBinaryInputOutput.seek(AbstractBinaryInputOutput.java:283)
        at com.caucho.quercus.lib.file.FileModule.fseek(FileModule.java:1593)


Attached is php/1m0p.qa, a rough draft regression test for this issue.
 
(0002353)
mo
10-16-07 17:54

This specific issue is now fixed.

php/1m0p.qa

Still, a couple of edge cases related to fread and ftell
on sockets remain.
 
(0002355)
mo
10-17-07 13:26

Added php/1m0q.qa, fseek now skipps over buffered bytes
when doing a seek forward.
 

- Issue History
Date Modified Username Field Change
10-10-07 17:53 koreth New Issue
10-12-07 12:52 mo Note Added: 0002340
10-12-07 12:52 mo File Added: 1m0p.qa
10-16-07 17:43 mo File Deleted: 1m0p.qa
10-16-07 17:43 mo Status new => assigned
10-16-07 17:43 mo Assigned To  => mo
10-16-07 17:54 mo Note Added: 0002353
10-17-07 13:26 mo Note Added: 0002355
10-17-07 13:26 mo Status assigned => closed
10-17-07 13:26 mo Resolution open => fixed
10-17-07 13:26 mo Fixed in Version  => 3.1.4


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
35 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker