Re: A GET followed by a PUT Crashes LIBWWW.

Michael Saunders wrote:

> I put together an example program based on the "LoadToFile" and "put" example
> programs. This program simply performs the equivalent of the "LoadToFile"
> example program and then performs the equivalent of the "put" example program.
> Libwww is initialized and finalized before each download or upload.
> 
> When I run this on my SGI the program downloads the file correctly but the put
> gets stuck for about 15 seconds and then it crashes in the library with a
> segmentation fault.
> 
> This small program is an good example of the problems I have been having with
> the library so I hope it also crashes on your platform and is evident to you
> what is going on.

>     case HT_PROG_DONE:
>         sprintf(Message, "%s", "Complete");
>         fprintf(stdout, "%s\n", Message);
> 
>         /* all done: indicate that we want to exit the library's event loop */

This seems to be the problem:
>         HTEventList_stopLoop();

The PUT operation works in this way:

	- it first does a normal GET on the source
	- then it does a PUT of the document it just fetched

The progress calls are called on both accounts but here the event loop
is stopped and the operation stops prematurely.

Instead, I would register a terminate handler (used in almost all sample
apps). This is only called once when the request is truely done.

-- 
Henrik Frystyk Nielsen, <frystyk@w3.org>
World Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA

Received on Tuesday, 29 June 1999 17:58:09 UTC