Commit Graph

181 Commits

Author SHA1 Message Date
Rémi Denis-Courmont cc129a71d7 Remove old mail address from sources 2019-09-04 22:11:04 +03:00
Steve Lhomme 5363279805 remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
Rémi Denis-Courmont f00eeaf27b network: remove unused net_vaPrintf() 2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont 184fbc5c54 satip: privatize net_Printf() 2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont dfd2f4e792 network: remove dead code in net_Listen()
This function is only used to open TCP or DCCP passive sockets.
The datagram (including multicast) code was never reached.
2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont 65f57dd3a5 network: remove unused net_Gets() 2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont d5ad81a50f network: inline net_AcceptSingle() 2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont 9e4b1a3b0b tcp: privatize net_AcceptSingle() 2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont 14827d5587 tcp: gather socket accept/listen helpers 2018-11-11 17:32:01 +02:00
Rémi Denis-Courmont 0463c0bc9b network/io: move documentation to header file 2018-11-11 17:32:01 +02:00
Steve Lhomme 164b529e01 network: print ports as unsigned 2018-07-11 15:35:04 +02:00
Steve Lhomme bb1c8e8e41 network: net_Listen() doesn't accept a negative port 2018-07-11 15:35:00 +02:00
Rémi Denis-Courmont 4a49f795c1 tcp: print proper error when binding a port fails 2017-09-16 16:14:49 +03:00
Rémi Denis-Courmont c881098b14 network: use vlc_killed() 2015-07-01 19:18:12 +03:00
Rémi Denis-Courmont d6a7bc11c7 network: read more than one byte per recv() call
This reduces the system call overhead.
2015-07-01 19:18:12 +03:00
Rémi Denis-Courmont 27bb0783c4 network: fix net_Read() documentation and match it in code 2015-07-01 19:18:12 +03:00
Rémi Denis-Courmont f3b589be48 network: use vlc_read_i11e() in net_Read() and simplify 2015-07-01 19:18:09 +03:00
Rémi Denis-Courmont 4b865c6646 network: use vlc_write_i11e() in net_Write() and simplify 2015-07-01 19:17:54 +03:00
Rémi Denis-Courmont a3a6a95aad net_Read: remove no longer used waitall parameter
It was always either true or unused. Note that when the buffer length
is 1 byte, waitall had no effects.

