亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rfcnb-io.c

?? 代理服務器 squid-2.6.STABLE16
?? C
字號:
/* UNIX RFCNB (RFC1001/RFC1002) NEtBIOS implementation *  * Version 1.0 * RFCNB IO Routines ... *  * Copyright (C) Richard Sharpe 1996 *  *//* * This program 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. *  * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *//* #include <features.h> */#include "config.h"#include "std-includes.h"#include "rfcnb-priv.h"#include "rfcnb-util.h"#include "rfcnb-io.h"#include <sys/uio.h>#include <sys/signal.h>#include <string.h>int RFCNB_Timeout = 0;		/* Timeout in seconds ... */voidrfcnb_alarm(int sig){    fprintf(stderr, "IO Timed out ...\n");}/* Set timeout value and setup signal handling */intRFCNB_Set_Timeout(int seconds){    /* If we are on a Bezerkeley system, use sigvec, else sigaction */#if HAVE_SIGACTION    struct sigaction inact, outact;#else    struct sigvec invec, outvec;#endif    RFCNB_Timeout = seconds;    if (RFCNB_Timeout > 0) {	/* Set up handler to ignore but not restart */#if HAVE_SIGACTION	inact.sa_handler = (void (*)()) rfcnb_alarm;	sigemptyset(&inact.sa_mask);	inact.sa_flags = 0;	/* Don't restart */	if (sigaction(SIGALRM, &inact, &outact) < 0)	    return (-1);#else	invec.sv_handler = (void (*)()) rfcnb_alarm;	invec.sv_mask = 0;	invec.sv_flags = SV_INTERRUPT;	if (sigvec(SIGALRM, &invec, &outvec) < 0)	    return (-1);#endif    }    return (0);}/* Discard the rest of an incoming packet as we do not have space for it * in the buffer we allocated or were passed ...                         */intRFCNB_Discard_Rest(struct RFCNB_Con *con, int len){    char temp[100];		/* Read into here */    int rest, this_read, bytes_read;    /* len is the amount we should read */#ifdef RFCNB_DEBUG    fprintf(stderr, "Discard_Rest called to discard: %i\n", len);#endif    rest = len;    while (rest > 0) {	this_read = (rest > sizeof(temp) ? sizeof(temp) : rest);	bytes_read = read(con->fd, temp, this_read);	if (bytes_read <= 0) {	/* Error so return */	    if (bytes_read < 0)		RFCNB_errno = RFCNBE_BadRead;	    else		RFCNB_errno = RFCNBE_ConGone;	    RFCNB_saved_errno = errno;	    return (RFCNBE_Bad);	}	rest = rest - bytes_read;    }    return (0);}/* Send an RFCNB packet to the connection. *  * We just send each of the blocks linked together ...  *  * If we can, try to send it as one iovec ...  *  */intRFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len){    int len_sent, tot_sent, this_len;    struct RFCNB_Pkt *pkt_ptr;    char *this_data;    int i;    struct iovec io_list[10];	/* We should never have more      */    /* If we do, this will blow up ... */    /* Try to send the data ... We only send as many bytes as len claims */    /* We should try to stuff it into an IOVEC and send as one write     */    pkt_ptr = pkt;    len_sent = tot_sent = 0;	/* Nothing sent so far */    i = 0;    while ((pkt_ptr != NULL) & (i < 10)) {	/* Watch that magic number! */	this_len = pkt_ptr->len;	this_data = pkt_ptr->data;	if ((tot_sent + this_len) > len)	    this_len = len - tot_sent;	/* Adjust so we don't send too much */	/* Now plug into the iovec ... */	io_list[i].iov_len = this_len;	io_list[i].iov_base = this_data;	i++;	tot_sent += this_len;	if (tot_sent == len)	    break;		/* Let's not send too much */	pkt_ptr = pkt_ptr->next;    }#ifdef RFCNB_DEBUG    fprintf(stderr, "Frags = %i, tot_sent = %i\n", i, tot_sent);#endif    /* Set up an alarm if timeouts are set ... */    if (RFCNB_Timeout > 0)	alarm(RFCNB_Timeout);    if ((len_sent = writev(con->fd, io_list, i)) < 0) {		/* An error */	con->rfc_errno = errno;	if (errno == EINTR)	/* We were interrupted ... */	    RFCNB_errno = RFCNBE_Timeout;	else	    RFCNB_errno = RFCNBE_BadWrite;	RFCNB_saved_errno = errno;	return (RFCNBE_Bad);    }    if (len_sent < tot_sent) {	/* Less than we wanted */	if (errno == EINTR)	/* We were interrupted */	    RFCNB_errno = RFCNBE_Timeout;	else	    RFCNB_errno = RFCNBE_BadWrite;	RFCNB_saved_errno = errno;	return (RFCNBE_Bad);    }    if (RFCNB_Timeout > 0)	alarm(0);		/* Reset that sucker */#ifdef RFCNB_DEBUG    fprintf(stderr, "Len sent = %i ...\n", len_sent);    RFCNB_Print_Pkt(stderr, "sent", pkt, len_sent);	/* Print what send ... */#endif    return (len_sent);}/* Read an RFCNB packet off the connection.  *  * We read the first 4 bytes, that tells us the length, then read the * rest. We should implement a timeout, but we don't just yet  *  */intRFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len){    int read_len, pkt_len;    char hdr[RFCNB_Pkt_Hdr_Len];	/* Local space for the header */    struct RFCNB_Pkt *pkt_frag;    int more, this_time, offset, frag_len, this_len;    BOOL seen_keep_alive = TRUE;    /* Read that header straight into the buffer */    if (len < RFCNB_Pkt_Hdr_Len) {	/* What a bozo */#ifdef RFCNB_DEBUG	fprintf(stderr, "Trying to read less than a packet:");	perror("");#endif	RFCNB_errno = RFCNBE_BadParam;	return (RFCNBE_Bad);    }    /* We discard keep alives here ... */    if (RFCNB_Timeout > 0)	alarm(RFCNB_Timeout);    while (seen_keep_alive) {	if ((read_len = read(con->fd, hdr, sizeof(hdr))) < 0) {		/* Problems */#ifdef RFCNB_DEBUG	    fprintf(stderr, "Reading the packet, we got:");	    perror("");#endif	    if (errno == EINTR)		RFCNB_errno = RFCNBE_Timeout;	    else		RFCNB_errno = RFCNBE_BadRead;	    RFCNB_saved_errno = errno;	    return (RFCNBE_Bad);	}	/* Now we check out what we got */	if (read_len == 0) {	/* Connection closed, send back eof?  */#ifdef RFCNB_DEBUG	    fprintf(stderr, "Connection closed reading\n");#endif	    if (errno == EINTR)		RFCNB_errno = RFCNBE_Timeout;	    else		RFCNB_errno = RFCNBE_ConGone;	    RFCNB_saved_errno = errno;	    return (RFCNBE_Bad);	}	if (RFCNB_Pkt_Type(hdr) == RFCNB_SESSION_KEEP_ALIVE) {#ifdef RFCNB_DEBUG	    fprintf(stderr, "RFCNB KEEP ALIVE received\n");#endif	} else {	    seen_keep_alive = FALSE;	}    }    /* What if we got less than or equal to a hdr size in bytes? */    if (read_len < sizeof(hdr)) {	/* We got a small packet */	/* Now we need to copy the hdr portion we got into the supplied packet */	memcpy(pkt->data, hdr, read_len);	/*Copy data */#ifdef RFCNB_DEBUG	RFCNB_Print_Pkt(stderr, "rcvd", pkt, read_len);#endif	return (read_len);    }    /* Now, if we got at least a hdr size, alloc space for rest, if we need it */    pkt_len = RFCNB_Pkt_Len(hdr);#ifdef RFCNB_DEBUG    fprintf(stderr, "Reading Pkt: Length = %i\n", pkt_len);#endif    /* Now copy in the hdr */    memcpy(pkt->data, hdr, sizeof(hdr));    /* Get the rest of the packet ... first figure out how big our buf is? */    /* And make sure that we handle the fragments properly ... Sure should */    /* use an iovec ...                                                    */    if (len < pkt_len)		/* Only get as much as we have space for */	more = len - RFCNB_Pkt_Hdr_Len;    else	more = pkt_len;    this_time = 0;    /* We read for each fragment ... */    if (pkt->len == read_len) {	/* If this frag was exact size */	pkt_frag = pkt->next;	/* Stick next lot in next frag */	offset = 0;		/* then we start at 0 in next  */    } else {	pkt_frag = pkt;		/* Otherwise use rest of this frag */	offset = RFCNB_Pkt_Hdr_Len;	/* Otherwise skip the header       */    }    frag_len = pkt_frag->len;    if (more <= frag_len)	/* If len left to get less than frag space */	this_len = more;	/* Get the rest ...                        */    else	this_len = frag_len - offset;    while (more > 0) {	if ((this_time = read(con->fd, (pkt_frag->data) + offset, this_len)) <= 0) {	/* Problems */	    if (errno == EINTR) {		RFCNB_errno = RFCNB_Timeout;	    } else {		if (this_time < 0)		    RFCNB_errno = RFCNBE_BadRead;		else		    RFCNB_errno = RFCNBE_ConGone;	    }	    RFCNB_saved_errno = errno;	    return (RFCNBE_Bad);	}#ifdef RFCNB_DEBUG	fprintf(stderr, "Frag_Len = %i, this_time = %i, this_len = %i, more = %i\n", frag_len,	    this_time, this_len, more);#endif	read_len = read_len + this_time;	/* How much have we read ... */	/* Now set up the next part */	if (pkt_frag->next == NULL)	    break;		/* That's it here */	pkt_frag = pkt_frag->next;	this_len = pkt_frag->len;	offset = 0;	more = more - this_time;    }#ifdef RFCNB_DEBUG    fprintf(stderr, "Pkt Len = %i, read_len = %i\n", pkt_len, read_len);    RFCNB_Print_Pkt(stderr, "rcvd", pkt, read_len + sizeof(hdr));#endif    if (read_len < (pkt_len + sizeof(hdr))) {	/* Discard the rest */	return (RFCNB_Discard_Rest(con, (pkt_len + sizeof(hdr)) - read_len));    }    if (RFCNB_Timeout > 0)	alarm(0);		/* Reset that sucker */    return (read_len + sizeof(RFCNB_Hdr));}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月激情综合色| 人人精品人人爱| 欧美r级在线观看| 欧美午夜精品久久久久久超碰 | 欧美一区二区大片| 欧美日韩在线播| 欧美日韩精品一区二区三区| 成人在线综合网| 成人av在线一区二区| 国产一区二区三区在线观看免费| 日韩av高清在线观看| 免费高清成人在线| 国产一区二区在线影院| 精彩视频一区二区三区| 国产不卡视频一区二区三区| av激情成人网| 欧美日韩久久久一区| 日韩一本二本av| 久久精品在线观看| 国产精品成人一区二区艾草| 玉足女爽爽91| 免费久久精品视频| 国产成人精品影视| 在线视频国产一区| 日韩欧美亚洲国产精品字幕久久久| 欧美tickling网站挠脚心| 中文字幕欧美区| 亚洲一级电影视频| 久色婷婷小香蕉久久| 波多野结衣中文一区| 在线观看亚洲精品视频| 欧美一三区三区四区免费在线看 | 亚洲国产日韩精品| 美女视频网站久久| 成人一区二区三区在线观看| 91成人免费在线| 欧美xxx久久| 中文字幕亚洲区| 欧美a一区二区| 国产成人av自拍| 欧美午夜片在线观看| 26uuu久久综合| 亚洲大片在线观看| 成人黄色在线视频| 精品噜噜噜噜久久久久久久久试看| ...av二区三区久久精品| 毛片一区二区三区| 欧美在线播放高清精品| 国产亚洲污的网站| 美女国产一区二区三区| 欧美在线一二三四区| 中文字幕国产精品一区二区| 日韩av一区二区三区四区| jiyouzz国产精品久久| 欧美成人艳星乳罩| 爽好多水快深点欧美视频| av电影在线观看一区| 国产三级一区二区三区| 看电视剧不卡顿的网站| 宅男噜噜噜66一区二区66| 亚洲日本在线看| 国产91色综合久久免费分享| 精品久久久久久久久久久久包黑料 | 日本麻豆一区二区三区视频| 91女人视频在线观看| 国产农村妇女毛片精品久久麻豆| 久久66热偷产精品| 日韩一区二区在线看片| 亚洲成a人v欧美综合天堂下载| 91麻豆免费在线观看| 国产精品成人免费在线| 丁香婷婷综合激情五月色| 国产日韩三级在线| 成人在线视频首页| 国产精品女人毛片| 成人h精品动漫一区二区三区| 久久亚洲综合色一区二区三区| 日本美女一区二区| 精品盗摄一区二区三区| 久久99久久久久久久久久久| 欧美成人艳星乳罩| 狠狠色丁香九九婷婷综合五月| 日韩精品在线一区| 麻豆成人久久精品二区三区红 | 最新中文字幕一区二区三区| 91伊人久久大香线蕉| 亚洲黄色小视频| 在线免费观看一区| 日韩黄色免费电影| 日韩精品一区二区三区四区视频| 韩日av一区二区| 精品国产乱码久久久久久浪潮| 精品一区二区在线播放| 国产女同性恋一区二区| 色中色一区二区| 亚洲成人资源网| 日韩精品在线网站| 成人黄色a**站在线观看| 亚洲欧美日韩精品久久久久| 欧美午夜影院一区| 蜜桃视频一区二区三区在线观看| 日韩精品一区二区三区视频在线观看| 国产一区二区免费看| 国产精品妹子av| 欧美主播一区二区三区| 性欧美疯狂xxxxbbbb| 精品国产91乱码一区二区三区 | 亚洲国产精品成人综合| 色综合 综合色| 精品一区二区三区免费观看| 中文字幕成人网| 欧美一区午夜视频在线观看| 成人精品免费视频| 免费精品视频在线| 亚洲欧美在线另类| 精品久久久影院| 欧美日韩三级在线| 国产91富婆露脸刺激对白| 亚洲成av人片一区二区梦乃| 国产三级久久久| 日韩欧美一区二区不卡| 一本一道综合狠狠老| 国产一区二区精品久久| 亚洲成人你懂的| 亚洲欧洲精品成人久久奇米网 | 成人av网站免费| 美女精品自拍一二三四| 亚洲一卡二卡三卡四卡无卡久久| 国产日韩一级二级三级| 欧美一区二区网站| 欧美视频一区在线观看| gogogo免费视频观看亚洲一| 国产主播一区二区三区| 三级影片在线观看欧美日韩一区二区| 国产精品福利av| 国产日韩精品一区| 久久日一线二线三线suv| 欧美精品久久一区| 欧美伊人久久大香线蕉综合69| 大尺度一区二区| 国产精品一区二区久久精品爱涩| 日韩影视精彩在线| 亚洲成人免费av| 一区二区三区.www| 亚洲色图一区二区| 国产精品国产三级国产aⅴ入口| 精品第一国产综合精品aⅴ| 日韩一二三四区| 精品美女被调教视频大全网站| 欧美人伦禁忌dvd放荡欲情| 在线免费观看日本欧美| 色婷婷综合久色| 在线观看精品一区| 欧美综合久久久| 欧美无砖专区一中文字| 欧美体内she精视频| 欧美伊人久久大香线蕉综合69| 99久久精品情趣| 色诱视频网站一区| 色综合久久99| 91碰在线视频| 欧美亚洲综合在线| 欧美乱熟臀69xxxxxx| 欧美精品日韩综合在线| 日韩三级视频中文字幕| 日韩欧美久久一区| 日韩丝袜美女视频| 久久亚洲春色中文字幕久久久| 精品99一区二区| 国产精品国产三级国产aⅴ原创 | 亚洲精品日韩一| 一区二区三区日韩欧美精品| 亚洲国产综合91精品麻豆 | 日韩欧美国产综合一区| 精品免费99久久| 中文一区一区三区高中清不卡| 国产精品毛片大码女人| 一二三四区精品视频| 三级亚洲高清视频| 国产精品亚洲第一| 91一区二区三区在线观看| 欧美日韩在线播放一区| 26uuu久久天堂性欧美| 综合久久给合久久狠狠狠97色| 亚洲综合区在线| 精久久久久久久久久久| 99国产精品久久久久久久久久久| 91福利精品第一导航| 亚洲精品一区二区三区香蕉| 国产精品久久毛片av大全日韩| 亚洲在线视频一区| 国产在线不卡视频| 色综合久久久久综合99| 日韩一二三四区| 亚洲三级在线观看| 国产一区二区在线观看免费| 色悠久久久久综合欧美99| 日韩女优av电影在线观看| 国产精品福利在线播放| 久久精品国产99|