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

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

?? qmail-send.c

?? linux下qmail的源碼 本人加了一些注釋
?? C
?? 第 1 頁 / 共 3 頁
字號:
   substdio_fdbuf(&pass[c].ss,read,pass[c].fd,pass[c].buf,sizeof(pass[c].buf));   pass[c].j = job_open(pe.id,c);   jo[pass[c].j].retry = nextretry(birth,c);   jo[pass[c].j].flagdying = (recent > birth + lifetime);   while (!stralloc_copy(&jo[pass[c].j].sender,&line)) nomem();  } if (!del_avail(c)) return; if (getln(&pass[c].ss,&line,&match,'\0') == -1)  {   fnmake_chanaddr(pass[c].id,c);   log3("warning: trouble reading ",fn.s,"; will try again later\n");   close(pass[c].fd);   job_close(pass[c].j);   pass[c].id = 0;   return;  } if (!match)  {   close(pass[c].fd);   jo[pass[c].j].flaghiteof = 1;   job_close(pass[c].j);   pass[c].id = 0;   return;  } switch(line.s[0])  {   case 'T':     ++jo[pass[c].j].numtodo;     del_start(pass[c].j,pass[c].mpos,line.s + 1);     break;   case 'D':     break;   default:     fnmake_chanaddr(pass[c].id,c);     log3("warning: unknown record type in ",fn.s,"!\n");     close(pass[c].fd);     job_close(pass[c].j);     pass[c].id = 0;     return;  } pass[c].mpos += line.len; return; trouble: log3("warning: trouble opening ",fn.s,"; will try again later\n"); pe.dt = recent + SLEEP_SYSFAIL; while (!prioq_insert(&pqchan[c],&pe)) nomem();}void messdone(id)unsigned long id;{ char ch; int c; struct prioq_elt pe; struct stat st; for (c = 0;c < CHANNELS;++c)  {   fnmake_chanaddr(id,c);   if (stat(fn.s,&st) == 0) return; /* false alarm; consequence of HOPEFULLY */   if (errno != error_noent)    {     log3("warning: unable to stat ",fn.s,"; will try again later\n");     goto fail;    }  } fnmake_todo(id); if (stat(fn.s,&st) == 0) return; if (errno != error_noent)  {   log3("warning: unable to stat ",fn.s,"; will try again later\n");   goto fail;  }  fnmake_info(id); if (stat(fn.s,&st) == -1)  {   if (errno == error_noent) return;   log3("warning: unable to stat ",fn.s,"; will try again later\n");   goto fail;  }  /* -todo +info -local -remote ?bounce */ if (!injectbounce(id))   goto fail; /* injectbounce() produced error message */ strnum3[fmt_ulong(strnum3,id)] = 0; log3("end msg ",strnum3,"\n"); /* -todo +info -local -remote -bounce */ fnmake_info(id); if (unlink(fn.s) == -1)  {   log3("warning: unable to unlink ",fn.s,"; will try again later\n");   goto fail;  } /* -todo -info -local -remote -bounce; we can relax */ fnmake_foop(id); if (substdio_putflush(&sstoqc,fn.s,fn.len) == -1) { cleandied(); return; } if (substdio_get(&ssfromqc,&ch,1) != 1) { cleandied(); return; } if (ch != '+')   log3("warning: qmail-clean unable to clean up ",fn.s,"\n"); return; fail: pe.id = id; pe.dt = now() + SLEEP_SYSFAIL; while (!prioq_insert(&pqdone,&pe)) nomem();}void pass_do(){ int c; struct prioq_elt pe; for (c = 0;c < CHANNELS;++c) pass_dochan(c); if (prioq_min(&pqfail,&pe))   if (pe.dt <= recent)    {     prioq_delmin(&pqfail);     pqadd(pe.id);    } if (prioq_min(&pqdone,&pe))   if (pe.dt <= recent)    {     prioq_delmin(&pqdone);     messdone(pe.id);    }}/* this file is too long ---------------------------------------------- TODO */datetime_sec nexttodorun;DIR *tododir; /* if 0, have to opendir again */stralloc todoline = {0};char todobuf[SUBSTDIO_INSIZE];char todobufinfo[512];char todobufchan[CHANNELS][1024];void todo_init(){ tododir = 0; nexttodorun = now(); trigger_set();}void todo_selprep(nfds,rfds,wakeup)int *nfds;fd_set *rfds;datetime_sec *wakeup;{ if (flagexitasap) return; trigger_selprep(nfds,rfds); if (tododir) *wakeup = 0; if (*wakeup > nexttodorun) *wakeup = nexttodorun;}void todo_do(rfds)fd_set *rfds;{ struct stat st; substdio ss; int fd; substdio ssinfo; int fdinfo; substdio sschan[CHANNELS]; int fdchan[CHANNELS]; int flagchan[CHANNELS]; struct prioq_elt pe; char ch; int match; unsigned long id; unsigned int len; direntry *d; int c; unsigned long uid; unsigned long pid; fd = -1; fdinfo = -1; for (c = 0;c < CHANNELS;++c) fdchan[c] = -1; if (flagexitasap) return; if (!tododir)  {   if (!trigger_pulled(rfds))     if (recent < nexttodorun)       return;   trigger_set();   tododir = opendir("todo");   if (!tododir)    {     pausedir("todo");     return;    }   nexttodorun = recent + SLEEP_TODO;  } d = readdir(tododir); if (!d)  {   closedir(tododir);   tododir = 0;   return;  } if (str_equal(d->d_name,".")) return; if (str_equal(d->d_name,"..")) return; len = scan_ulong(d->d_name,&id); if (!len || d->d_name[len]) return; fnmake_todo(id); fd = open_read(fn.s); if (fd == -1) { log3("warning: unable to open ",fn.s,"\n"); return; } fnmake_mess(id); /* just for the statistics */ if (stat(fn.s,&st) == -1)  { log3("warning: unable to stat ",fn.s,"\n"); goto fail; } for (c = 0;c < CHANNELS;++c)  {   fnmake_chanaddr(id,c);   if (unlink(fn.s) == -1) if (errno != error_noent)    { log3("warning: unable to unlink ",fn.s,"\n"); goto fail; }  } fnmake_info(id); if (unlink(fn.s) == -1) if (errno != error_noent)  { log3("warning: unable to unlink ",fn.s,"\n"); goto fail; } fdinfo = open_excl(fn.s); if (fdinfo == -1)  { log3("warning: unable to create ",fn.s,"\n"); goto fail; } strnum3[fmt_ulong(strnum3,id)] = 0; log3("new msg ",strnum3,"\n"); for (c = 0;c < CHANNELS;++c) flagchan[c] = 0; substdio_fdbuf(&ss,read,fd,todobuf,sizeof(todobuf)); substdio_fdbuf(&ssinfo,write,fdinfo,todobufinfo,sizeof(todobufinfo)); uid = 0; pid = 0; for (;;)  {   if (getln(&ss,&todoline,&match,'\0') == -1)    {     /* perhaps we're out of memory, perhaps an I/O error */     fnmake_todo(id);     log3("warning: trouble reading ",fn.s,"\n"); goto fail;    }   if (!match) break;   switch(todoline.s[0])    {     case 'u':       scan_ulong(todoline.s + 1,&uid);       break;     case 'p':       scan_ulong(todoline.s + 1,&pid);       break;     case 'F':       if (substdio_putflush(&ssinfo,todoline.s,todoline.len) == -1)	{	 fnmake_info(id);         log3("warning: trouble writing to ",fn.s,"\n"); goto fail;	}       log2("info msg ",strnum3);       strnum2[fmt_ulong(strnum2,(unsigned long) st.st_size)] = 0;       log2(": bytes ",strnum2);       log1(" from <"); logsafe(todoline.s + 1);       strnum2[fmt_ulong(strnum2,pid)] = 0;       log2("> qp ",strnum2);       strnum2[fmt_ulong(strnum2,uid)] = 0;       log2(" uid ",strnum2);       log1("\n");       break;     case 'T':       switch(rewrite(todoline.s + 1))	{	 case 0: nomem(); goto fail;	 case 2: c = 1; break;	 default: c = 0; break;        }       if (fdchan[c] == -1)	{	 fnmake_chanaddr(id,c);	 fdchan[c] = open_excl(fn.s);	 if (fdchan[c] == -1)          { log3("warning: unable to create ",fn.s,"\n"); goto fail; }	 substdio_fdbuf(&sschan[c]	   ,write,fdchan[c],todobufchan[c],sizeof(todobufchan[c]));	 flagchan[c] = 1;	}       if (substdio_bput(&sschan[c],rwline.s,rwline.len) == -1)        {	 fnmake_chanaddr(id,c);         log3("warning: trouble writing to ",fn.s,"\n"); goto fail;        }       break;     default:       fnmake_todo(id);       log3("warning: unknown record type in ",fn.s,"\n"); goto fail;    }  } close(fd); fd = -1; fnmake_info(id); if (substdio_flush(&ssinfo) == -1)  { log3("warning: trouble writing to ",fn.s,"\n"); goto fail; } if (fsync(fdinfo) == -1)  { log3("warning: trouble fsyncing ",fn.s,"\n"); goto fail; } close(fdinfo); fdinfo = -1; for (c = 0;c < CHANNELS;++c)   if (fdchan[c] != -1)    {     fnmake_chanaddr(id,c);     if (substdio_flush(&sschan[c]) == -1)      { log3("warning: trouble writing to ",fn.s,"\n"); goto fail; }     if (fsync(fdchan[c]) == -1)      { log3("warning: trouble fsyncing ",fn.s,"\n"); goto fail; }     close(fdchan[c]); fdchan[c] = -1;    } fnmake_todo(id); if (substdio_putflush(&sstoqc,fn.s,fn.len) == -1) { cleandied(); return; } if (substdio_get(&ssfromqc,&ch,1) != 1) { cleandied(); return; } if (ch != '+')  {   log3("warning: qmail-clean unable to clean up ",fn.s,"\n");   return;  } pe.id = id; pe.dt = now(); for (c = 0;c < CHANNELS;++c)   if (flagchan[c])     while (!prioq_insert(&pqchan[c],&pe)) nomem(); for (c = 0;c < CHANNELS;++c) if (flagchan[c]) break; if (c == CHANNELS)   while (!prioq_insert(&pqdone,&pe)) nomem(); return; fail: if (fd != -1) close(fd); if (fdinfo != -1) close(fdinfo); for (c = 0;c < CHANNELS;++c)   if (fdchan[c] != -1) close(fdchan[c]);}/* this file is too long ---------------------------------------------- MAIN */int getcontrols() { if (control_init() == -1) return 0;

 //讀入queuelifetime,queuelifetime用來指定一個郵件在隊列中的最大存活時間,默認是
 //604800秒,當一個郵件達到這個時間線后,qmail將最后一次嘗試發送這封郵件,如果依然
 //失敗,會將其從隊列中刪除 if (control_readint(&lifetime,"control/queuelifetime") == -1) return 0;

 //讀入concurrencylocal,concurrencylocal用來決定qmail可以同時運行的本地投遞進程的數目,默認值是10,
 //標準安裝的qmail最大可設值是120.安裝的時候可以通過修改conf-spawn來將其變為255以下
 //任何數目。 if (control_readint(&concurrency[0],"control/concurrencylocal") == -1) return 0;

 //讀入concurrencyremote,concurrencyremote用來決定可以同時運行的遠程投遞進程的數目,
 //默認值是20,就是說,qmail可以在同一時間內同時發送20封郵件。 if (control_readint(&concurrency[1],"control/concurrencyremote") == -1) return 0; if (control_rldef(&envnoathost,"control/envnoathost",1,"envnoathost") != 1) return 0; if (control_rldef(&bouncefrom,"control/bouncefrom",0,"MAILER-DAEMON") != 1) return 0; if (control_rldef(&bouncehost,"control/bouncehost",1,"bouncehost") != 1) return 0; if (control_rldef(&doublebouncehost,"control/doublebouncehost",1,"doublebouncehost") != 1) return 0; if (control_rldef(&doublebounceto,"control/doublebounceto",0,"postmaster") != 1) return 0; if (!stralloc_cats(&doublebounceto,"@")) return 0; if (!stralloc_cat(&doublebounceto,&doublebouncehost)) return 0; if (!stralloc_0(&doublebounceto)) return 0; if (control_readfile(&locals,"control/locals",1) != 1) return 0; if (!constmap_init(&maplocals,locals.s,locals.len,0)) return 0; switch(control_readfile(&percenthack,"control/percenthack",0))  {   case -1: return 0;   case 0: if (!constmap_init(&mappercenthack,"",0,0)) return 0; break;   case 1: if (!constmap_init(&mappercenthack,percenthack.s,percenthack.len,0)) return 0; break;  }
 //讀入virtualdomains,virtualdomains讓qmail接受本地郵件以外,還接受virtualdomains
 //指定的域或者郵件地址,就是常說的虛擬域支持 switch(control_readfile(&vdoms,"control/virtualdomains",0))  {   case -1: return 0;   case 0: if (!constmap_init(&mapvdoms,"",0,1)) return 0; break;   case 1: if (!constmap_init(&mapvdoms,vdoms.s,vdoms.len,1)) return 0; break;  } return 1; }stralloc newlocals = {0};stralloc newvdoms = {0};void regetcontrols(){ int r; if (control_readfile(&newlocals,"control/locals",1) != 1)  { log1("alert: unable to reread control/locals\n"); return; } r = control_readfile(&newvdoms,"control/virtualdomains",0); if (r == -1)  { log1("alert: unable to reread control/virtualdomains\n"); return; } constmap_free(&maplocals); constmap_free(&mapvdoms); while (!stralloc_copy(&locals,&newlocals)) nomem(); while (!constmap_init(&maplocals,locals.s,locals.len,0)) nomem(); if (r)  {   while (!stralloc_copy(&vdoms,&newvdoms)) nomem();   while (!constmap_init(&mapvdoms,vdoms.s,vdoms.len,1)) nomem();  } else   while (!constmap_init(&mapvdoms,"",0,1)) nomem();}void reread(){ if (chdir(auto_qmail) == -1)  {   log1("alert: unable to reread controls: unable to switch to home directory\n");   return;  } regetcontrols(); while (chdir("queue") == -1)  {   log1("alert: unable to switch back to queue directory; HELP! sleeping...\n");   sleep(10);  }}void main(){ int fd; datetime_sec wakeup; fd_set rfds; fd_set wfds; int nfds; struct timeval tv; int c; if (chdir(auto_qmail) == -1)  { log1("alert: cannot start: unable to switch to home directory\n"); _exit(111); } if (!getcontrols())  { log1("alert: cannot start: unable to read controls\n"); _exit(111); } if (chdir("queue") == -1)  { log1("alert: cannot start: unable to switch to queue directory\n"); _exit(111); } sig_pipeignore(); sig_termcatch(sigterm); sig_alarmcatch(sigalrm); sig_hangupcatch(sighup); sig_childdefault(); umask(077); fd = open_write("lock/sendmutex"); if (fd == -1)  { log1("alert: cannot start: unable to open mutex\n"); _exit(111); } if (lock_exnb(fd) == -1)  { log1("alert: cannot start: qmail-send is already running\n"); _exit(111); } numjobs = 0; for (c = 0;c < CHANNELS;++c)  {   char ch;   int u;   int r;   do     r = read(chanfdin[c],&ch,1);   while ((r == -1) && (errno == error_intr));   if (r < 1)    { log1("alert: cannot start: hath the daemon spawn no fire?\n"); _exit(111); }   u = (unsigned int) (unsigned char) ch;   if (concurrency[c] > u) concurrency[c] = u;   numjobs += concurrency[c];  } fnmake_init(); comm_init(); pqstart(); job_init(); del_init(); pass_init(); todo_init(); cleanup_init(); while (!flagexitasap || !del_canexit())  {   recent = now();   if (flagrunasap) { flagrunasap = 0; pqrun(); }   if (flagreadasap) { flagreadasap = 0; reread(); }   wakeup = recent + SLEEP_FOREVER;   FD_ZERO(&rfds);   FD_ZERO(&wfds);   nfds = 1;   comm_selprep(&nfds,&wfds);   del_selprep(&nfds,&rfds);   pass_selprep(&wakeup);   todo_selprep(&nfds,&rfds,&wakeup);   cleanup_selprep(&wakeup);   if (wakeup <= recent) tv.tv_sec = 0;   else tv.tv_sec = wakeup - recent + SLEEP_FUZZ;   tv.tv_usec = 0;   if (select(nfds,&rfds,&wfds,(fd_set *) 0,&tv) == -1)     if (errno == error_intr)       ;     else       log1("warning: trouble in select\n");   else    {     recent = now();     comm_do(&wfds);     del_do(&rfds);     todo_do(&rfds);     pass_do();     cleanup_do();    }  } pqfinish(); log1("status: exiting\n"); _exit(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜av电影| 国产精品中文字幕日韩精品| 91亚洲国产成人精品一区二三| 久久综合色婷婷| 91色在线porny| 亚洲自拍偷拍欧美| 99re这里只有精品视频首页| 亚洲欧美激情插| 欧美一级高清片| 亚洲va欧美va国产va天堂影院| 欧美日韩国产片| 国产一区二区精品久久99| 久久久影视传媒| 一本到一区二区三区| 久久99国产精品尤物| 亚洲日本丝袜连裤袜办公室| 欧美日韩国产精选| 色诱视频网站一区| 国产乱人伦精品一区二区在线观看| 亚洲色欲色欲www| 久久综合狠狠综合| 欧美高清hd18日本| 在线观看欧美精品| av日韩在线网站| 激情六月婷婷久久| 蜜桃免费网站一区二区三区| 亚洲一区二区三区不卡国产欧美| 久久久久久久精| 精品福利在线导航| 日韩一区国产二区欧美三区| 色偷偷一区二区三区| 不卡视频在线观看| 成人高清免费在线播放| 国产99久久久国产精品免费看| 日韩av在线发布| 国产一区高清在线| 成人毛片视频在线观看| 白白色亚洲国产精品| 99久久伊人精品| 99久久婷婷国产综合精品| 99在线精品观看| 91国产精品成人| 欧美一级日韩免费不卡| 欧美精品乱码久久久久久按摩| 欧美视频在线不卡| 欧美一区午夜视频在线观看| 精品国产一区二区亚洲人成毛片| 91精品国产91久久综合桃花| 91精品福利在线一区二区三区| 精品国产伦一区二区三区观看体验 | 婷婷综合另类小说色区| 另类小说视频一区二区| 国产成人免费av在线| 欧美最猛黑人xxxxx猛交| 欧美一区二区日韩| 一区二区中文视频| 青青青伊人色综合久久| 粉嫩aⅴ一区二区三区四区| 欧美性生活久久| 中文字幕欧美国产| 日韩va欧美va亚洲va久久| 91视频在线观看| 国产亚洲精品久| 久久99在线观看| 欧美一区二区福利视频| 亚洲一区在线观看免费 | 亚洲成人精品在线观看| 成人永久免费视频| 精品成人在线观看| 日本亚洲视频在线| 欧美一区二区三区四区在线观看| 中文字幕一区二区三区av| 国产一区二区三区四区五区入口 | 中文字幕乱码一区二区免费| 日本最新不卡在线| 69堂精品视频| 男人操女人的视频在线观看欧美 | 欧美一区二区高清| 奇米精品一区二区三区在线观看| 91欧美激情一区二区三区成人| 中文字幕精品—区二区四季| 国产精品亚洲午夜一区二区三区| 26uuu精品一区二区三区四区在线| 日韩精品一二三| 精品剧情在线观看| 国产精品888| 日韩理论电影院| 欧美日韩另类国产亚洲欧美一级| 一区二区三区高清| 26uuu精品一区二区| 大尺度一区二区| 免费看日韩精品| 亚洲欧美怡红院| 欧美日韩精品专区| 成人精品国产免费网站| 亚洲一区在线播放| 欧美国产丝袜视频| 91麻豆精品国产91久久久更新时间| 韩国成人精品a∨在线观看| 国产精品视频第一区| 欧美日韩久久一区二区| 91色.com| 国产成人精品三级| 蜜桃久久av一区| 五月综合激情日本mⅴ| 久久精品在这里| 在线成人av网站| 日本高清无吗v一区| 国产传媒久久文化传媒| 日韩国产高清在线| 亚洲国产日韩a在线播放| 国产精品免费aⅴ片在线观看| 日韩午夜在线观看| 欧美一级免费观看| 欧美日本一区二区在线观看| 丁香激情综合国产| 99精品桃花视频在线观看| 精品污污网站免费看| 亚洲国产中文字幕| 国产精品久久久久永久免费观看| 7777精品伊人久久久大香线蕉最新版| 91麻豆产精品久久久久久| 国产99久久久国产精品潘金网站| 久久99久久久久久久久久久| 亚洲123区在线观看| 免费在线一区观看| 国产在线一区观看| 不卡一区二区三区四区| 91麻豆自制传媒国产之光| 91视频国产资源| 91黄视频在线| 欧美r级电影在线观看| 国产色91在线| 亚洲在线视频网站| 久久成人免费网| 91蝌蚪国产九色| 91精品国产综合久久精品图片| 久久久天堂av| 亚洲精品免费电影| 韩国成人精品a∨在线观看| 99精品欧美一区二区三区小说| 欧美三级日韩三级国产三级| 久久久久久久精| 另类小说色综合网站| 日本久久一区二区三区| 久久先锋影音av鲁色资源网| 最近日韩中文字幕| 成人丝袜视频网| 欧美一区二区福利在线| 亚洲一区二区三区精品在线| 国产99久久久精品| 精品久久人人做人人爽| 午夜精品视频在线观看| 91在线视频免费91| 久久久美女毛片| 久久99精品久久久久| 日韩亚洲国产中文字幕欧美| 亚洲成人一区二区| 在线播放/欧美激情| 日韩不卡一二三区| 91精品国产色综合久久不卡电影 | 欧美亚洲丝袜传媒另类| 亚洲成a人v欧美综合天堂下载 | 精品美女一区二区三区| 日韩精品91亚洲二区在线观看| 欧美久久久久久久久| 亚洲国产精品视频| 日韩视频一区二区三区在线播放| 亚洲综合丝袜美腿| 制服丝袜av成人在线看| 精品一区二区精品| 国产精品久久777777| 91影视在线播放| 亚洲高清中文字幕| 欧美va亚洲va香蕉在线| 成人午夜又粗又硬又大| 亚洲精品第一国产综合野| 欧美怡红院视频| 蜜臀精品久久久久久蜜臀| 国产女人水真多18毛片18精品视频| 成人做爰69片免费看网站| 亚洲国产视频a| 国产精品青草综合久久久久99| 91浏览器在线视频| 国产原创一区二区三区| 丝袜亚洲精品中文字幕一区| 欧美电视剧免费观看| 91麻豆免费看| 成人激情av网| 粉嫩13p一区二区三区| 免费一区二区视频| 国产成人免费视频一区| 亚洲欧美韩国综合色| 日本一区二区三级电影在线观看| 欧美亚洲尤物久久| 91国偷自产一区二区三区成为亚洲经典 | 国产在线日韩欧美| 天天色综合天天| 久久精品国产亚洲高清剧情介绍 | 日本一区二区三区国色天香 |