Lines Matching refs:sd
220 readln(int sd, char * resbuf, int * resbuflen, int * resbufpos) in readln() argument
239 len = recv(sd, resbuf + *resbuflen, BUFSIZ - *resbuflen, 0); in readln()
252 copybytes(int sd, int fd, off_t copylen, char * resbuf, int * resbuflen, in copybytes() argument
273 len = recv(sd, resbuf, BUFSIZ, 0); in copybytes()
310 int sd = -1; /* Socket descriptor */ in main() local
356 for (; sd == -1; res = res->ai_next) { in main()
362 sd = socket(res->ai_family, res->ai_socktype, in main()
364 if (sd == -1) in main()
368 setsockopt(sd, SOL_SOCKET, SO_SNDTIMEO, in main()
370 setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, in main()
375 setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, in main()
379 if(connect(sd, res->ai_addr, res->ai_addrlen)) { in main()
380 close(sd); in main()
381 sd = -1; in main()
394 sdflags = fcntl(sd, F_GETFL); in main()
395 if (fcntl(sd, F_SETFL, sdflags | O_NONBLOCK) == -1) in main()
411 len = send(sd, reqbuf + reqbufpos, in main()
431 if (fcntl(sd, F_SETFL, sdflags) == -1) in main()
438 len = send(sd, reqbuf + reqbufpos, in main()
456 error = readln(sd, resbuf, &resbuflen, &resbufpos); in main()
608 error = readln(sd, resbuf, &resbuflen, in main()
630 error = copybytes(sd, fd, clen, resbuf, in main()
639 error = readln(sd, resbuf, &resbuflen, in main()
648 error = copybytes(sd, fd, contentlength, resbuf, in main()
658 error = copybytes(sd, fd, OFF_MAX, resbuf, in main()
707 shutdown(sd, SHUT_RDWR); in main()
708 close(sd); in main()
709 sd = -1; in main()