IRC channel logs

2022-05-11.log

back to list of logs

<stis>and if you remove call-with-blocked-asyncs
<stis>a string port is a soft port no?
<rekado_> https://elephly.net/paste/1652220210.html
<rekado_>FWIW, I tried to use (http-head url #:streaming? #t) because I don’t need the body, but I wasn’t successful
<rekado_>this seems to work but makes my skin crawl: https://elephly.net/paste/1652220660.html
<stis>what, do you know why?
<rekado_>no idea; I’ll have to investigate more tomorrow.
<rekado_>thanks for your help!
*rekado_ —> zzZZ
<stis>zzz indeed
<stis>sneek: later tell rekado_ did you use https (tls uses soft ports and does not work with fibers)
<sneek>Okay.
<stis>sneek: later tell rekado did you use https (tls uses soft ports and does not work with fibers)
<sneek>Okay.
<stis>sneek: later tell rekado_ when you run the blocking code you miss the suspension entirely as it is "blocks" that's why it works
<sneek>Will do.
<stis>sneek: later tell rekado when you run the blocking code you miss the suspension entirely as it is "blocks" that's why it works
<sneek>Okay.
<stis>soft ports sucks!
<lilyp>we need suspendable soft ports
*janneke attempts to forward-port wip-mingw
<rekado>stis: right, the http-head is blocking when the suspendable ports are disabled
<sneek>Welcome back rekado, you have 4 messages!
<sneek>rekado, stis says: did you use https (tls uses soft ports and does not work with fibers)
<sneek>rekado, stis says: did you use https (tls uses soft ports and does not work with fibers)
<sneek>rekado, stis says: when you run the blocking code you miss the suspension entirely as it is "blocks" that's why it works
<sneek>rekado, stis says: when you run the blocking code you miss the suspension entirely as it is "blocks" that's why it works
<rekado>I just wonder if it’s safe to do this: uninstall-suspendable-ports!, do something, install-suspendable-ports!.
<rekado>the fibers web server installs suspendable ports initially.
<rekado>I wonder if I’m breaking things when I temporarily uninstall suspendable ports.
<rekado>if the only downside is that temporarily everything is blocking then that’s okay, I guess.
<stis>rekado, if you do not use suspendable ports than port operations will block. Essentially no problem for small messages. But for large ones you can get stalls
<stis>rekado: ^^
<stis>we really should have suspendable soft ports.
<civodul>rekado: i wouldn't try to temporarily uninstall/reinstall suspendable ports
<civodul>the "session record ports" of GnuTLS can be made suspendable IIRC
<civodul>they implement the method (in C) for that
<civodul>yeah, scm_set_port_read_wait_fd
<civodul>but to benefit from that, you must use set-session-transport-fd! rather than session-session-transport! (the latter takes a port and the end result is not suspendable)
<stis>civodul: TLS itself is suspendable, but the client implements a soft port to handle https requests, so that is defiend in client.xml in web
<stis>rekado: ^^
<stis>I'm working on getting soft ports suspendable now.
<civodul>stis: for chunked-encoding ports you mean, right?
<rekado>civodul: is this something I can fix via monkey-patching or does it need a proper fix in Guile?
*civodul looks
<civodul>so yes, there's tls-wrap in (web client) that returns a custom i/o port, which is not suspendable
<stis>civodul: that's also a use case of the soft-ports, but it is also used when using tls, a really nice soilution if soft-ports where suspendable
<civodul>by "soft ports", you mean R6 custom i/o ports, right?
<civodul>rekado: before calling http-head, you could call peek-u8, which is suspendable
<stis>most likely yes,
<civodul>rekado: that way, http-head is less likely to block
<stis>you correctly mensioned them regarding the chunked stuff
<stis>make-custom-binary-input/output-port "gnutls wrapped port
<civodul>yes
<rekado>civodul: I’m not sure I follow. Call peek-u8 on what?
<civodul>rekado: actually i have very little context :-), but i guess you could (1) open-socket-for-uri or whatever it's called, (2) peek-u8 on that port, and (3) http-head on that port
<civodul>does that make sense?
<rekado>yes, thanks!
<rekado>I’m literally just using the fiberized web server and call http-head in a handler.
<rekado>so I’m not “actively” using fibers. All that fibery goodness is handled by the web server.
<civodul>ok
<civodul>which fiberized server though?
<civodul>the one in Cuirass?
<rekado>(fibers web server)’s run-server.
*janneke mostly ported wip-mingw to 3.0.8
<stis> https://gitlab.com/tampe/guile-persist/-/blob/master/ice-9/soft-suspendable-ports.scm
<stis> https://gitlab.com/tampe/guile-persist/-/blob/master/ice-9/soft-port.scm
<stis>My take on suspendable soft ports.
<stis>use soft-suspendable-ports as suspendable-ports should work the same but will now also work for a kind of soft port (the second lib)
<stis>This needs testing
<stis>help appriciated
<janneke>/gnu/store/l1hhsk9paf1hk318377s8nh169q6nijr-guile-mingw-3.0.8-18.4b3162a