Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:47
    straight-shoota closed #12051
  • 13:47
    straight-shoota closed #12050
  • 12:17
    beta-ziliani edited #7318
  • May 15 08:43
    r00ster91 closed #7318
  • May 15 08:17
    r00ster91 closed #7690
  • May 14 17:01
    Blacksmoke16 labeled #11995
  • May 14 13:03
    webhive closed #12055
  • May 14 10:19
    straight-shoota milestoned #12051
  • May 14 10:00
    I3oris edited #12051
  • May 14 08:45
    oprypin review_requested #11977
  • May 13 23:29
    Blacksmoke16 unlabeled #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 opened #12061
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota opened #12060
Elias Perez
@eliasjpr
I hate using exception for my case, and break just exits the current method, when I really want to do is jump to a different flow
maybe that’s a feature request?
From IRC (bridge bot)
@FromIRC
<Papierkorb> That feature is barely needed, and would potentionally be hard to do - Not even speaking of doing it right
<Papierkorb> If "doing it right" is even possible
Elias Perez
@eliasjpr
interesting, I gues the dynamic nature of ruby allow this to be done more easily
Johannes Müller
@straight-shoota
That might be a factor... but I'm not sure if it would be too difficult to add to Crystal . But as I understand it, it is deliberately not a thing because there is no real usecase and it makes things unnecessarily complicated.
Elias Perez
@eliasjpr
@straight-shoota is there any documentation of the lifecycle when an exception is raised?
Johannes Müller
@straight-shoota
sorry, I don't know
Johannes Müller
@straight-shoota
Elias Perez
@eliasjpr
@straight-shoota thanks reading
Isaac Sloan
@elorest
has anyone expirienced an issue where context.response.headers don’t all end up in the headers from curl or the browser. Sort of sporatically.
From IRC (bridge bot)
@FromIRC
<bmcginty> Anyone here have issues detecting closed sockets? I'm trying to check to see if a persistent connection is still alive, and I can't figure out when/what is supposed to be returned when the remote end of a socket closes.
<bmcginty> @elorest: I was seeing weird http stuff last week...weird enough that I'm trying to write/use my own to figure out what was going on. Though mine has just been in the client.
Isaac Sloan
@elorest
k
From IRC (bridge bot)
@FromIRC
<oprypin> @elorest, hopefully you aren't putting broken strings with arbitrary bytes in there?
kipar
@konovod
.
Isaac Sloan
@elorest
<oprypin> Nope.
Serdar Dogruyol - Sedo セド
@sdogruyol
Good morning everyone
Isaac Sloan
@elorest
Morning.
Isaac Sloan
@elorest
<oprypin> For some reason if the body is even moderately large(~200 elements) it changes to chunked mode and overwrites the existing headers with
< HTTP/1.1 200 OK
< Connection: keep-alive
< Transfer-Encoding: chunked
If I reduce the size of the http body all of my headers get sent.
And my cookies get set in my browser.
From IRC (bridge bot)
@FromIRC
<shelvacu> Is it a consistent size that changes it? Maybe 4k bytes or something?
Isaac Sloan
@elorest
Working one with smaller body.
< HTTP/1.1 200 OK
< Connection: keep-alive
< Set-Cookie: test_session=eyJjc3JmLnRva2VuIjoiSlFMdGVzTXFmUzBwZDlXYmVSSkpMVUtmbGFzME93eEFINkNrRHlXYkNUMCIsIl9mbGFzaCI6IntcImZsYXNoZXNcIjp7fSxcImRpc2NhcmRcIjpbXX0ifQ%3D%3D--OPgRdhc%2BbD0AQp1Xz88kvrQ%2Fwj4%3D; path=/; HttpOnly
< Content-Length: 6680
Same url.
I’ll try to find the content lenght where it breaks.
From IRC (bridge bot)
@FromIRC
<shelvacu> Do you have some code that reliably reproduces it?
Isaac Sloan
@elorest
Yes.
From IRC (bridge bot)
@FromIRC
<shelvacu> You should definitely file a bug report.
<shelvacu> Or post the code here so I can file such a report
Isaac Sloan
@elorest
Content-Length: 8191 works but one more character in the body and it goes to chunked and doesn’t send headers.
From IRC (bridge bot)
@FromIRC
<shelvacu> https://github.com/crystal-lang/crystal/blob/f026c474450176ff1b86293bf0abc6afdc497137/src/http/common.cr#L157 seems the most likely culprit but I don't see how that would cause any problems.
<shelvacu> deflate compression lib and stdlib buffered io both use a buffer size of 8192
<shelvacu> 1
Isaac Sloan
@elorest
Yeah I’m finding stuff about that number everywhere. As far as html pages are concerned it’s not really that big.
I believe that chunking after that size is appropriate. I just tested a couple rails sites. They also chuck after 8191 but they don’t delete my headers in the process.
From IRC (bridge bot)
@FromIRC
<bmcginty> @oprypin: It's with sockets that I'm having the issue. Straight reading from them times out (while checking to see if .read returns 0).
Bar Hofesh
@bararchy
bmcginty: Can you share a code exmaple ?
From IRC (bridge bot)
@FromIRC
<oprypin> bmcginty, no difference
<oprypin> sockets when explicitly closed will get you 0. but detecting remote socket going away is not reliable, hence timeout
From IRC (bridge bot)
@FromIRC
<bmcginty> @oprypin: thanks.
Andrés Pérez
@code-andres

Hi, everyone... I'm stuck using concurrency for a simple logger...

I have a Process, a spawn where the output is print and i want to use another spawn where each 3 seconds for example, kill the old Process and send the new one to the first spawn, I was trying with channels but the spawn must wait for a send.

In little words, is there a way to create just a "listener"between spawns without wait for it?

Bar Hofesh
@bararchy
Buffered Channel maybe ?
Cris Ward
@crisward
Can anyone explain to me what this does
Signal::PIPE.trap do
  # some code
end
Akzhan Abdulin
@akzhan
This is signal handler. They interrupts process execution for some events.
Many operating systems allow signals to be sent to running processes. Some signals have a defined effect on the process, while others may be trapped at the code level and acted upon. For example, your process may trap the USR1 signal and use it to toggle debugging, and may use TERM to initiate a controlled shutdown.
this is citation from Ruby doc :)
And usually should to set ignore on PIPE signal.
Cris Ward
@crisward
@akzhan Thanks... I was using this around a socket.send as I was getting application crashes when the remote end disconnected mid message. However it seems to stop the sockets sending altogether. I can't remember what the exception was.