11 Commits

Author SHA1 Message Date
582bc2890a * libwget/thread.c: Return a value in dummy wget_thread_cancel()
Reported-by: Gisle Vanem
2016-12-15 11:22:22 +01:00
8366ead860 * libwget/thread.c: Add missing wget_thread_cancel() dummy 2016-11-08 22:34:03 +01:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
c6590e3433 Use pthread_cancel to kill a thread
* include/libwget.h.in: Export new function wget_thread_cancel to kill
an existing thread nicely.
* libwget/thread.c: Same
* src/bar.c: Use the cleaner wget_thread_cancel() method to kill the
progress bar instead of polling for a variable.
2016-09-16 16:37:03 +02:00
79dd277c12 Refactoring to separate send, receive and HTTP state machine
* examples/websequencediagram.c (main): Call wget_http_request_set_body()
  and wget_http_send_request() instead of wget_http_send_request_with_body().
* include/libwget.h.in: Add WGET_HTTP_USER_DATA, wget_get_timemillis(),
  extend wget_thread_cond_wait(), add body, user_data, body_length to
  wget_http_request_t, remove wget_http_send_request_with_body(),
  add wget_http_request_get_int(), wget_http_request_set_ptr(),
  wget_http_request_get_ptr(), wget_http_request_set_body().
* libwget/http.c: Add wget_http_request_get_int(),
  wget_http_request_set_ptr(), wget_http_request_get_ptr(),
  wget_http_request_set_body(),
  remove wget_http_send_request_with_body(),
  (wget_http_request_to_buffer): add body to request buffer.
* libwget/http_highlevel.c (wget_http_get): Replace
  wget_http_send_request_with_body()
* libwget/iri.c: Use c-ctype.h instead of ctype.h
  (wget_iri_parse): Allow any numbers of / after scheme:
  (wget_iri_parse): Catch URIs without /after scheme:
* libwget/list.c (wget_list_browse): Small code rearrangement
* libwget/metalink.c (_add_mirror): Check mirror.iri for NULL
* libwget/ssl_gnutls.c (send_ocsp_request): Replace
  wget_http_send_request_with_body()
* libwget/thread.c (wget_thread_cond_signal): Add timeout param
* libwget/utils.c: New function wget_get_timemillis()
* src/blacklist.c: Include wget.h instead of log.h
* src/blacklist.h: Fix indentation
* src/host.c: Add queueing stuff
* src/host.h: Reflect changes in host.c
* src/job.c: Remove queueing stuff
* src/job.h: Reflect changes in job.c
* src/log.c: Sync stdout/stderr to correct output order
* src/log.h: Remove shortcuts of print functions
* src/wget.c: Remove download_part() and http_get().
  Add http_send_request(), http_receive_response(), try_connection(),
  establish_connection(), add_statistics(), process_response_header().
  Amend downloader_thread() to reflect the changes.
* src/wget.h: Add shortcut defines for print functions.
* tests/libtest.c (_http_server_thread): Fix compiler warning,
  fix debug message.
  New function _write_msg() to print server messages yellow.
  (wget_test) Add -d to wget command line.
* tests/test-metalink.c (main): Add tests for V3 and V4 metalink
  files read from command line (-i, --force-metalink)
* tests/test.c (test_iri_parse): Add test for slash-less mailto: URI
2016-07-11 14:53:36 +02:00
f17bcd4a7d Cosmetics
* libwget/thread.c: Fix comment after #endif
* src/wget.c (main): Remove unwanted spaces in if clause
2016-02-03 10:21:56 +01:00
2c9f5945f5 Honor --disable-threads and support no threading
* include/libwget.h.in: Include <stdbool.h>.
Define wget_thread_support().
* libwget/thread.c: Change condition to check
for threading support.
(wget_thread_support): New function.
(wget_thread_start): [!USE_POSIX_THREADS && !USE_PTH_THREADS]
Invoke directly the function.
* src/wget.c (main): If no threads are supported then set the
number of max threads to 1.  If the queue is not empty, call again the
downloader function.  It will be used only in case no threads are
available.
(downloader_thread): Do not wait for new elements in the queue
when there are no threads.
* tests/libtest.c (wget_test_start_server): Skip the test if
there is no threads support.
2016-02-02 18:45:17 +01:00
dd3c2f63b2 Updated copyright year for all relevant files 2016-01-25 13:06:21 +01:00
17e8be5c68 Remove libpthread check from configure.ac
* configure.ac: Remove check for libpthread
* include/libwget.h.in: Check HAVE_PTHREAD_H,
  Do not undefine gettext
* libwget/thread.c: Check HAVE_PTHREAD_H

This check is done by gnulib 'pthread' module.
2016-01-22 14:33:49 +01:00
0f8e49128a Transfer copyright to Free Software Foundation, Inc. 2015-09-22 11:50:06 +02:00
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00