]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sync with sofia darcs tree
authorMichael Jerris <mike@jerris.com>
Thu, 19 Apr 2007 19:17:12 +0000 (19:17 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 19 Apr 2007 19:17:12 +0000 (19:17 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4975 d0543943-73ff-0310-b7d9-9358b9ac24b2

15 files changed:
libs/sofia-sip/RELEASE
libs/sofia-sip/configure.ac
libs/sofia-sip/libsofia-sip-ua/http/Makefile.am
libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/string0.h
libs/sofia-sip/libsofia-sip-ua/msg/Makefile.am
libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.awk
libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
libs/sofia-sip/libsofia-sip-ua/nua/test_register.c
libs/sofia-sip/libsofia-sip-ua/nua/test_simple.c
libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
libs/sofia-sip/libsofia-sip-ua/sdp/torture_sdp.c
libs/sofia-sip/libsofia-sip-ua/sip/Makefile.am
libs/sofia-sip/libsofia-sip-ua/tport/test_tport.c
libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c
libs/sofia-sip/m4/sac-su2.m4

index 87aeee75bbca4d01a7762f1eb5f49760c7dd5dfd..c5829b8a3b3312197820956a1926f5532ac1ef51 100644 (file)
@@ -74,6 +74,10 @@ UPDATE while the call has already been completed has been also changed.
 Bugs fixed in this release
 --------------------------
 
+- Fixed nua failing to refresh publication with re-PUBLISH.
+  Problem reported by Jan van den Bosch.
+- Fixed encoding of c= lines without IN address.
+  Problem reported by Saurav Sahu.
 - Fixed status code sent to network and returned to the client if there was
   an internal error while responding to a request. 
   The problem was reported by Michael Jerris and Joshua Engelbrecht.
index a5fc25a2f04d1d35cb5a888875e3db54eab681f6..17994a3bcd52183a4487152f1b5e5f6829139db2 100644 (file)
@@ -229,7 +229,6 @@ AC_C_KEYWORD_STRUCT
 AC_HEADER_TIME
 AC_TYPE_SIZE_T
 
-AC_STRUCT_SIN6
 AC_SYS_SA_LEN
 
 ### checks for library functions
index 1306f53db03cad625469f4655cf06f4673a8724d..a9bc00d69174c2f3f37bb989da9c19247492b40f 100644 (file)
@@ -71,7 +71,7 @@ TAG_DLL_FLAGS = DLLREF=1
 
 MSG_PARSER_AWK = ${srcdir}/../msg/msg_parser.awk
 
-AWK_HTTP_AWK = ${AWK} -f ${MSG_PARSER_AWK} module=http
+AWK_HTTP_AWK = LC_ALL=C ${AWK} -f ${MSG_PARSER_AWK} module=http
 
 SS_HTTP_H = ${srcdir}/sofia-sip/http.h
 
@@ -79,15 +79,15 @@ ${BUILT_H} ${BUILT_C}: ${srcdir}/sofia-sip/http.h ${MSG_PARSER_AWK}
 
 sofia-sip/http_protos.h: ${srcdir}/sofia-sip/http_protos.h.in 
        @-mkdir sofia-sip 2>/dev/null || true
-       ${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_HTTP_H}
+       ${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/http_protos.h.in ${SS_HTTP_H}
 
 sofia-sip/http_tag.h: ${srcdir}/sofia-sip/http_tag.h.in
        @-mkdir sofia-sip 2>/dev/null || true
-       ${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_HTTP_H}
+       ${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/http_tag.h.in ${SS_HTTP_H}
 
 http_tag.c: ${srcdir}/http_tag.c.in
-       ${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_HTTP_H}
+       ${AWK_HTTP_AWK} PR=$@ TEMPLATE=${srcdir}/http_tag.c.in ${SS_HTTP_H}
 
 http_parser_table.c: ${srcdir}/http_parser_table.c.in
-       ${AWK_HTTP_AWK} PT=$@ TEMPLATE=${srcdir}/$@.in \
+       ${AWK_HTTP_AWK} PT=$@ TEMPLATE=${srcdir}/http_parser_table.c.in \
                MC_HASH_SIZE=127 ${SS_HTTP_H}
index afd569e9fdb2705f2300791a7d68611154f8ce95..2ae4a24d822745a3c30541997ca446c58dca42e6 100644 (file)
 
 /**@file sofia-sip/string0.h
  *
- * @brief String comparison functions accepting NULL pointers
- *
- * This module contains string comparison functions that can be called
- * with NULL pointer as argument.
+ * @brief Extra string function.
  *
+ * String comparison functions accepting NULL pointers: str0cmp(),
+ * str0ncmp(), str0casecmp(), str0ncasecmp(). Also includes span functions
+ * testing at most @a n bytes: strncspn(), strnspn().
  */
 
 #ifndef SU_CONFIG_H
index 25b32ec93814911220c1e048e32d1af95419f59a..14a341bb911fe40c0d457def79483321ae0567df 100644 (file)
@@ -85,7 +85,7 @@ include $(top_srcdir)/rules/sofia.am
 
 MSG_PARSER_AWK = $(srcdir)/msg_parser.awk
 
-AWK_MSG_AWK = $(AWK) -f $(MSG_PARSER_AWK)
+AWK_MSG_AWK = LC_ALL=C $(AWK) -f $(MSG_PARSER_AWK)
 
 ${GENERATED_HC}: ${MSG_PARSER_AWK}
 
@@ -95,12 +95,12 @@ test_protos.h test_table.c: ${TEST_CLASS_H}
 
 test_protos.h: ${srcdir}/test_protos.h.in
        $(AWK_MSG_AWK) module=msg_test NO_MIDDLE=1 NO_LAST=1 \
-               PR=$@ TEMPLATE=$(srcdir)/$@.in ${TEST_CLASS_H}
+               PR=$@ TEMPLATE=${srcdir}/test_protos.h.in ${TEST_CLASS_H}
 
 test_table.c: ${srcdir}/test_table.c.in
        $(AWK_MSG_AWK) module=msg_test prefix=msg \
                MC_HASH_SIZE=127 multipart=msg_multipart \
-               PT=$@ TEMPLATE=$(srcdir)/$@.in ${TEST_CLASS_H}
+               PT=$@ TEMPLATE=${srcdir}/test_table.c.in ${TEST_CLASS_H}
 
 SS_MIME_H = ${srcdir}/sofia-sip/msg_mime.h
 
@@ -110,14 +110,17 @@ msg_mime_table.c: ${SS_MIME_H}
 sofia-sip/msg_protos.h: ${srcdir}/sofia-sip/msg_protos.h.in
        @-mkdir sofia-sip 2>/dev/null || true
        $(AWK_MSG_AWK) module=msg NO_FIRST=1 NO_MIDDLE=1 \
-               PR=$@ TEMPLATE=$(srcdir)/$@.in ${SS_MIME_H}
+               PR=$@ TEMPLATE=${srcdir}/sofia-sip/msg_protos.h.in \
+               ${SS_MIME_H}
 
 sofia-sip/msg_mime_protos.h: ${srcdir}/sofia-sip/msg_mime_protos.h.in
        @-mkdir sofia-sip 2>/dev/null || true
        $(AWK_MSG_AWK) module=msg NO_FIRST=1 NO_LAST=1 \
-               PR=$@ TEMPLATE=$(srcdir)/$@.in ${SS_MIME_H}
+               PR=$@ TEMPLATE=${srcdir}/sofia-sip/msg_mime_protos.h.in \
+               ${SS_MIME_H}
 
 msg_mime_table.c: ${srcdir}/msg_mime_table.c.in
        $(AWK_MSG_AWK) module=msg_multipart \
                tprefix=msg prefix=mp MC_HASH_SIZE=127 \
-               PT=$@ TEMPLATE=$(srcdir)/$@.in ${SS_MIME_H}
+               PT=$@ TEMPLATE=${srcdir}/msg_mime_table.c.in \
+               ${SS_MIME_H}
index 28a6b8a2c17e1e9964fe3b0384916aa1a998a40c..e9648d0ce1863f36b1a92ebb387492292e9a4309 100644 (file)
@@ -201,7 +201,7 @@ function replace (p, hash, name, NAME, comment, Comment, COMMENT, since)
     }
     else {
       # Remove line with #version#
-      gsub(/\n[^\n]*#version#[^\n]*\n/, "\n", p);
+      gsub(/\n[^#\n]*#version#[^\n]*/, "", p);
     }
            
     print p > PR;
index 251236fa084bf79141924d78d3c1a0509cf233e4..44eb4337a8ee4bdd5d8a51cc418ab02d146a86f3 100644 (file)
@@ -236,6 +236,9 @@ static int nua_publish_client_init(nua_client_request_t *cr,
 static int nua_publish_client_request(nua_client_request_t *cr,
                                      msg_t *, sip_t *,
                                      tagi_t const *tags);
+static int nua_publish_client_check_restart(nua_client_request_t *cr,
+                                           int status, char const *phrase,
+                                           sip_t const *sip);
 static int nua_publish_client_response(nua_client_request_t *cr,
                                       int status, char const *phrase,
                                       sip_t const *sip);
@@ -251,7 +254,7 @@ static nua_client_methods_t const nua_publish_client_methods = {
   nua_publish_client_template,
   nua_publish_client_init,
   nua_publish_client_request,
-  /* nua_publish_client_check_restart */ NULL,
+  nua_publish_client_check_restart,
   nua_publish_client_response,
   /* nua_publish_client_preliminary */ NULL
 };
@@ -348,6 +351,34 @@ int nua_publish_client_request(nua_client_request_t *cr,
                                  TAG_NEXT(tags));
 }
 
+static int nua_publish_client_check_restart(nua_client_request_t *cr,
+                                           int status, char const *phrase,
+                                           sip_t const *sip)
+{
+  char const *restarting = NULL;
+
+  if (cr->cr_terminating || !cr->cr_usage)
+    ;
+  else if (status == 412)
+    restarting = phrase;
+  else if (200 <= status && status < 300 && 
+          sip->sip_expires && sip->sip_expires->ex_delta == 0)
+    restarting = "Immediate re-PUBLISH";
+
+  if (restarting) {
+    struct publish_usage *pu = nua_dialog_usage_private(cr->cr_usage);
+
+    if (pu) {
+      pu->pu_published = 0;
+      su_free(cr->cr_owner->nh_home, pu->pu_etag), pu->pu_etag = NULL;
+      if (nua_client_restart(cr, 100, restarting))
+       return 0;
+    }
+  }
+
+  return nua_base_client_check_restart(cr, status, phrase, sip);
+}
+
 static int nua_publish_client_response(nua_client_request_t *cr,
                                       int status, char const *phrase,
                                       sip_t const *sip)
@@ -364,15 +395,7 @@ static int nua_publish_client_response(nua_client_request_t *cr,
     if (pu->pu_etag)
       su_free(nh->nh_home, pu->pu_etag), pu->pu_etag = NULL;
 
-    if (status == 412) {
-      if (nua_client_restart(cr, 100, phrase))
-       return 0;
-    }
-    else if (status < 300) {
-      if (ex && ex->ex_delta == 0 &&
-         nua_client_restart(cr, 100, "Trying re-PUBLISH"))
-       return 0;
-
+    if (status < 300) {
       pu->pu_published = 1;
       pu->pu_etag = sip_etag_dup(nh->nh_home, sip->sip_etag);
 
@@ -384,6 +407,8 @@ static int nua_publish_client_response(nua_client_request_t *cr,
        else
          SET_STATUS1(NUA_INTERNAL_ERROR);
       }
+      else
+       nua_dialog_usage_set_refresh(du, ex->ex_delta);
     }
   }
 
index d5ea676c92679320c6e72b452c4ba38997673e5a..4a6d2876527ef50f0d540437d953d27e2bdac195 100644 (file)
@@ -763,6 +763,10 @@ int test_unregister(struct context *ctx)
     run_c_until(ctx, -1, save_until_final_response);
     TEST_1(e = c->events->head);
     TEST_E(e->data->e_event, nua_r_unregister);
+    if (e->data->e_status == 100) {
+      TEST_1(e = e->next);
+      TEST_E(e->data->e_event, nua_r_unregister);
+    }
     TEST(e->data->e_status, 200);
     TEST_1(sip = sip_object(e->data->e_msg));
     TEST_1(!sip->sip_contact);
index 41f84b671186bdc6df8f5433d6c7fca4f215ca34..700ba9dcd3fae5ba6799b0cf11990037e068d107 100644 (file)
@@ -243,6 +243,8 @@ int accept_request(CONDITION_PARAMS)
   return 0;
 }
 
+char const *test_etag = "tagtag";
+
 int respond_with_etag(CONDITION_PARAMS)
 {
   msg_t *with = nua_current_request(nua);
@@ -256,18 +258,18 @@ int respond_with_etag(CONDITION_PARAMS)
     char const *etag;
   case nua_i_publish:
     etag = sip->sip_if_match ? sip->sip_if_match->g_value : NULL;
-    if (sip->sip_if_match && (etag == NULL || strcmp(etag, "tagtag"))) {
+    if (sip->sip_if_match && (etag == NULL || strcmp(etag, test_etag))) {
       RESPOND(ep, call, nh, SIP_412_PRECONDITION_FAILED,
              NUTAG_WITH(with),
              TAG_END());
     } 
     else {
-       RESPOND(ep, call, nh, SIP_200_OK,
-               NUTAG_WITH(with),
-               SIPTAG_ETAG_STR("tagtag"),
-               SIPTAG_EXPIRES_STR("3600"),
-               SIPTAG_EXPIRES(sip->sip_expires),       /* overrides 3600 */
-               TAG_END());
+      RESPOND(ep, call, nh, SIP_200_OK,
+             NUTAG_WITH(with),
+             SIPTAG_ETAG_STR(test_etag),
+             SIPTAG_EXPIRES_STR("3600"),
+             SIPTAG_EXPIRES(sip->sip_expires), /* overrides 3600 */
+             TAG_END());
     }
     return 1;
   default:
@@ -398,6 +400,7 @@ int test_publish(struct context *ctx)
          SIPTAG_EVENT_STR("presence"),
          SIPTAG_CONTENT_TYPE_STR("text/urllist"),
          SIPTAG_PAYLOAD_STR("sip:example.com\n"),
+         SIPTAG_EXPIRES_STR("5"),
          TAG_END());
 
   run_ab_until(ctx, -1, save_until_final_response, -1, respond_with_etag);
@@ -409,7 +412,7 @@ int test_publish(struct context *ctx)
   TEST(e->data->e_status, 200);
   TEST_1(sip = sip_object(e->data->e_msg));
   TEST_1(sip->sip_etag);
-  TEST_S(sip->sip_etag->g_string, "tagtag");
+  TEST_S(sip->sip_etag->g_string, test_etag);
   TEST_1(!e->next);
 
   /*
@@ -424,6 +427,41 @@ int test_publish(struct context *ctx)
   free_events_in_list(ctx, b->events);
   nua_handle_destroy(b_call->nh), b_call->nh = NULL;
 
+  if (!ctx->expensive && 0)
+    goto skip_republish;
+
+  run_ab_until(ctx, -1, save_until_final_response, -1, respond_with_etag); 
+
+  /* Client events: nua_r_publish
+  */
+  TEST_1(e = a->events->head); TEST_E(e->data->e_event, nua_r_publish);
+  TEST(e->data->e_status, 200);
+  TEST_1(sip = sip_object(e->data->e_msg));
+  TEST_1(sip->sip_etag);
+  TEST_S(sip->sip_etag->g_string, test_etag);
+  TEST_1(!e->next);
+
+  free_events_in_list(ctx, a->events);
+  /*
+   Server events:
+   nua_i_publish
+  */
+  TEST_1(e = b->events->head); TEST_E(e->data->e_event, nua_i_publish);
+  TEST(e->data->e_status, 100);
+  TEST_1(sip = sip_object(e->data->e_msg));
+  TEST_1(sip = sip_object(e->data->e_msg));
+  TEST_1(sip->sip_if_match);
+  TEST_S(sip->sip_if_match->g_string, "tagtag");
+  TEST_1(!sip->sip_content_type);
+  TEST_1(!sip->sip_payload);
+  TEST_1(!e->next);
+
+  free_events_in_list(ctx, b->events);
+  nua_handle_destroy(b_call->nh), b_call->nh = NULL;
+
+ skip_republish:
+
   UNPUBLISH(a, a_call, a_call->nh, TAG_END());
 
   run_ab_until(ctx, -1, save_until_final_response, -1, respond_with_etag);
index dbdf4ff8cf086083d3e4eb31c05f63dc8ddc49ae..e4bb915f7b77cf9d7e839366bd50454e0a3e96c9 100644 (file)
@@ -405,7 +405,13 @@ static void print_connection2(sdp_printer_t *p, sdp_connection_t const *c)
     return;
   }
 
-  sdp_printf(p, "%s%s%s", nettype, addrtype, c->c_address);
+  if (nettype && addrtype)
+    sdp_printf(p, "%s%s%s", nettype, addrtype, c->c_address);
+  else if (nettype)
+    sdp_printf(p, "%s%s%s", nettype, c->c_address);
+  else
+    sdp_printf(p, "%s", c->c_address);
+    
   if (c->c_mcast || c->c_ttl) {
     sdp_printf(p, "/%u", c->c_ttl);
     if (c->c_groups > 1)
index 53bec31325b4eeea8014f9c80d6856c4083f401b..224a14524d4abb492b1cbacf431aea88c4844add 100644 (file)
@@ -474,7 +474,7 @@ static char const pint_msg[] =
   "o=- 2353687640 2353687640 IN IP4 128.3.4.5\r\n"
   "s=marketing\r\n"
   "e=john.jones.3@chinet.net\r\n"
-  "c= TN RFC2543  +1-201-406-4090\r\n"
+  "c=TN RFC2543 +1-201-406-4090\r\n"
   "t=2353687640 0\r\n"
   "m=audio 1 voice -\r\n"
   ;
@@ -496,6 +496,8 @@ static int test_pint(void)
   su_home_t *home = su_home_create();
   sdp_parser_t *parser;
   sdp_session_t *sdp;
+  sdp_printer_t *printer;
+  char const *m;
 
   BEGIN();
 
@@ -504,6 +506,11 @@ static int test_pint(void)
   TEST_1((parser = sdp_parse(home, pint_msg, sizeof(pint_msg) - 1, sdp_f_anynet)));
   TEST_1((sdp = sdp_session(parser)));
 
+  TEST_1((printer = sdp_print(home, sdp, NULL, -1, 0)));
+  TEST_1((m = sdp_message(printer)));
+  TEST_S(m, pint_msg);
+  TEST(sdp_message_size(printer), sizeof(pint_msg) - 1);
+
   TEST_1((parser = sdp_parse(home, pint_torture_msg, sizeof(pint_torture_msg) - 1,
                             sdp_f_anynet)));
   TEST_1((sdp = sdp_session(parser)));
index bd75d83888e90e6f4215fe205709d66c8b5a13cc..8b1702e24c9767013d9beac7daa640679eab27f1 100644 (file)
@@ -106,7 +106,7 @@ include $(top_srcdir)/rules/sofia.am
 
 MSG_PARSER_AWK = $(srcdir)/../msg/msg_parser.awk
 
-AWK_SIP_AWK = $(AWK) -f $(MSG_PARSER_AWK) module=sip
+AWK_SIP_AWK = LC_ALL=C $(AWK) -f $(MSG_PARSER_AWK) module=sip
 
 SS_SIP_H = ${srcdir}/sofia-sip/sip.h
 
@@ -116,23 +116,27 @@ ${GENERATED_H} ${GENERATED_C}: ${SS_SIP_H} ${MSG_PARSER_AWK}
 
 sofia-sip/sip_hclasses.h: ${srcdir}/sofia-sip/sip_hclasses.h.in
        @-mkdir sofia-sip 2>/dev/null || true
-       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_SIP_H}
+       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/sip_hclasses.h.in \
+               ${SS_SIP_H}
 
 sofia-sip/sip_protos.h: ${srcdir}/sofia-sip/sip_protos.h.in
        @-mkdir sofia-sip 2>/dev/null || true
-       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_SIP_H}
+       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/sip_protos.h.in \
+                ${SS_SIP_H}
 
 sofia-sip/sip_tag.h: ${srcdir}/sofia-sip/sip_tag.h.in
        @-mkdir sofia-sip 2>/dev/null || true
-       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_SIP_H}
+       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/sip_tag.h.in \
+               ${SS_SIP_H}
 
 sip_tag.c: ${srcdir}/sip_tag.c.in ${EXTRA}
-       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/$@.in ${SS_SIP_H} ${EXTRA}
+       ${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sip_tag.c.in \
+               ${SS_SIP_H} ${EXTRA}
 
 # Note: sip_bad_mask is used by nta to weed out bad messages
 
 sip_parser_table.c: ${srcdir}/sip_parser_table.c.in ${EXTRA} sip_bad_mask
-       ${AWK_SIP_AWK} PT=$@ TEMPLATE=${srcdir}/$@.in \
+       ${AWK_SIP_AWK} PT=$@ TEMPLATE=${srcdir}/sip_parser_table.c.in \
                FLAGFILE=${srcdir}/sip_bad_mask \
                MC_HASH_SIZE=127 MC_SHORT_SIZE=26 \
                ${SS_SIP_H} ${EXTRA}
@@ -144,4 +148,4 @@ sofia-sip/sip_extra.h: ${srcdir}/sofia-sip/sip_extra.h.in ${EXTRA}
                PACKAGE_VERSION="${PACKAGE_VERSION}" \
                TEMPLATE1=${srcdir}/sofia-sip/sip_hclasses.h.in \
                TEMPLATE2=${srcdir}/sofia-sip/sip_protos.h.in \
-               TEMPLATE=${srcdir}/$@.in ${EXTRA}
+               TEMPLATE=${srcdir}/sofia-sip/sip_extra.h.in ${EXTRA}
index e2950047db65c5efcaf42c407bb0d238795c8911..7cbc5356031f3637d2c696a98869f3b775111eee 100644 (file)
@@ -773,13 +773,15 @@ static int udp_test(tp_test_t *tt)
 
 static int tcp_test(tp_test_t *tt)
 {
+  BEGIN();
+
+#ifndef WIN32                  /* Windows seems to be buffering too much */
+
   msg_t *msg = NULL;
   int i;
   tport_t *tp, *tp0;
   char ident[16];
 
-  BEGIN();
-
   /* Create a large message, just to force queueing in sending end */
   TEST(new_test_msg(tt, &msg, "tcp-0", 1, 16 * 64 * 1024), 0);
   test_create_md5(tt, msg);
@@ -856,6 +858,8 @@ static int tcp_test(tp_test_t *tt)
 
   tport_decref(&tp0);
 
+#endif
+
   END();
 }
 
index a5c3b540b992b8aa1bc9cbe8c1c670e02d80697d..b73363caf1e2bb7cc6ea3dbedcd0feab35cccb70 100644 (file)
@@ -266,10 +266,6 @@ int tport_recv_dgram(tport_t *self)
   msg = self->tp_msg;
 
   ai = msg_addrinfo(msg);
-
-  if (!ai)
-         return -1;
-
   from = (su_sockaddr_t *)ai->ai_addr, fromlen = (socklen_t)(ai->ai_addrlen);
 
   n = su_vrecv(self->tp_socket, iovec, veclen, 0, from, &fromlen);
index f6eb7a6352b8ebda4ba2b71fb81bfaa3311af0fa..4ae3393f149d648a4b9e29ba606364b7e7bfe776 100644 (file)
@@ -196,13 +196,18 @@ if test "$ac_cv_sa_len" = yes ;then
                [Define to 1 if you have sa_len in struct sockaddr])
 fi
 
-AC_REQUIRE([AC_STRUCT_SIN6])
+AC_ARG_ENABLE([ip6],
+[  --disable-ip6          disable IPv6 functionality [[enabled]]],,enable_ip6=yes)
+
+if ! test no$enable_ip6 = nono ; then
+AC_STRUCT_SIN6
 case $ac_cv_sin6 in 
 yes) SAC_SU_DEFINE(SU_HAVE_IN6, 1, [
        Define to 1 if you have struct sockaddr_in6]) ;;
  no) ;;
   *) AC_MSG_ERROR([Inconsistent struct sockaddr_sin6 test]) ;;
 esac
+fi
 
 AC_CHECK_HEADERS([unistd.h sys/time.h])