<leafybasil>
I have been digging into the HTTP issue I mentioned the other night, mostly by dropping 'puts' throughout the code base to see what the path of execution is. I have noticed in some places a 'puts' appears not to get called but a 'raise' will indeed break as expected. Is there something about fibres that means it's possible they won't print to stdout?
<jhass>
not immediately, yes
<jhass>
LibC.write(2, "foo") if you need raw, blocking, possibly breaking access to stdout
<jhass>
though actually I'm not sure the client does even spawn?
asie has quit [Ping timeout: 252 seconds]
<leafybasil>
jhass: You may be right, I'm asking for general knowledge, I always assumed previously that 'puts' would ALWAYS write to stdout
asie has joined #crystal-lang
<jhass>
well it does, just buffered
<leafybasil>
jhass: also at this point I'm actually in OpenSSL::SSL::Socket :(
<jhass>
oh
<jhass>
maybe you hit IO#puts ?
<leafybasil>
jhass: Okay so it's buffered but potentially you could encounter an error or issue before the output is made visible?
<jhass>
use STDOUT.puts there
<leafybasil>
Ah... I will give that a shot
<leafybasil>
jhass: you were 100% correct of course
<leafybasil>
STDOUT.puts does what's expected
<BlaXpirit>
wow what an annoying error :( never liked implicit method calls
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
<crystal-gh>
[crystal] mirek opened pull request #2669: Update doc for `IO#read_bytes`. (master...io-read-bytes-doc) https://git.io/vr9Qk
<leafybasil>
I think it's fair to say I'm out of my depth, knowing little about crystal and little about SSL socket implementation, I'll take the blame :D
grios has quit [Remote host closed the connection]
<jhass>
leafybasil: btw still happy to help out if you can provide a way to reproduce
<leafybasil>
jhass: I can def do that with a repo, I just really wanted to learn how to do a portion of it and I was worried about wasting your time with some fringe-issue
<jhass>
ah no worries
<leafybasil>
I will likely give up once I've spent an hour or two on it, and ask for your help
Philpax has quit [Ping timeout: 244 seconds]
A124 has quit [Quit: '']
A124 has joined #crystal-lang
|meta has quit [Quit: Connection closed for inactivity]
<crystal-gh>
[crystal] ysbaddaden opened pull request #2671: TLS server improvements (master...tls-improvements) https://git.io/vr9b4
A124 has quit [Ping timeout: 244 seconds]
steenuil has joined #crystal-lang
Ven has joined #crystal-lang
dhk has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
pawnbox has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
<BlaXpirit>
if I have a big case statement, is it possible to generate some of its branches with a macro?
Raimondii is now known as Raimondi
<jhass>
their contents, a when Foo; bar is not a valid expression in itself
<jhass>
so branch contents or the entire thing
<jhass>
you probably could take the whole one and append some branches in a macro
<BlaXpirit>
jhass, I just realized, I can wrap the case statement in {%begin%} {%end%}
<BlaXpirit>
and do whatever I want inside it
<jhass>
mh, right
<BlaXpirit>
sigh, literals don't properly work in macros. %r(stuff) turns to __temp_138(stuff)
A124 has joined #crystal-lang
leogouveia has joined #crystal-lang
A124 has quit [Ping timeout: 244 seconds]
<jhass>
escape it?
<BlaXpirit>
yes, took me some time to realize \%r
<BlaXpirit>
i don't think it's in the docs though
A124 has joined #crystal-lang
<jhass>
maybe we need another char for macro vars
<BlaXpirit>
i dunno, % is pretty good
<BlaXpirit>
rarely used and memorable
<jhass>
mmh, how do you do a § on a us keyboard?
pawnbox has quit [Read error: Connection reset by peer]
pawnbox_ has joined #crystal-lang
<BlaXpirit>
jhass, Ctrl+C, then Ctrl+V :D
<jhass>
heh
<jhass>
explains why it's never used I guess
<BlaXpirit>
jhass, it's non-ASCII
<jhass>
oh
<jhass>
curious how it's shift-3 on german keyboards
<jhass>
:D
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vr9hf
<crystal-gh>
crystal/master 68d587e Ary Borenszweig: Formatter: fixed wrong indent after comma followed by comment, in elements list. Fixes #2670