56
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/local/share/bison.simple"
+#line 3 "/usr/lib/bison.simple"
/* This file comes from bison-1.28. */
/* Skeleton output parser for bison,
#endif
#endif
\f
-#line 217 "/usr/local/share/bison.simple"
+#line 217 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/local/share/bison.simple"
+#line 543 "/usr/lib/bison.simple"
\f
yyvsp -= yylen;
yyssp -= yylen;
free(conn->proto.generic);
#ifdef ENABLE_IPV6
- if(conn->res) /* host name info */
- freeaddrinfo(conn->res);
+ if(conn->hp) /* host name info */
+ freeaddrinfo(conn->hp);
#else
if(conn->hostent_buf) /* host name info */
free(conn->hostent_buf);
conn->hp->h_addr, conn->hp->h_length);
conn->serv_addr.sin_family = conn->hp->h_addrtype;
conn->serv_addr.sin_port = htons(data->port);
+#else
+ /* IPv6-style */
+ struct addrinfo *ai;
#endif
#if !defined(WIN32)||defined(__CYGWIN32__)
* Connect to server/proxy
*************************************************************/
#ifdef ENABLE_IPV6
- data->firstsocket = -1;
- for (ai = conn->res; ai; ai = ai->ai_next) {
- data->firstsocket = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- if (data->firstsocket < 0)
+ conn->firstsocket = -1;
+ for (ai = conn->hp; ai; ai = ai->ai_next) {
+ conn->firstsocket = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ if (conn->firstsocket < 0)
continue;
- if (connect(data->firstsocket, ai->ai_addr, ai->ai_addrlen) < 0) {
- close(data->firstsocket);
- data->firstsocket = -1;
+ if (connect(conn->firstsocket, ai->ai_addr, ai->ai_addrlen) < 0) {
+ close(conn->firstsocket);
+ conn->firstsocket = -1;
continue;
}
break;
}
- if (data->firstsocket < 0) {
+ conn->ai = ai;
+ if (conn->firstsocket < 0) {
failf(data, strerror(errno));
return CURLE_COULDNT_CONNECT;
}
struct sigaction sigact;
#endif
int urllen;
-#ifdef ENABLE_IPV6
- struct addrinfo *ai;
-#endif
/*************************************************************
* Check input data
data->port = data->remote_port; /* it is the same port */
/* Resolve target host right on */
+ if(!conn->hp) {
#ifdef ENABLE_IPV6
- if(!conn->res)
/* it might already be set if reusing a connection */
- conn->res = Curl_getaddrinfo(data, conn->name, data->port);
- if(!conn->res)
+ conn->hp = Curl_getaddrinfo(data, conn->name, data->port);
#else
- if(!conn->hp)
/* it might already be set if reusing a connection */
conn->hp = Curl_gethost(data, conn->name, &conn->hostent_buf);
- if(!conn->hp)
#endif
+ }
+ if(!conn->hp)
{
failf(data, "Couldn't resolve host '%s'", conn->name);
return CURLE_COULDNT_RESOLVE_HOST;
#else
const int niflags = NI_NUMERICHOST;
#endif
+ struct addrinfo *ai = conn->ai;
+
if (getnameinfo(ai->ai_addr, ai->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0,
niflags)) {
snprintf(hbuf, sizeof(hbuf), "?");
if(conn->path)
free(conn->path);
#ifdef ENABLE_IPV6
- if(conn->res)
- freeaddrinfo(conn->res);
+ if(conn->hp)
+ freeaddrinfo(conn->hp);
#else
if(conn->hostent_buf)
free(conn->hostent_buf);