[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Bug in example.
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Bug in example. |
Date: |
Thu, 26 Feb 2009 18:07:12 -0700 |
User-agent: |
KMail/1.9.9 |
Thank you, I've fixed these in SVN 8293 as suggested. Also, note
that "upload_data_size" should be of type "size_t *", not "unsigned int*" as
the examples (unfortunately) still suggested.
Best regards,
Christian
On Thursday 26 February 2009 12:02:00 pm Timothy Schaeffer wrote:
> There is a bug in fileserver_example.c. I had copied this as a template
> for my own code and ran into this bug.
>
> I didn't notice this until a small tcl test client program I modified from
> the web was sending HTTP/1.0 request to my server, causing it to SEGFAULT.
> HTTP/1.1 requests worked fine. When I wrote in code to reject 1.0 requests,
> the version parm was blank. Then I noticed that the argument order was
> wrong.
>
> I do not yet know if the SEGFAULT was caused by my code, the MHD library,
> or the avcodec library (I'm creating a video stream server over HTTP as
> part of a larger application), but rejecting 1.0 requests seems to fix it.
>
> The library is great, BTW. Thanks.
>
> Tim S.
>
> Index: src/examples/fileserver_example.c
> ===================================================================
> --- src/examples/fileserver_example.c (revision 8292)
> +++ src/examples/fileserver_example.c (working copy)
> @@ -43,8 +43,8 @@
> struct MHD_Connection *connection,
> const char *url,
> const char *method,
> - const char *upload_data,
> - const char *version, unsigned int *upload_data_size, void **ptr)
> + const char *version,
> + const char *upload_data, unsigned int *upload_data_size, void
> **ptr) {
> static int aptr;
> struct MHD_Response *response;
> Index: src/examples/fileserver_example_external_select.c
> ===================================================================
> --- src/examples/fileserver_example_external_select.c (revision 8292)
> +++ src/examples/fileserver_example_external_select.c (working copy)
> @@ -43,8 +43,8 @@
> struct MHD_Connection *connection,
> const char *url,
> const char *method,
> - const char *upload_data,
> - const char *version, unsigned int *upload_data_size, void **ptr)
> + const char *version,
> + const char *upload_data, unsigned int *upload_data_size, void
> **ptr) {
> static int aptr;
> struct MHD_Response *response;
> Index: src/examples/https_fileserver_example.c
> ===================================================================
> --- src/examples/https_fileserver_example.c (revision 8292)
> +++ src/examples/https_fileserver_example.c (working copy)
> @@ -111,8 +111,8 @@
> struct MHD_Connection *connection,
> const char *url,
> const char *method,
> - const char *upload_data,
> - const char *version, size_t *upload_data_size, void **ptr)
> + const char *version,
> + const char *upload_data, size_t *upload_data_size, void **ptr)
> {
> static int aptr;
> struct MHD_Response *response;
> _______________________________________________
> libmicrohttpd mailing list
> address@hidden
> http://lists.cs.du.edu/mailman/listinfo/libmicrohttpd
--
Christian Grothoff
Assistant Professor
Department of Computer Science
University of Denver