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
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.
I think someone on here suggested it, I added it a while ago, but just realised it's actually preventing the sockets being sent.
From IRC (bridge bot)
@FromIRC
<oprypin> @crisward, putting code inside signal.trap doesn't mean wrapping it, the code actually won't run. the code will run when the corresponding signal is received
<oprypin> so the suggestion to use that probably meant something different
Cris Ward
@crisward
oprypin - so it's like a rescue on begin, rescue ? Should I therefore just do this once globally ? Or once before every socket.send ? Perhaps I'll take a look at the ruby docs.
From IRC (bridge bot)
@FromIRC
<oprypin> once globally
<oprypin> not yet released docs
Cris Ward
@crisward
@oprypin Thanks! Never thought of looking in the docs on master.
From IRC (bridge bot)
@FromIRC
<oprypin> well sure, there's almost never a reason for that
From IRC (bridge bot)
@FromIRC
<RX14> i got a segfault in the compiler while investigating a segfault in a program
<RX14> which is nice
From IRC (bridge bot)
@FromIRC
<RX14> my segfault disappears under gdb :⁠ok_hand:
From IRC (bridge bot)
@FromIRC
<RX14> so somehow this generated code is ignoring the calling conventions and overwriting rbx
<RX14> ok so it's stack corruption
<RX14> damnit
From IRC (bridge bot)
@FromIRC
<oprypin> sounds pleasant