466
467
/* if the host name starts with test, the port number used in the
467
468
CONNECT line will be used as test number! */
468
469
char *portp = strchr(doc, ':');
470
req->testno = atoi(portp+1);
470
if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
471
req->testno = strtol(portp+1, NULL, 10);
472
473
req->testno = DOCNUMBER_CONNECT;
761
762
while(!done_processing && (req->offset < REQBUFSIZ-1)) {
762
763
if(pipereq_length && pipereq) {
763
764
memmove(reqbuf, pipereq, pipereq_length);
764
got = pipereq_length;
765
got = curlx_uztosz(pipereq_length);
765
766
pipereq_length = 0;
1117
1118
int main(int argc, char *argv[])
1119
struct sockaddr_in me;
1121
struct sockaddr_in6 me6;
1122
#endif /* ENABLE_IPV6 */
1120
srvr_sockaddr_union_t me;
1123
1121
curl_socket_t sock = CURL_SOCKET_BAD;
1124
1122
curl_socket_t msgsock = CURL_SOCKET_BAD;
1125
1123
int wrotepidfile = 0;
1260
1258
#ifdef ENABLE_IPV6
1261
1259
if(!use_ipv6) {
1263
memset(&me, 0, sizeof(me));
1264
me.sin_family = AF_INET;
1265
me.sin_addr.s_addr = INADDR_ANY;
1266
me.sin_port = htons(port);
1267
rc = bind(sock, (struct sockaddr *) &me, sizeof(me));
1261
memset(&me.sa4, 0, sizeof(me.sa4));
1262
me.sa4.sin_family = AF_INET;
1263
me.sa4.sin_addr.s_addr = INADDR_ANY;
1264
me.sa4.sin_port = htons(port);
1265
rc = bind(sock, &me.sa, sizeof(me.sa4));
1268
1266
#ifdef ENABLE_IPV6
1271
memset(&me6, 0, sizeof(me6));
1272
me6.sin6_family = AF_INET6;
1273
me6.sin6_addr = in6addr_any;
1274
me6.sin6_port = htons(port);
1275
rc = bind(sock, (struct sockaddr *) &me6, sizeof(me6));
1269
memset(&me.sa6, 0, sizeof(me.sa6));
1270
me.sa6.sin6_family = AF_INET6;
1271
me.sa6.sin6_addr = in6addr_any;
1272
me.sa6.sin6_port = htons(port);
1273
rc = bind(sock, &me.sa, sizeof(me.sa6));
1277
1275
#endif /* ENABLE_IPV6 */