mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-21 11:42:56 +03:00
Move fetcher_fdset to fetch.h (and rename to fetch_fdset). Maybe not ideal but better
This commit is contained in:
parent
767b73f5c7
commit
47ccd9855d
@ -379,8 +379,9 @@ fetcher_add(lwc_string *scheme, const struct fetcher_operation_table *ops)
|
|||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exported interface documented in content/fetchers.h */
|
/* exported interface documented in content/fetch.h */
|
||||||
nserror fetcher_fdset(fd_set *read_fd_set,
|
nserror
|
||||||
|
fetch_fdset(fd_set *read_fd_set,
|
||||||
fd_set *write_fd_set,
|
fd_set *write_fd_set,
|
||||||
fd_set *except_fd_set,
|
fd_set *except_fd_set,
|
||||||
int *maxfd_out)
|
int *maxfd_out)
|
||||||
|
@ -210,5 +210,30 @@ const char *fetch_get_referer_to_send(struct fetch *fetch);
|
|||||||
*/
|
*/
|
||||||
void fetch_set_cookie(struct fetch *fetch, const char *data);
|
void fetch_set_cookie(struct fetch *fetch, const char *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the set of file descriptors the fetchers are currently using.
|
||||||
|
*
|
||||||
|
* This obtains the file descriptors the fetch system is using to
|
||||||
|
* obtain data. It will cause the fetchers to make progress, if
|
||||||
|
* possible, potentially completing fetches before requiring activity
|
||||||
|
* on file descriptors.
|
||||||
|
*
|
||||||
|
* If a set of descriptors is returned (maxfd is not -1) The caller is
|
||||||
|
* expected to wait on them (with select etc.) and continue to obtain
|
||||||
|
* the fdset with this call. This will switch the fetchers from polled
|
||||||
|
* mode to waiting for network activity which is much more efficient.
|
||||||
|
*
|
||||||
|
* \note If the caller does not subsequently obtain the fdset again
|
||||||
|
* the fetchers will fall back to the less efficient polled
|
||||||
|
* operation. The fallback to polled operation will only occour after
|
||||||
|
* a timeout which introduces additional delay.
|
||||||
|
*
|
||||||
|
* \param[out] read_fd_set The fd set for read.
|
||||||
|
* \param[out] write_fd_set The fd set for write.
|
||||||
|
* \param[out] except_fd_set The fd set for exceptions.
|
||||||
|
* \param[out] maxfd The highest fd number in the set or -1 if no fd available.
|
||||||
|
* \return NSERROR_OK on success or appropriate error code.
|
||||||
|
*/
|
||||||
|
nserror fetch_fdset(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, int *maxfd);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,30 +129,4 @@ nserror fetcher_init(void);
|
|||||||
void fetcher_quit(void);
|
void fetcher_quit(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the set of file descriptors the fetchers are currently using.
|
|
||||||
*
|
|
||||||
* This obtains the file descriptors the fetch system is using to
|
|
||||||
* obtain data. It will cause the fetchers to make progress, if
|
|
||||||
* possible, potentially completing fetches before requiring activity
|
|
||||||
* on file descriptors.
|
|
||||||
*
|
|
||||||
* If a set of descriptors is returned (maxfd is not -1) The caller is
|
|
||||||
* expected to wait on them (with select etc.) and continue to obtain
|
|
||||||
* the fdset with this call. This will switch the fetchers from polled
|
|
||||||
* mode to waiting for network activity which is much more efficient.
|
|
||||||
*
|
|
||||||
* \note If the caller does not subsequently obtain the fdset again
|
|
||||||
* the fetchers will fall back to the less efficient polled
|
|
||||||
* operation. The fallback to polled operation will only occour after
|
|
||||||
* a timeout which introduces additional delay.
|
|
||||||
*
|
|
||||||
* \param[out] read_fd_set The fd set for read.
|
|
||||||
* \param[out] write_fd_set The fd set for write.
|
|
||||||
* \param[out] except_fd_set The fd set for exceptions.
|
|
||||||
* \param[out] maxfd The highest fd number in the set or -1 if no fd available.
|
|
||||||
* \return NSERROR_OK on success or appropriate error code.
|
|
||||||
*/
|
|
||||||
nserror fetcher_fdset(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, int *maxfd);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -108,7 +108,7 @@
|
|||||||
#include "netsurf/cookie_db.h"
|
#include "netsurf/cookie_db.h"
|
||||||
#include "netsurf/url_db.h"
|
#include "netsurf/url_db.h"
|
||||||
#include "content/backing_store.h"
|
#include "content/backing_store.h"
|
||||||
#include "content/fetchers.h"
|
#include "content/fetch.h"
|
||||||
#include "desktop/browser_history.h"
|
#include "desktop/browser_history.h"
|
||||||
#include "desktop/hotlist.h"
|
#include "desktop/hotlist.h"
|
||||||
#include "desktop/version.h"
|
#include "desktop/version.h"
|
||||||
@ -2788,7 +2788,7 @@ void ami_get_msg(void)
|
|||||||
uint32 signalmask = winsignal | appsig | schedulesig | rxsig |
|
uint32 signalmask = winsignal | appsig | schedulesig | rxsig |
|
||||||
printsig | applibsig | helpsignal;
|
printsig | applibsig | helpsignal;
|
||||||
|
|
||||||
if ((fetcher_fdset(&read_fd_set, &write_fd_set, &except_fd_set, &max_fd) == NSERROR_OK) &&
|
if ((fetch_fdset(&read_fd_set, &write_fd_set, &except_fd_set, &max_fd) == NSERROR_OK) &&
|
||||||
(max_fd != -1)) {
|
(max_fd != -1)) {
|
||||||
/* max_fd is the highest fd in use, but waitselect() needs to know how many
|
/* max_fd is the highest fd in use, but waitselect() needs to know how many
|
||||||
* are in use, so we add 1. */
|
* are in use, so we add 1. */
|
||||||
|
@ -64,7 +64,7 @@ extern "C" {
|
|||||||
#include "netsurf/browser_window.h"
|
#include "netsurf/browser_window.h"
|
||||||
#include "netsurf/cookie_db.h"
|
#include "netsurf/cookie_db.h"
|
||||||
#include "netsurf/url_db.h"
|
#include "netsurf/url_db.h"
|
||||||
#include "content/fetchers.h"
|
#include "content/fetch.h"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,7 +739,7 @@ void nsbeos_gui_poll(void)
|
|||||||
bigtime_t next_schedule = 0;
|
bigtime_t next_schedule = 0;
|
||||||
|
|
||||||
/* get any active fetcher fd */
|
/* get any active fetcher fd */
|
||||||
fetcher_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd);
|
fetch_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd);
|
||||||
|
|
||||||
/* run the scheduler */
|
/* run the scheduler */
|
||||||
schedule_run();
|
schedule_run();
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include "utils/file.h"
|
#include "utils/file.h"
|
||||||
#include "utils/nsoption.h"
|
#include "utils/nsoption.h"
|
||||||
#include "content/fetchers.h"
|
#include "content/fetch.h"
|
||||||
#include "netsurf/url_db.h"
|
#include "netsurf/url_db.h"
|
||||||
#include "netsurf/cookie_db.h"
|
#include "netsurf/cookie_db.h"
|
||||||
#include "content/backing_store.h"
|
#include "content/backing_store.h"
|
||||||
@ -401,7 +401,7 @@ static void nsgtk_main(void)
|
|||||||
FD_ZERO(&write_fd_set);
|
FD_ZERO(&write_fd_set);
|
||||||
FD_ZERO(&exc_fd_set);
|
FD_ZERO(&exc_fd_set);
|
||||||
|
|
||||||
fetcher_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd);
|
fetch_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd);
|
||||||
for (int i = 0; i <= max_fd; i++) {
|
for (int i = 0; i <= max_fd; i++) {
|
||||||
if (FD_ISSET(i, &read_fd_set)) {
|
if (FD_ISSET(i, &read_fd_set)) {
|
||||||
GPollFD *fd = malloc(sizeof *fd);
|
GPollFD *fd = malloc(sizeof *fd);
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "netsurf/netsurf.h"
|
#include "netsurf/netsurf.h"
|
||||||
#include "netsurf/url_db.h"
|
#include "netsurf/url_db.h"
|
||||||
#include "netsurf/cookie_db.h"
|
#include "netsurf/cookie_db.h"
|
||||||
#include "content/fetchers.h"
|
#include "content/fetch.h"
|
||||||
|
|
||||||
#include "monkey/dispatch.h"
|
#include "monkey/dispatch.h"
|
||||||
#include "monkey/browser.h"
|
#include "monkey/browser.h"
|
||||||
@ -258,7 +258,7 @@ static void monkey_run(void)
|
|||||||
while (!monkey_done) {
|
while (!monkey_done) {
|
||||||
|
|
||||||
/* clears fdset */
|
/* clears fdset */
|
||||||
fetcher_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd);
|
fetch_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd);
|
||||||
|
|
||||||
/* add stdin to the set */
|
/* add stdin to the set */
|
||||||
if (max_fd < 0) {
|
if (max_fd < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user