X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/e569f554343141679f1fd5be90ca174500194fb2..d4efbcd93c940ad522fcf8c601ec1829d2e0b10d:/ident.c diff --git a/ident.c b/ident.c index 5052163..c015331 100644 --- a/ident.c +++ b/ident.c @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: ident.c,v 1.4 2001/06/22 19:35:39 mdw Exp $ + * $Id: ident.c,v 1.6 2004/04/08 01:36:11 mdw Exp $ * * Nonblocking RFC931 client * * (c) 1999 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the mLib utilities library. * @@ -15,35 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * mLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with mLib; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: ident.c,v $ - * Revision 1.4 2001/06/22 19:35:39 mdw - * New @conn_init@ interface. - * - * Revision 1.3 2000/10/08 11:17:45 mdw - * (ident_socket): change sizes to be @size_t@. - * - * Revision 1.2 2000/06/17 10:38:35 mdw - * Track changes to selbuf interface. - * - * Revision 1.1 1999/10/04 21:41:58 mdw - * Added ident client from `fw'. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -165,6 +148,7 @@ static void parse(char *p, ident_reply *i) /* --- @line@ --- * * * Arguments: @char *s@ = pointer to string from ident server + * @size_t len@ = length of the line * @void *p@ = pointer to my request block * * Returns: --- @@ -172,7 +156,7 @@ static void parse(char *p, ident_reply *i) * Use: Handles a string from an ident server. */ -static void line(char *s, void *p) +static void line(char *s, size_t len, void *p) { ident_request *rq = p; @@ -278,7 +262,7 @@ static void go(ident_request *rq) int opt; /* --- Create the socket I'll use --- */ - + if ((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0) goto fail_0; memset(&sin, 0, sizeof(sin)); @@ -331,7 +315,7 @@ fail_0: void ident(ident_request *rq, sel_state *s, const struct sockaddr_in *local, - const struct sockaddr_in *remote, + const struct sockaddr_in *remote, void (*func)(ident_reply */*i*/, void */*p*/), void *p) {