Lines Matching refs:sd
223 readln(int sd, char * resbuf, int * resbuflen, int * resbufpos) in readln() argument
242 len = recv(sd, resbuf + *resbuflen, BUFSIZ - *resbuflen, 0); in readln()
255 copybytes(int sd, int fd, off_t copylen, char * resbuf, int * resbuflen, in copybytes() argument
276 len = recv(sd, resbuf, BUFSIZ, 0); in copybytes()
313 int sd = -1; /* Socket descriptor */ in main() local
359 for (; sd == -1; res = res->ai_next) { in main()
365 sd = socket(res->ai_family, res->ai_socktype, in main()
367 if (sd == -1) in main()
371 setsockopt(sd, SOL_SOCKET, SO_SNDTIMEO, in main()
373 setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, in main()
378 setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, in main()
382 if(connect(sd, res->ai_addr, res->ai_addrlen)) { in main()
383 close(sd); in main()
384 sd = -1; in main()
397 sdflags = fcntl(sd, F_GETFL); in main()
398 if (fcntl(sd, F_SETFL, sdflags | O_NONBLOCK) == -1) in main()
414 len = send(sd, reqbuf + reqbufpos, in main()
434 if (fcntl(sd, F_SETFL, sdflags) == -1) in main()
441 len = send(sd, reqbuf + reqbufpos, in main()
459 error = readln(sd, resbuf, &resbuflen, &resbufpos); in main()
611 error = readln(sd, resbuf, &resbuflen, in main()
633 error = copybytes(sd, fd, clen, resbuf, in main()
642 error = readln(sd, resbuf, &resbuflen, in main()
651 error = copybytes(sd, fd, contentlength, resbuf, in main()
661 error = copybytes(sd, fd, OFF_MAX, resbuf, in main()
710 shutdown(sd, SHUT_RDWR); in main()
711 close(sd); in main()
712 sd = -1; in main()