1/* 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netsmb/smb_trantcp.c 130480 2004-06-14 18:16:22Z rwatson $"); |
35 36#include <sys/param.h> 37#include <sys/condvar.h> 38#include <sys/kernel.h> 39#include <sys/lock.h> 40#include <sys/malloc.h> 41#include <sys/mbuf.h> 42#include <sys/poll.h> --- 366 unchanged lines hidden (view full) --- 409 *mpp = NULL; 410 m = NULL; 411 for(;;) { 412 /* 413 * Poll for a response header. 414 * If we don't have one waiting, return. 415 */ 416 error = nbssn_recvhdr(nbp, &len, &rpcode, MSG_DONTWAIT, td); |
417 if ((so->so_state & (SS_ISDISCONNECTING | SS_ISDISCONNECTED)) || 418 (so->so_rcv.sb_state & SBS_CANTRCVMORE)) { |
419 nbp->nbp_state = NBST_CLOSED; 420 NBDEBUG("session closed by peer\n"); 421 return ECONNRESET; 422 } 423 if (error) 424 return error; 425 if (len == 0 && nbp->nbp_state != NBST_SESSION) 426 break; --- 331 unchanged lines hidden --- |