1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

454 Commits

Author SHA1 Message Date
David CARLIER 1db75d42bb ext/sockets: socket_get_option/socket_set_option SO_LINGER_SEC. (#14858)
9672cd9469 follow-up.
2024-07-07 14:23:01 +01:00
David Carlier 1bcb57dcab ext/sockets: socket_accept setting fcntl's FD_CLOEXEC on unixes.
mainly for scenarios when pcntl_fork/pcntl_exec are involved so when
the latter is executed, we avoid unwarranted effects with the file
descriptors, instead the socket will be closed on success.

close GH-14606
2024-07-01 18:50:59 +01:00
Arnaud Le Blanc 11accb5cdf Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Peter Kokot da86eec3db Sync #if/ifdef/defined (#14371)
These are either undefined or defined to value 1 in Autotools and
Windows:
- HAVE_COMMONCRYPTO_COMMONRANDOM_H
- HAVE_EXIF
- HAVE_FOPENCOOKIE
- HAVE_IF_NAMETOINDEX
- HAVE_LIBICONV
- HAVE_SOCKETS
- HAVE_STRUCT_STAT_ST_RDEV
- HAVE_STRUCT_TM_TM_GMTOFF
- HAVE_STRUCT_TM_TM_ZONE

Follow up of GH-5526 (-Wundef)
2024-06-07 23:45:17 +02:00
David CARLIER bbbe56eecc ext/sockets: using fast ZPP. (#14453) 2024-06-03 21:10:23 +01:00
David Carlier 0e16e29b40 ext/sockets: socket_create_listen update.
going from 128 to system's SOMAXCONN by default to be able to increase
the queue of connections to be handled.
Also, for Haiku SOMAXCONN is only 32.

Close GH-13854
2024-04-10 18:39:38 +01:00
David Carlier 089f51319e Merge branch 'PHP-8.3' 2024-03-31 17:01:27 +01:00
David Carlier b412fd6a77 Merge branch 'PHP-8.2' into PHP-8.3 2024-03-31 17:01:16 +01:00
David Carlier ba4c82fd80 ext/sockets: socket_create_listen clearing socket data before binding.
Close GH-13855
2024-03-31 17:00:54 +01:00
David Carlier 7f8465ab22 Merge branch 'PHP-8.3' 2024-03-06 11:39:48 +00:00
David Carlier 93d89cb80d Merge branch 'PHP-8.2' into PHP-8.3 2024-03-06 11:39:37 +00:00
David Carlier e3f0d03452 Fix GH-13603 ext/sockets: properly initialised address info data.
Led to random characters visible on socket id on macOs.

Close GH-13606
2024-03-06 11:37:48 +00:00
Jorg Sowa 9c4beac8d3 Remove inet_aton
This removes the deprecated inet_aton and its Windows implementation.
The inet_aton can be replaced with platform agnostic inet_pton.

Closes GH-13479
2024-02-23 23:16:43 +01:00
Jorg Adam Sowa e630aacf79 Remove HAVE_INET_PTON (#13410) 2024-02-21 00:43:56 +00:00
David CARLIER 931a8b0739 inet_ntop requirement check at configure time instead (#12700) 2023-11-17 16:01:46 +00:00
David Carlier 44f9c226aa following-up on GH-12551: removing inet_ntoa usage
Close GH-12554
2023-11-06 12:05:56 +00:00
David Carlier 1c8943bc78 cleanup inet_ntoa usage.
starting with the socket extension. PHP 8 requires windows vista/2008
minimum, even more exotic systems like solaris or haiku supports
inet_ntop, so there is no need to keep supporting this old interface.

Close GH-12551
2023-10-29 15:54:20 +00:00
twosee d9b0bdbaa4 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix socket_export_stream() with wrong protocol
2023-09-29 18:58:05 +08:00
twosee 90707f33e1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix socket_export_stream() with wrong protocol
2023-09-29 18:33:59 +08:00
twosee b5da98b972 Fix socket_export_stream() with wrong protocol
Closes GH-12310.
2023-09-29 18:33:12 +08:00
Javier Eguiluz 732d92c0e5 [skip ci] Fix various typos and grammar issues (#11143) 2023-04-28 11:05:32 +02:00
George Peter Banyard 735edd1c17 Voidify php_sock_array_from_fd_set() as result is never used 2023-01-30 16:05:30 +00:00
George Peter Banyard 3eb9dd47e0 Use bool and zend_result where it makes sense in sockets extension 2023-01-30 16:05:30 +00:00
Máté Kocsis 7936c8085e Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
David CARLIER 4c4e72f149 socket add socket_atmark support.
checks whether the socket belongs to the out-of-band mark, thus allows to be
 processed accordingly (using the MSG_OOB flag on send/recv).

Closes #9846.
2022-10-31 16:38:18 +00:00
David Carlier 35b5aceff3 SO_ATTACH_REUSEPORT_CBPF filter update. SDK_AD_QUEUE support to attach to a queue.
Closes #9690
2022-10-15 11:22:26 +01:00
Arnaud Le Blanc 5b6f9df51a Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  [ci skip] NEWS
  Return immediately when FD_SETSIZE is exceeded (#9602)
2022-10-01 11:26:17 +02:00
Arnaud Le Blanc 246d13cd99 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  [ci skip] NEWS
  Return immediately when FD_SETSIZE is exceeded (#9602)
2022-10-01 11:24:23 +02:00
Arnaud Le Blanc d4b99542d5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] NEWS
  Return immediately when FD_SETSIZE is exceeded (#9602)
2022-10-01 11:23:34 +02:00
Arnaud Le Blanc 80232de0e4 Return immediately when FD_SETSIZE is exceeded (#9602) 2022-10-01 11:20:43 +02:00
David Carlier 615b8006c4 socket module add SO_ATTACH_REUSEPORT_CPBF for Linux.
to be used in conjunction with SO_REUSPORT, giving a greater control
over how we bind a socket instead of the round robin workflow, we do
 instead attach to the processor id as :
- we assign the processor_id to A in the BPF filter.
- then returns A.

in other words, a more modern version of SO_INCOMING_CPU (ie can have a per
 worker notion we do not use here).
Closes #8062
2022-09-29 23:32:39 +01:00
Ilija Tovilo 743d3780c6 Add clang ASAN/UBSAN push job
Closes GH-9507
2022-09-14 23:55:46 +02:00
Bob Weinand a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
Bob Weinand 94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis 98e5c4e3a3 Declare ext/sockets constants in stubs (#9349) 2022-08-16 13:18:31 +02:00
David Carlier 9090e2602e sockets ext for solaris update.
socket filter support, system can support up to 32 filters giving the possibility to retrive the full list.
Closes #8191.
2022-07-25 19:28:25 +01:00
David Carlier dedad408fe sockets introduces socket_set_option SO_ZEROCOPY and MSG_ZEROCOPY for the socket_send* functions. it avoids copy b/w userland and kernel for both TCP and UDP protocols. 2022-07-10 20:06:52 +01:00
David Carlier a193427333 Adds TCP_CONGESTION socket option for Linux/FreeBSD.
Closes #8824.
2022-06-30 19:43:09 +01:00
David CARLIER 6b02cabc8a Add SO_SETFIB FreeBSD socket option constant.
Aims to set the route table.
Closes #8742.
2022-06-11 13:03:21 +01:00
David Carlier d677cc13ce Add SO_BPF_EXTENSIONS flag to socket.
Returns the supported bpf extensions from the kernel. Linux only.
Closes GH-8713.
2022-06-08 05:14:57 +01:00
David CARLIER f813520b50 Implements socket ancillary data on FreeBSD. (#7708)
using LOCAL_CREDS_PERSISTENT/SCM_CREDS2 instead so we also get the send process id.
2022-06-02 14:08:03 +01:00
David Carlier 30c8f3a80f Fix GH-8674: sockets extension won't build for older Linux kernels
In abscence of the needed header, disable the feature altogether.

Closes GH-8677.
2022-06-01 17:33:36 +02:00
David CARLIER b14215ab6c sockets add openbsd's SO_RTABLE option, equivalent of Linux's SO_MARK. (#8440) 2022-05-27 13:55:34 +02:00
David CARLIER d1c570f48c Sockets: add constants TCP_KEEPALIVE, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT (#8473) 2022-05-27 13:50:32 +02:00
David Carlier 2410e378c1 Add SO_MEMINFO socket option for gathering socket related info 2022-05-20 22:06:53 +01:00
David Carlier 1f4830f21a Add TCP_NOTSENT_LOWAT socket option
Can be used to limit the amount of unsent data per socket.

Closes GH-8559.
2022-05-16 16:01:38 +02:00
Christoph M. Becker e1a238333c Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix ext/sockets build on Haiku
2022-01-04 14:13:27 +01:00
Christoph M. Becker 623b21220b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix ext/sockets build on Haiku
2022-01-04 14:12:56 +01:00
David Carlier 09165ace37 Fix ext/sockets build on Haiku
The `SOCK_RDM` datagram option is unsupported on Haiku; instead `ifreq`
has direct access to `ifr_index`.

Closes GH-7849.
2022-01-04 14:10:50 +01:00
David Carlier 3414ae6c0c sockets: add SO_INCOMING_CPU constant
get/set the cpu attached to a socket, no special treatment needed,
it is simply an integer.

Closes GH-7753.
2021-12-20 14:58:09 +01:00