[racket] bug?

From: Jordan Schatz (jordan at noionlabs.com)
Date: Wed Jun 29 19:25:39 EDT 2011

> Looks like some issue at the ssl level.
I've tried to track it down, but with no luck. I'm in over my head.  

curl https://mtgox.com/code/ticker.php
Works. Curl is using openssl, and the same version, so I think its in how
we are using the openssl library. Other then that, I have no idea.


On Mon, Jun 27, 2011 at 03:19:36AM -0400, Eli Barzilay wrote:
> 8 hours ago, Jordan Schatz wrote:
> > I'm not sure if this is considered a bug in racket or in the SSL
> > implementation at mtgox.com.  The mtgox url does work fine for me
> > via curl/wget etc.  As far as I can tell when racket tries to
> > retrieve the mtgox url everything starts off fine: the TLS handshake
> > happens, then the request is sent and application data retrieved,
> > but after that it just hangs.
> Looks like some issue at the ssl level.  If I run this code:
>   #lang racket
>   (require openssl/mzssl)
>   (define-values [i o] (ssl-connect "mtgox.com" 443 'sslv2-or-v3))
>   (fprintf o "GET /code/data/ticker.php HTTP/1.0\r\nHost: mtgox.com\r\n\r\n")
>   (close-output-port o)
>   (let loop ()
>     (define c (read-char i))
>     (unless (eof-object? c) (write-char c) (flush-output) (loop)))
> I see the same problem.  Similarly for other bogus inputs (like a bad
> path or a bogus HTTP version) -- *but*, if I drop the "HTTP/1.0", or
> even change it to "HTTP", then instead of hanging I get
>   tcp-read: error reading (Connection reset by peer; errno=104)
> -- 
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                     http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.