At 05:13 PM 10/16/2003, [EMAIL PROTECTED] wrote:
>wrowe 2003/10/16 15:13:03
>
> Modified: . Tag: APR_0_9_BRANCH configure.in
> include Tag: APR_0_9_BRANCH apr.h.in apr.hnw apr.hw
> apr_network_io.h
> include/arch/unix Tag: APR_0_9_BRANCH apr_arch_networkio.h
> network_io/os2 Tag: APR_0_9_BRANCH sockopt.c
> network_io/unix Tag: APR_0_9_BRANCH sockopt.c
> network_io/win32 Tag: APR_0_9_BRANCH sockopt.c
> Log:
> Introduce apr_socket_atmark() with a more friendly failure case when the
> SIOCATMARK symbol isn't available, to avoid breaking APR 0.9/httpd 2.0
> distributions. [William Rowe, Jim Jagielski, Brian Havard and Jeff
> Trawick]
>
> RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
> retrieving revision 1.70
> retrieving revision 1.70.2.1
> diff -u -r1.70 -r1.70.2.1
> --- sockopt.c 30 May 2003 12:50:40 -0000 1.70
> +++ sockopt.c 16 Oct 2003 22:13:02 -0000 1.70.2.1
> @@ -55,6 +55,7 @@
> #include "apr_arch_networkio.h"
> #include "apr_strings.h"
>
> +
> static apr_status_t soblock(int sd)
> {
> /* BeOS uses setsockopt at present for non blocking... */
> @@ -366,6 +367,27 @@
> *on = apr_is_option_set(sock->netmask, opt);
> }
> return APR_SUCCESS;
> +}
> +
> +
> +apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
> +{
> +/* In 1.0 we rely on compile failure to assure all platforms grabbed
> + * the correct header file support for SIOCATMARK, but we don't want
> + * to fail the build of 0.9. Keep things good for the released branch.
> + */
> +#ifdef SIOCATMARK
> + int oobmark;
> +
> + if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
> + return apr_get_netos_error();
> +
> + *atmark = (oobmark != 0);
> +
> + return APR_SUCCESS;
> +#else
> + return APR_ENOTIMPL;
> +#endif
> }
Hopefully this provide the behavior you desired, Jeff. Thanks to yourself,
Brian and Jim for all the efforts.
Bill