1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: HTTP PUT Request - StreamDevice |
From: | Zimoch Dirk via Tech-talk <tech-talk at aps.anl.gov> |
To: | Kyle Hesse <hesse at jlab.org> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 16 Sep 2024 07:44:17 +0000 |
Hi Kyle,
No, currently there is no string length function in StreamDevice. Even if I could implement one using the e.g. checksum support, the result would be available only after outputting the content, not before.
If your hostname does not have a constant length, which would allow to use a constant Content-Length value, you may store your hostname in an lso record instead of a stringout record. The lso record has a field LEN which contains the string length. However,
you would need to add 4 to LEN for the quotes and the terminator. That makes stuff a bit complicated. You would need a calc record to read LEN and add 4 and only then have another record (lso or stringout) to read the string from the first one via DOL and
pass it to StreamDevice. Only this way, the calc record can calculate the final length, before StreamDevice is called.
BTW: I would not use "%*s" to read the (any) reply but instead something like "HTTP%*s 200 %*s" to ensure a success reply code 200.
Dirk
|