Re: [PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
On Wed, Dec 08, 2021 at 10:46:29AM -0500, Frank Ch. Eigler via Elfutils-devel wrote: > Hi - > > > > Why move the *size assignment in there? > > > > Because both statements are unnecessary if r == NULL (aka the response > > couldn't even be created). [...] > > But it is also harmless to do, so if

Re: [PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > > Why move the *size assignment in there? > > Because both statements are unnecessary if r == NULL (aka the response > couldn't even be created). [...] > But it is also harmless to do, so if you want I can move it outside the > if statement. OK, whichever, doesn't much matter then. - FChE

Re: [PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
Hi Frank, On Wed, 2021-12-08 at 10:32 -0500, Frank Ch. Eigler wrote: > except: > > > - *size = os.size(); > > - MHD_add_response_header (r, "Content-Type", "text/plain"); > > + if (r != NULL) > > +{ > > + *size = os.size(); > > + add_mhd_response_header (r, "Content-Type", "text/

Re: [PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > Although unlikely the MHD_add_response_header can fail for > various reasons. If it fails something odd is going on. > So check we can actually add a response header and log an > error if we cannot. Sure, if you insist. :-) except: > - *size = os.size(); > - MHD_add_response_header (r

[PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
Although unlikely the MHD_add_response_header can fail for various reasons. If it fails something odd is going on. So check we can actually add a response header and log an error if we cannot. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 12 debuginfod/debuginfod.cxx |