Lines Matching refs:sd
221 readln(int sd, char * resbuf, int * resbuflen, int * resbufpos) in readln() argument
240 len = recv(sd, resbuf + *resbuflen, BUFSIZ - *resbuflen, 0); in readln()
253 copybytes(int sd, int fd, off_t copylen, char * resbuf, int * resbuflen, in copybytes() argument
274 len = recv(sd, resbuf, BUFSIZ, 0); in copybytes()
311 int sd = -1; /* Socket descriptor */ in main() local
357 for (; sd == -1; res = res->ai_next) { in main()
363 sd = socket(res->ai_family, res->ai_socktype, in main()
365 if (sd == -1) in main()
369 setsockopt(sd, SOL_SOCKET, SO_SNDTIMEO, in main()
371 setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, in main()
376 setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, in main()
380 if(connect(sd, res->ai_addr, res->ai_addrlen)) { in main()
381 close(sd); in main()
382 sd = -1; in main()
395 sdflags = fcntl(sd, F_GETFL); in main()
396 if (fcntl(sd, F_SETFL, sdflags | O_NONBLOCK) == -1) in main()
412 len = send(sd, reqbuf + reqbufpos, in main()
432 if (fcntl(sd, F_SETFL, sdflags) == -1) in main()
439 len = send(sd, reqbuf + reqbufpos, in main()
457 error = readln(sd, resbuf, &resbuflen, &resbufpos); in main()
609 error = readln(sd, resbuf, &resbuflen, in main()
631 error = copybytes(sd, fd, clen, resbuf, in main()
640 error = readln(sd, resbuf, &resbuflen, in main()
649 error = copybytes(sd, fd, contentlength, resbuf, in main()
659 error = copybytes(sd, fd, OFF_MAX, resbuf, in main()
708 shutdown(sd, SHUT_RDWR); in main()
709 close(sd); in main()
710 sd = -1; in main()