net_Read() and net_Write() are now symmetric.
2015-07-01 19:17:54 +03:00
Hugo Beauzée-Luyssen 18b2146148 core: network: Remove unused label 2015-07-01 14:11:37 +02:00
Jean-Baptiste Kempf cefea7d5f9 WinRT: we don't use the WinsockRT APIs 2015-07-01 10:52:54 +02:00
Rémi Denis-Courmont 5287f8e10c network: use send(MSG_NOSIGNAL) in net_Write()
This ensures that SIGPIPE is not emitted if the connection is closed by
the other end. Using send() is fine given that all net_Write(),
net_vaPrintf() and net_Printf() call sites use (only) sockets.
2015-05-19 23:28:54 +03:00
Rémi Denis-Courmont 3aee65c9f7 Remove no longer used net_Write() argument 2015-05-12 22:25:36 +03:00
Rémi Denis-Courmont c0cdab15a4 Remove no longer used net_Read() argument 2015-05-12 22:25:11 +03:00
Rémi Denis-Courmont 9b629ed21d Remove no longer used net_vaPrintf() argument 2015-05-12 22:25:11 +03:00
Rémi Denis-Courmont 217fc59faa Remove no longer used net_Printf() argument 2015-05-12 22:25:11 +03:00
Rémi Denis-Courmont e46b0db280 Remove no longer used net_Gets() argument 2015-05-12 22:25:11 +03:00
Rémi Denis-Courmont c4199ab677 Remove inconsistently used HAVE_UNISTD_H 2013-12-29 16:15:46 +02:00
Rémi Denis-Courmont 9ff28119bc src: use vlc_strerror_c() for log messages 2013-12-29 15:36:02 +02:00
Rafaël Carré f8b16acbcb Windows store: don't call read() before poll() on network sockets 2013-10-25 12:27:21 +02:00
Rémi Denis-Courmont e74131d85e net_Gets: increase size limit (fixes #9555) 2013-10-01 17:18:58 +03:00
Georgi Chorbadzhiyski 313194d7fa Do not truncate the last character in net_Gets().
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2013-08-17 21:51:39 +03:00
Rémi Denis-Courmont 9311e60ac6 net_Read: break potential dead lock with waitall = true 2013-08-14 21:30:03 +03:00
Rémi Denis-Courmont e8f36f6e7f net_Recv(): improve error handling (fixes #9081) 2013-07-30 18:07:14 +03:00
Rémi Denis-Courmont 3328b21b5b net_Read: rewrite, fix corner cases (fix #8972)
This new implementation opportunistically tries to read data before
invoking poll(). This reduces latency when data is already waiting in
buffers, allows receiving pending data in non-blocking fashion even if
the object has been killed. This also gives GnuTLS a chance to dequeue
data from internal buffers.

Also the corner case of 0 read should now be handled correctly.

The corner case of an error after success read is no longer handled.
This was race-prone and useless.
2013-07-21 19:41:53 +03:00
Rémi Denis-Courmont ab7d3c3c9f net_Gets: rewrite, deal with errors 2013-07-21 19:09:02 +03:00
Rafaël Carré 6d53362001 Use _WIN32 rather than WIN32 (same for WIN64)
http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx only
mentions the _ prefixed variable.

gcc will always define the _ prefixed variable, like Visual Studio.
The prefixless one is defined in some language standards, e.g. gnu99
but not c99.
2013-06-05 16:06:10 +02:00
Rémi Denis-Courmont 7141d755ff Do not access b_die directly 2012-11-10 19:22:47 +02:00
Rémi Denis-Courmont a5b8b24f21 Remove redundant UNDER_CE checks
WIN32 is defined also on WinCE anyway.
2012-09-02 10:57:35 +03:00
Rémi Denis-Courmont 7b9e62c257 vlc_getaddrinfo: pass AI_IDN explicitly where applicable 2012-08-19 16:47:01 +03:00
Rémi Denis-Courmont b0b8f4c49d vlc_getaddrinfo: pass AI_NUMERICSERV explicitly where applicable 2012-08-19 16:47:01 +03:00
Rémi Denis-Courmont 16d8d7b790 vlc_getaddrinfo: remove useless parameter 2012-08-19 16:46:57 +03:00
Rémi Denis-Courmont 546cdb234c net_Read(): truly ignore POLLRDHUP
The Linux TCP stack sets POLLRDHUP as soon as the FIN packet is
received. If there is some unread data in the receive buffer, it would
be discarded. Then upper layer protocol typically fail.

This can happen with HTTP/1.1 "Connection: close" or with HTTP/1.0
in particular.

Pointed-out-by: Jean-Baptiste Kempf <jb@videolan.org>
2012-04-18 16:39:26 +03:00
Frédéric Yhuel c0e768b8fd network/io.c: minor fix
Unlike POLLERR, POLLHUP, and POLLNVAL, POLLRDHUP is not set by default.
See http://man7.org/linux/man-pages/man2/poll.2.html

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2012-04-04 17:25:15 +03:00
Rémi Denis-Courmont 2f1bcf5dc3 Remove inconsistently used check for <fcntl.h> 2012-01-27 23:31:49 +02:00
Jean-Baptiste Kempf 36ab287e77 LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+

This move was authorized by the developers, either:
 - by e-mail,
 - by vote at the VideoLAN Dev Days 2011,
 - on the license website,
 - in a contract, oral or written.
No objection was raised, so far.

The developers agreeing are:
  Justus Piater
  Alexis Ballier
  Alexander Bethke
  Mohammed Adnène Trojette
  Alex Converse
  Alexey Sokolov
  Alexis de Lattre
  Andre Pang
  Anthony Loiseau
  Cyril Deguet
  André Weber
  Boris Dorès
  Brieuc Jeunhomme
  Benjamin Drung
  Hugo Beauzée-Luyssen
  Benoit Steiner
  Benjamin Pracht
  Bernie Purcell
  Przemyslaw Fiala
  Arnaud de Bossoreille de Ribou
  Brad Smith
  Nick Briggs
  Christopher Rath
  Christophe Courtaut
  Christopher Mueller
  Clement Chesnin
  Andres Krapf
  Damien Fouilleul
  David Flynn
  Sebastien Zwickert
  Antoine Cellerier
  Jérôme Decoodt
  Jérome Decoodt
  Dylan Yudaken
  Eduard Babayan
  Eugenio Jarosiewicz
  Elliot Murphy
  Eric Petit
  Erwan Tulou
  Etienne Membrives
  Ludovic Fauvet
  Fabio Ritrovato
  Tobias Güntner
  Jakub Wieczorek
  Frédéric Crozat
  Francois Cartegnie
  Laurent Aimar
  Florian G. Pflug
  Felix Paul Kühne
  Frank Enderle
  Rafaël Carré
  Simon Latapie
  Gildas Bazin
  Geoffroy Couprie
  Julien / Gellule
  Gildas Bazin
  Arnaud Schauly
  Toralf Niebuhr
  Vicente Jimenez Aguilar
  Derk-Jan Hartman
  Henri Fallon
  Ilkka Ollakka
  Olivier Teulière
  Rémi Duraffort
  Jakob Leben
  Jean-Baptiste Kempf
  Jean-Paul Saman
  Jean-Philippe Grimaldi
  Jean-François Massol
  Gaël Hendryckx
  Jakob Leben
  Jean-Marc Dressler
  Jai Menon
  Johan Bilien
  Johann Ransay
  Joris van Rooij
  JP Dinger
  Jean-Philippe André
  Adrien Grand
  Juha Jeronen
  Juho Vähä-Herttua
  Kaarlo Raiha
  Kaarlo Raiha
  Kamil Baldyga
  Keary Griffin
  Ken Self
  KO Myung-Hun
  Pierre Ynard
  Filippo Carone
  Loïc Minier
  Luca Barbato
  Lucas C. Villa Real
  Lukas Durfina
  Adrien Maglo
  Marc Ariberti
  Mark Lee
  Mark Moriarty
  Martin Storsjö
  Christophe Massiot
  Michel Kaempf
  Marian Ďurkovič
  Mirsal Ennaime
  Carlo Calabrò
  Damien Lucas
  Naohiro Koriyama
  Basos G
  Pierre Baillet
  Vincent Penquerc'h
  Olivier Aubert
  Pankaj Yadav
  Paul Corke
  Pierre d'Herbemont
  Philippe Morin
  Antoine Lejeune
  Michael Ploujnikov
  Jean-Marc Dressler
  Michael Hanselmann
  Rafaël Carré
  Ramiro Polla
  Rémi Denis-Courmont
  Renaud Dartus
  Richard Shepherd
  Faustino Osuna
  Arnaud Vallat
  Rob Jonson
  Robert Jedrzejczyk
  Steve Lhomme
  Rocky Bernstein
  Romain Goyet
  Rov Juvano
  Sam Hocevar
  Martin T. H. Sandsmark
  Sebastian Birk
  Sébastien Escudier
  Vincent Seguin
  Fabio Ritrovato
  Sigmund Augdal Helberg
  Casian Andrei
  Srikanth Raju
  Hannes Domani
  Stéphane Borel
  Stephan Krempel
  Stephan Assmus
  Tony Castley
  Pavlov Konstantin
  Eric Petit
  Tanguy Krotoff
  Dennis van Amerongen
  Michel Lespinasse
  Can Wu
  Xavier Marchesini
  Sébastien Toque
  Christophe Mutricy
  Yoann Peronneau
  Yohann Martineau
  Yuval Tze
  Scott Caudle
  Clément Stenac

It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 22:54:33 +01:00
Rafaël Carré 1305c3e1bf win32: fix gnutls access
reading failed with EAGAIN but this error was not catched properly

Signed-off-by: Rafaël Carré <funman@videolan.org>
2011-11-23 13:44:22 -05:00
Rémi Denis-Courmont 86614c500b net_Listen: don't print NULL 2011-08-02 19:19:10 +03:00
Rémi Denis-Courmont c56951687d use var_Inherit 2010-11-10 18:41:38 +02:00
Rémi Denis-Courmont bb7ae441f9 net_Listen: pass socket type parameter
We cannot use any random type semantic that we do not know of.
This also works around bugs in deficient getaddrinfo() implementations.
2010-05-05 19:29:57 +03:00