Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 191245
Collapse All | Expand All

(-)mod_lisp2-1.2/mod_lisp2.c~ (-7 / +13 lines)
Lines 105-110 Link Here
105
#include "util_script.h"
105
#include "util_script.h"
106
#include "apr_date.h"
106
#include "apr_date.h"
107
#include "apr_strings.h"
107
#include "apr_strings.h"
108
#include "apr_version.h"
108
109
109
#include <stdio.h>
110
#include <stdio.h>
110
#include <stdlib.h>
111
#include <stdlib.h>
Lines 117-123 Link Here
117
  while (1)								\
118
  while (1)								\
118
    {									\
119
    {									\
119
      apr_status_t RELAY_ERROR_status = (expr);				\
120
      apr_status_t RELAY_ERROR_status = (expr);				\
120
      if (APR_STATUS_IS_SUCCESS (RELAY_ERROR_status))			\
121
      if (RELAY_ERROR_status == APR_SUCCESS)				\
121
	break;								\
122
	break;								\
122
      if (!APR_STATUS_IS_EINTR (RELAY_ERROR_status))			\
123
      if (!APR_STATUS_IS_EINTR (RELAY_ERROR_status))			\
123
	return (RELAY_ERROR_status);					\
124
	return (RELAY_ERROR_status);					\
Lines 332-342 Link Here
332
    (apr_sockaddr_info_get ((&addr), (cfg->server_address), APR_UNSPEC,
333
    (apr_sockaddr_info_get ((&addr), (cfg->server_address), APR_UNSPEC,
333
			    (cfg->server_port), 0, socket_pool));
334
			    (cfg->server_port), 0, socket_pool));
334
335
336
#if APR_MAJOR_VERSION >= 1
337
  RELAY_ERROR
338
    (apr_socket_create ((&socket), AF_INET, SOCK_STREAM, APR_PROTO_TCP, socket_pool));
339
#else
335
  RELAY_ERROR
340
  RELAY_ERROR
336
    (apr_socket_create ((&socket), AF_INET, SOCK_STREAM, socket_pool));
341
    (apr_socket_create ((&socket), AF_INET, SOCK_STREAM, socket_pool));
342
#endif
337
343
338
  /* Should be apr_socket_connect */
344
  /* Should be apr_socket_connect */
339
  RELAY_ERROR (apr_connect (socket, addr));
345
  RELAY_ERROR (apr_socket_connect (socket, addr));
340
346
341
  {
347
  {
342
    input_buffer_t * buffer
348
    input_buffer_t * buffer
Lines 371-377 Link Here
371
    {
377
    {
372
      apr_size_t n2 = n1;
378
      apr_size_t n2 = n1;
373
      /* Should be apr_socket_send */
379
      /* Should be apr_socket_send */
374
      RELAY_ERROR (apr_send (socket, p, (&n2)));
380
      RELAY_ERROR (apr_socket_send (socket, p, (&n2)));
375
      if (n2 == n1)
381
      if (n2 == n1)
376
	return (APR_SUCCESS);
382
	return (APR_SUCCESS);
377
      p += n2;
383
      p += n2;
Lines 411-417 Link Here
411
  RELAY_ERROR (get_input_buffer (socket, (&buffer)));
417
  RELAY_ERROR (get_input_buffer (socket, (&buffer)));
412
  RELAY_ERROR
418
  RELAY_ERROR
413
    (((length = (sizeof (buffer->data))),
419
    (((length = (sizeof (buffer->data))),
414
      (apr_recv (socket, (buffer->data), (&length)))));
420
      (apr_socket_recv (socket, (buffer->data), (&length)))));
415
  (buffer->start) = (buffer->data);
421
  (buffer->start) = (buffer->data);
416
  (buffer->end) = ((buffer->data) + length);
422
  (buffer->end) = ((buffer->data) + length);
417
  if (length == 0)
423
  if (length == 0)
Lines 479-485 Link Here
479
#define CVT_ERROR(expr, msg) do						\
485
#define CVT_ERROR(expr, msg) do						\
480
{									\
486
{									\
481
  apr_status_t CVT_ERROR_status = (expr);				\
487
  apr_status_t CVT_ERROR_status = (expr);				\
482
  if (!APR_STATUS_IS_SUCCESS (CVT_ERROR_status))			\
488
  if (CVT_ERROR_status != APR_SUCCESS)					\
483
    {									\
489
    {									\
484
      ap_log_error (APLOG_MARK, APLOG_ERR, CVT_ERROR_status,		\
490
      ap_log_error (APLOG_MARK, APLOG_ERR, CVT_ERROR_status,		\
485
		    (r->server), "error %s", msg);			\
491
		    (r->server), "error %s", msg);			\
Lines 565-571 Link Here
565
571
566
	  {
572
	  {
567
	    apr_status_t status = (write_lisp_data (socket, buffer, n_read));
573
	    apr_status_t status = (write_lisp_data (socket, buffer, n_read));
568
	    if (!APR_STATUS_IS_SUCCESS (status))
574
	    if (status != APR_SUCCESS)
569
	      {
575
	      {
570
		while ((ap_get_client_block (r, buffer, (sizeof (buffer))))
576
		while ((ap_get_client_block (r, buffer, (sizeof (buffer))))
571
		       > 0)
577
		       > 0)
Lines 818-824 Link Here
818
static void
824
static void
819
lisp_child_init (apr_pool_t * pool, server_rec * s)
825
lisp_child_init (apr_pool_t * pool, server_rec * s)
820
{
826
{
821
  if (APR_STATUS_IS_SUCCESS (apr_pool_create ((&socket_pool), 0)))
827
  if (apr_pool_create ((&socket_pool), 0) == APR_SUCCESS)
822
    {
828
    {
823
      apr_pool_cleanup_register (pool, 0, destroy_socket_pool, destroy_socket_pool);
829
      apr_pool_cleanup_register (pool, 0, destroy_socket_pool, destroy_socket_pool);
824
#if APR_HAS_THREADS
830
#if APR_HAS_THREADS

Return to bug 191245