X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/blobdiff_plain/d8d81d1b049836f7d4fae7b0077a8ce9e2fc43ac..741f7410ed5c67e4a2641925bd22eb71c85a39cf:/ident.pyx diff --git a/ident.pyx b/ident.pyx index 8f143ec..7ea6b45 100644 --- a/ident.pyx +++ b/ident.pyx @@ -1,29 +1,27 @@ -# -*-pyrex-*- -# -# $Id$ -# -# Ident client -# -# (c) 2005 Straylight/Edgeware -# +### -*-pyrex-*- +### +### Ident client +### +### (c) 2005 Straylight/Edgeware +### -#----- Licensing notice ----------------------------------------------------- -# -# This file is part of the Python interface to mLib. -# -# mLib/Python is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# mLib/Python 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with mLib/Python; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the Python interface to mLib. +### +### mLib/Python is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### mLib/Python 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 General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with mLib/Python; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import socket @@ -52,14 +50,14 @@ cdef class SelIdentify: cdef _error cdef _failed cdef _bogus - def __new__(me, sk, + def __cinit__(me, sk, userproc = None, bogusproc = None, badproc = None, errorproc = None, failedproc = None, *hunoz, **hukairz): cdef sockaddr_in s_in, s_out - cdef size_t sz_in, sz_out + cdef socklen_t sz_in, sz_out cdef int fd - if PyObject_TypeCheck(sk, socket.SocketType): + if typecheck(sk, socket.SocketType): fd = sk.fileno() sz_in = PSIZEOF(&s_in) sz_out = PSIZEOF(&s_out) @@ -168,4 +166,4 @@ cdef void _identfunc(ident_reply *i, void *arg): elif i.type == IDENT_USERID: id.user(i.u.userid.os, i.u.userid.user) -#----- That's all, folks ---------------------------------------------------- +###----- That's all, folks --------------------------------------------------