[PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

Frank Ch. Eigler fche@redhat.com
Wed Dec 8 15:32:10 GMT 2021


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, "Content-Type", "text/plain");
> +  if (r != NULL)
> +    {
> +      *size = os.size();
> +      add_mhd_response_header (r, "Content-Type", "text/plain");
> +    }

Why move the *size assignment in there?


> -  *size = version.size ();
> -  MHD_add_response_header (r, "Content-Type", "text/plain");
> +  if (r != NULL)
> +    {
> +      *size = version.size ();
> +      add_mhd_response_header (r, "Content-Type", "text/plain");
> +    }
>    return r;
>  }

ditto?


- FChE



More information about the Elfutils-devel mailing list