Cleaning up types in php_stdiop_cast
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.1k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
The whole php_stdiop_cast is a proper mess. It defines php_socket_t fd but then it uses PHP_STDIOP_GET_FD which is defined as
#define PHP_STDIOP_GET_FD(anfd, data) anfd = (data)->file ? fileno((data)->file) : (data)->fd
which is actually always int. I assume that there are some users (external code) that casting and assume that php_socket_t is returned but I think this is incorrect and they should not assume that and it should be fixed there using proper casting. That would leave plain wrapper operating just on fd which is what I think it should.
Then why does it need to even SOCK_ERR here if it's not for socket in the first place? I think it should be redefined just to -1 or some new macro created (e.g. PHP_FD_ERR).
Originally posted by @bukka in https://github.com/php/php-src/pull/17506#discussion_r1921536084
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en php_stdiop_cast y en la definición de PHP_STDIOP_GET_FD; después, rastrea los llamadores y usos de SOCK_ERR. El issue no menciona ningún archivo ni prueba. Se considera terminado cuando el wrapper usa un tipo de descriptor de archivo y un sentinel de error coherentes, sin depender de una suposición no compatible sobre un cast externo, y se han comprobado las expectativas de compatibilidad afectadas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- c, php
- Área
- backend, operating-systems
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 38/100