Issue 5187 in pharo: DNU while downloading mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 5187 in pharo: DNU while downloading mcz

pharo
Status: Accepted
Owner: [hidden email]

New issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

When executing the following:

Gofer new
  url: 'http://dsal.cl/squeaksource/MonticelloRedirect';
  package: 'MontiRedirect';
  load.

in a 1.4 #14283


16 January 2012 3:18:08 pm

VM: unix - i686 - linux-gnu - CoInterpreter VMMaker-oscog-IgorStasenko.108  
uuid: 384f4108-f1f4-4954-8357-0b3005cb81e2 Jul 22 2011,  
StackToRegisterMappingCogit VMMaker-oscog-IgorStasenko.108 uuid:  
384f4108-f1f4-4954-8357-0b3005cb81e2 Jul 22 2011,  
https://git.gitorious.org/cogvm/blessed.git Commit:  
fde60cf1a440cd0ba4c56470dffff4aafc664d88 Date: Fri Jul 22 14:16:11 2011  
+0200 By: Igor Stasenko <[hidden email]>
Image: Pharo1.4a [Latest update: #14283]

Character(Object)>>doesNotUnderstand: #bitOr:
        Receiver: Character value: 0
        Arguments and temporary variables:
                aMessage: bitOr: 0
                exception: MessageNotUnderstood: Character>>bitOr:
                resumeValue: nil
        Receiver's instance variables:
                value: 0

SmallInteger>>bitOr:
        Receiver: 0
        Arguments and temporary variables:
                arg: Character value: 0
        Receiver's instance variables:
0

ReadStream(PositionableStream)>>nextLittleEndianNumber:
        Receiver: a ReadStream
        Arguments and temporary variables:
                n: 2
                bytes: '


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo
Updates:
        Labels: Milestone-1.4

Comment #1 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

In 1.3 it works, and the only difference I found is in:

(From 1.3)
readStreamForFileNamed: aString do: aBlock
        | contents |
        self displayProgress: 'Downloading ', aString during: [
        contents := HTTPSocket httpGet: (self urlForFileNamed: aString) args: nil  
user: self user passwd: self password].
        ^ contents isString ifFalse: [aBlock value: contents]

which returns a RWBinaryOrTextStream

(From 1.4)
readStreamForFileNamed: aString do: aBlock
        | contents |
        self displayProgress: 'Downloading ', aString during: [
                contents := ZnClient new
                        systemPolicy;
                        beOneShot;
                        signalProgress: true;
                        username: self user password: self password;
                        get: (self urlForFileNamed: aString) ].
        ^ aBlock value: contents readStream

which returns a ReadStream


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo

Comment #2 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

The latest method was in MCHttpRepository.

I've replaced it by the following and it worked:

readStreamForFileNamed: aString do: aBlock
        | contents |
        self displayProgress: 'Downloading ', aString during: [
                contents := ZnClient new
                        systemPolicy;
                        beOneShot;
                        signalProgress: true;
                        username: self user password: self password;
                        get: (self urlForFileNamed: aString) ].
        ^ aBlock value: (RWBinaryOrTextStream with: contents)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo
Updates:
        Status: FixReviewNeeded

Comment #3 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

a Proposed fix

Attachments:
        Issue 5187: DNU while downloading mcz.1.cs  521 bytes


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo
Updates:
        Cc: [hidden email]

Comment #4 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo

Comment #5 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

I didn't try, but I guess http://dsal.cl/squeaksource serves its files as  
text not as binary, that is why you need to wrap it in a  
RWBinaryOrTextStream. Zn correctly honors that difference, HTTPSocket did  
not. .mcz files are binary and should be served as such.

Maybe a possible fix would be to test the type of contents:

^ aBlock value: (contents isString ifTrue: [ RWBinaryOrTextStream with:  
contents ] ifFalse: [ contents readStreamm ])


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo

Comment #6 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

I did try, and yes I was right, its is binary data served as text.

Inspect

   ZnEasy  
get: 'http://dsal.cl/squeaksource/MonticelloRedirect/MontiRedirect-johanfabry.1.mcz'

to see what I mean.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo

Comment #7 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

I've uploaded a slice adding also:

        self flag: #hack. "the if below is a hack to binarize the contents if they  
are served as simple text"

Maybe we do not want to integrate this and ask the people from chile to  
serve the file as binary :).

Name: SLICE-Issue-5187-DNU-while-downloading-mcz-GuillermoPolito.1
Author: GuillermoPolito
Time: 17 January 2012, 11:38:40 am
UUID: efc9fa6c-a857-463b-a378-6604610745b6
Ancestors:
Dependencies: Monticello-GuillermoPolito.552

a proposed hack to allow text streams


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo

Comment #8 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

In response to Guille's comment of: Maybe we do not want to integrate this  
and ask the people from chile to serve the file as binary :).

Done :-) The file is now served as application/octet-stream. Please tell me  
if it works.

Thanks to Sven for pointing the issue out to me.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo

Comment #9 on issue 5187 by [hidden email]: DNU while downloading mcz
http://code.google.com/p/pharo/issues/detail?id=5187

It works for me.

Thx a lot, Johan!


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5187 in pharo: DNU while downloading mcz

pharo
Updates:
        Status: Closed

Comment #10 on issue 5187 by [hidden email]: DNU while downloading  
mcz
http://code.google.com/p/pharo/issues/detail?id=5187

Yay!! thanks a lot Johan! :D


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker