1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00
Commit Graph

157 Commits

Author SHA1 Message Date
Raghavendra Prabhu 761c5e2d11 core/plugins: Use res_init before getaddrinfo.
With weechat, if the network changes in anyway that causes resolv.conf
to be updated, that is not picked up, resulting in

    irc: connecting to server XXXX.com/1026 (SSL)...
    irc: address "XXX.com" not found
    irc: error: Name or service not known
    irc: reconnecting to server in 30 seconds

This happens, especially when one connects to an irc server behind a
VPN.

This can also happen when there is no network connectivity weechat was started
but later network is connected to.

The fix is simple, it relies on calling  res_init (3) before getaddrinfo in
network_connect_child and other places.

res_init reloads the resolv.conf and getaddrinfo does not fail with
address resolution error.
2016-08-07 13:20:54 +01:00
Sébastien Helleu 20c86db0d8 api: remove functions printf_date() and printf_tags() 2016-06-18 08:49:35 +02:00
Sébastien Helleu 7342a47de0 core, irc, xfer: display more information in memory allocation errors (issue #573) 2016-05-27 20:13:35 +02:00
Sébastien Helleu cf6aca1619 core: add pointer in some callbacks (closes #406)
This pointer is the first argument received by callbacks, and the
existing argument "data" is now automatically freed by WeeChat when the
object containing the callback is removed.

With this new pointer, the linked list of callbacks in scripts has been
removed. This will improve speed of scripts (using a lot of hooks),
reduce memory used by scripts and reduce time to unload scripts.

Following functions are affected in the C API:

* exec_on_files
* config_new
* config_new_section
* config_new_option
* hook_command
* hook_command_run
* hook_timer
* hook_fd
* hook_process
* hook_process_hashtable
* hook_connect
* hook_print
* hook_signal
* hook_hsignal
* hook_config
* hook_completion
* hook_modifier
* hook_info
* hook_info_hashtable
* hook_infolist
* hook_hdata
* hook_focus
* unhook_all_plugin
* buffer_new
* bar_item_new
* upgrade_new
* upgrade_read
2016-03-21 18:11:21 +01:00
Simmo Saan b12412ed17 xfer: ignore signals when polling socket during file receive (closes #677)
When signals (e.g. SIGWINCH for terminal resize) are fired they cause poll
to fail with EINTR, erroring file receival even when there wasn't a problem
with it.

This patch adds additional checks for EINTR and EAGAIN that cause retry of
poll, since both are unrelated to actual file receival.
2016-02-05 13:44:14 +02:00
Luis Colorado b46e75d504 Add extern keyword several places to link in osx 2016-01-15 09:12:30 +02:00
Sébastien Helleu 3330724574 core: update copyright dates 2016-01-01 11:09:53 +01:00
Sébastien Helleu 31c3151fcc xfer: fix typo in a comment 2015-07-19 09:55:29 +02:00
Sébastien Helleu 23983b125a xfer: fix crash if the DCC file socket number is too high (issue #465) 2015-07-18 19:54:59 +02:00
Sébastien Helleu fdd9c03e5a xfer: evaluate content of options xfer.file.download_path and xfer.file.upload_path (issue #388) 2015-06-27 08:11:28 +02:00
Simmo Saan 8d1d2c0321 xfer: correctly use and parse \r\n line endings in CHAT (closes #425) 2015-05-18 19:21:03 +03:00
Sébastien Helleu 71dd64678c core: add comments after some #endif 2015-04-30 21:15:30 +02:00
Sébastien Helleu cf5501f69c core: add priority in plugins to initialize them in order
Current order is: charset, logger, exec, trigger, aspell, alias, fifo, xfer,
irc, relay, guile/lua/perl/python/ruby/tcl, script.
2015-01-15 07:40:38 +01:00
Sébastien Helleu a020c28ea6 core: update copyright dates 2015-01-01 09:23:23 +01:00
Sébastien Helleu bd59c587d8 xfer: rename callback for infolist "xfer" 2014-12-03 07:37:16 +01:00
Sébastien Helleu 2d48964463 xfer: fix code style 2014-11-09 17:35:23 +01:00
Sébastien Helleu 037bf70817 Merge branch 'xfer_chat' of git://github.com/talisein/weechat-1 into talisein-xfer_chat 2014-11-09 17:10:30 +01:00
Sébastien Helleu 33a6469359 xfer: fix comments 2014-11-09 16:31:09 +01:00
Sébastien Helleu aa7c936cfc xfer: return 0/1 instead of WEECHAT_RC_OK/ERROR in function xfer_resolve_addr 2014-11-09 16:21:24 +01:00
Andrew Potter 5284646df1 xfer: bind to wildcard address when sending
When #5 was fixed, we started to always bind to the local address
connected to the irc server because the xfer.network.own_ip address
may not be able to be bound to when NATed. But this means when the
own_ip address is a different family (IPv4 vs IPv6) from the irc
server connection, we were listening for connections on the wrong
interface.

This patch lets us figure out which family is being used,
(xfer.network.own_ip's family, or the irc connection's family
otherwise) and bind() into the correct family via that family's
wildcard address.
2014-08-20 09:12:08 -07:00
Andrew Potter e5cd0eb247 xfer: Use hook_connect() for receiving chats
fixes #160
2014-08-19 22:09:37 -07:00
Sébastien Helleu a54566df2e xfer: fix problem with option xfer.file.auto_accept_nicks when the server name contains dots 2014-05-06 21:50:08 +02:00
Sébastien Helleu db912ded26 xfer: fix freeze/problems when sending empty files with DCC (closes #53) 2014-04-13 12:52:25 +02:00
Sébastien Helleu 001ea53f9d core: fix crash on "weechat --upgrade" if no .upgrade files are found 2014-04-12 21:45:27 +02:00
Sébastien Helleu 7618fdd240 core: use lower case for CMake keywords 2014-04-12 18:00:27 +02:00
Sébastien Helleu 0866bc7e6d xfer: fix help of option xfer.file.convert_spaces 2014-04-12 08:32:31 +02:00
Sébastien Helleu 2a9bd75eee core: close .upgrade files before deleting them after /upgrade 2014-04-03 14:23:31 +02:00
Sebastien Helleu 9b380a935b core: fix use of reserved C identifiers in headers (closes #31) 2014-03-19 10:39:13 +01:00
Andrew Potter 1baa2e288c xfer: Fix segfault in DCC send.
This was broken before the previous change, since remote_address was
just a zero'd out struct.
2014-03-13 21:05:47 -07:00
Andrew Potter 92d454eb8d xfer: Don't use sockaddr_storage for address_length
Hopefully this addresses #25.
2014-03-13 20:32:59 -07:00
Andrew Potter 9f140ca805 xfer: Fix xfer.network.own_ip behavior
Fixes #5. xfer shouldn't try to bind() to the own_ip
address. Instead, always bind to the same local address that is
connected to the irc server, and just change the out_addr if own_ip is
used.

Also fixes a memory leak in error path.
2014-03-11 21:21:18 -07:00
Sebastien Helleu 02dcc3cb69 xfer: replace constant by sizeof in a call to snprintf 2014-02-28 11:45:18 +01:00
Sebastien Helleu 3ef27075f9 xfer: remove dead assignment in function xfer_add_cb 2014-02-22 14:54:21 +01:00
Sebastien Helleu 437767c0ca api: add integer return code for functions hook_{signal|hsignal}_send 2014-02-10 17:42:53 +01:00
Sebastien Helleu 8fc7515322 core: reformat hook_command arguments 2014-01-18 20:33:19 +01:00
Sebastien Helleu f8b2c6f5ac xfer: add gcrypt library for link of plugin 2014-01-10 23:25:41 +01:00
Andrew Potter 144dc60d0a xfer: add support of IPv6 for DCC chat/file (patch #7992) 2014-01-09 12:48:54 +01:00
Andrew Potter d216786846 xfer: use same infolist for hook and signals (patch #7974) 2014-01-06 16:00:21 +01:00
Sebastien Helleu 646a072511 xfer: add option xfer.file.auto_check_crc32 (patch #7963)
Thanks to Andrew Potter for the patch.
2014-01-06 11:21:12 +01:00
Sebastien Helleu 7dfaca9ef3 xfer: replace call to sprintf() with snprintf() 2014-01-05 10:47:09 +01:00
Sebastien Helleu e058d75ce3 xfer: add "network" prefix for (dis)connection messages in xfer chat buffer 2014-01-02 15:21:42 +01:00
Sebastien Helleu 892aa79fb5 core: update copyright dates 2014-01-01 00:14:12 +01:00
Sebastien Helleu 539516fe7c xfer: load plugin even if options can not be read in xfer.conf (with warnings) 2013-11-09 10:26:51 +01:00
Sebastien Helleu b5f6874f2c core: move the "-no-undefined" from LDFLAGS in configure.ac to Makefile.am in plugins
This "-no-undefined" was causing an error when detecting "ld" lib on Cygwin.
2013-10-05 20:17:18 +02:00
Sebastien Helleu 94b9104d14 core: replace obsolete INCLUDES by AM_CPPFLAGS in files Makefile.am 2013-07-20 09:07:05 +02:00
Sebastien Helleu bd3a12378e xfer: add option xfer.look.pv_tags 2013-07-11 22:43:13 +02:00
Sebastien Helleu fa9f787e14 core: sort config options by name in sources 2013-07-11 22:31:33 +02:00
Simon Kuhnle 954ea9fb9d xfer: fix compilation error on OpenBSD
Signed-off-by: Simon Kuhnle <Simon.Kuhnle@cs.fau.de>
2013-05-27 13:37:07 +02:00
Sebastien Helleu 9c54e33ee1 xfer: fix compilation warnings 2013-05-22 20:57:14 +02:00
Andrew Potter fe512fdd33 xfer: add option xfer.file.auto_accept_nicks (patch #7962) 2013-03-25 09:05:36 +01:00