... | ... |
@@ -1,30 +1,35 @@ |
1 |
-1.2.0: |
|
2 |
- - log format change. add "[error]" for error log |
|
3 |
- - latency improvement. |
|
4 |
- - fix: terminate process when file close error. |
|
5 |
- |
|
6 |
-1.1.3: |
|
1 |
+1.2.0: 2009/5/25 |
|
2 |
+ - Improved response. |
|
3 |
+ - Added "[error]" to error logging messages. |
|
4 |
+ - Added detailed status message in the event of member timeout. |
|
5 |
+ - The msync's status option message now includes the command line of current process. |
|
6 |
+ - Fixed abnormal behavior when multiple msyncs are invoked simultaneously. |
|
7 |
+ - Fixed abnormal termination after file close failure. |
|
8 |
+ - Fixed message output when the delete option is used. |
|
9 |
+ - Fixed some minor flaws. |
|
10 |
+ |
|
11 |
+1.1.3: 2009/1/14 |
|
7 | 12 |
- sort msync --members by hostname |
8 | 13 |
- fix: msync failed for FreeBSD and MacOSX |
9 | 14 |
|
10 |
-1.1.2: |
|
15 |
+1.1.2: 2008/12/24 |
|
11 | 16 |
- fix: not send shutdown message |
12 | 17 |
|
13 |
-1.1.1: |
|
18 |
+1.1.1: 2008/12/24 |
|
14 | 19 |
- error message output in detail |
15 | 20 |
|
16 |
-1.1.0: |
|
21 |
+1.1.0: 2008/12/24 |
|
17 | 22 |
- file transfer performance tuning |
18 | 23 |
- remote file delete function for makuosan |
19 | 24 |
- add --delete option for msync |
20 | 25 |
- add --sync option for msync |
21 | 26 |
|
22 |
-1.0.1: |
|
27 |
+1.0.1: 2008/11/12 |
|
23 | 28 |
- add spec file (support/makuosan.spec) |
24 | 29 |
- add init script (support/makuosan.sysv) |
25 | 30 |
- support for FreeBSD & MacOSX |
26 | 31 |
|
27 |
-1.0.0: |
|
32 |
+1.0.0: 2008/11/6 |
|
28 | 33 |
- stable release |
29 | 34 |
- change default value -f option. 1 to 3 |
30 | 35 |
- fixed group missmatch |
... | ... |
@@ -1,27 +1,32 @@ |
1 | 1 |
1.2.0: 2009/5/25 |
2 |
+ - 応答速度が向上した |
|
2 | 3 |
- エラーログに"[error]"という文字列を追加 |
3 |
- - 転送中にメンバがタイムアウトしたときに状況を詳細に出力するようにした |
|
4 |
- - msyncのstatusオプションで、実行中のコマンドも表示するようにした |
|
4 |
+ - 転送中にメンバがタイムアウトしたときの状況を詳細に出力するようにした |
|
5 |
+ - msync --statusで、現在実行中のコマンドも表示するようにした |
|
5 | 6 |
- msyncを複数同時実行したときに挙動がおかしくなる不具合を修正 |
6 | 7 |
- ファイルクローズが失敗したときに異常終了する不具合を修正 |
7 | 8 |
- msyncにdeleteオプションを指定したときの結果表示がおかしくなる不具合を修正 |
8 | 9 |
- その他細かい不具合を修正 |
9 | 10 |
|
10 | 11 |
1.1.3: 2009/1/14 |
11 |
- - FreeBSDから msync -r ができなかった不具合を修正 |
|
12 |
+ - FreeBSDで msync -r ができなかった不具合を修正 |
|
12 | 13 |
- msync --membersの結果をソートするようにした |
13 | 14 |
|
14 | 15 |
1.1.2: 2008/12/24 |
15 | 16 |
- 終了時にシャットダウンメッセージを飛ばしていなかった不具合を修正 |
16 | 17 |
|
17 | 18 |
1.1.1: 2008/12/24 |
18 |
- - msyncコマンドに--deleteオプションを追加 |
|
19 |
- - 転送速度が向上(当社比1.5倍) |
|
20 | 19 |
- エラーを詳細に表示するようにした |
21 | 20 |
|
21 |
+1.1.0: 2008/12/24 |
|
22 |
+ - msyncコマンドにdeleteオプションを追加 |
|
23 |
+ - msyncコマンドにsyncオプションを追加 |
|
24 |
+ - 転送速度が向上(当社比1.5倍) |
|
25 |
+ |
|
22 | 26 |
1.0.1: 2008/11/12 |
23 | 27 |
- FreeBSDとMacOSXに対応 |
24 | 28 |
- SPECファイルと起動スクリプトを同梱 |
25 | 29 |
|
26 | 30 |
1.0.0: 2008/11/6 |
27 | 31 |
- 安定版リリース |
32 |
+ |
... | ... |
@@ -10,6 +10,7 @@ mfile *mfreeobj = NULL; |
10 | 10 |
mhost *members = NULL; |
11 | 11 |
int loop_flag = 1; |
12 | 12 |
struct timeval curtime; |
13 |
+struct timeval lastpong; |
|
13 | 14 |
BF_KEY EncKey; |
14 | 15 |
|
15 | 16 |
int md5sum(int fd, unsigned char *digest) |
... | ... |
@@ -31,7 +32,7 @@ int md5sum(int fd, unsigned char *digest) |
31 | 31 |
/* |
32 | 32 |
* タイムアウト時間が経過しているかどうかを判断する |
33 | 33 |
* - 現在時刻がtfからmsec[ms]経過していれば1を返す |
34 |
- * - それ以外は0を返す |
|
34 |
+ * - 経過していなければ0を返す |
|
35 | 35 |
*/ |
36 | 36 |
int mtimeout(struct timeval *tf, uint32_t msec) |
37 | 37 |
{ |
... | ... |
@@ -579,7 +580,7 @@ int ack_check(mfile *m, int state) |
579 | 579 |
if(!m->sendto){ |
580 | 580 |
s = get_hoststate(t,m); |
581 | 581 |
if(!s){ |
582 |
- lprintf(0,"%s: can't get state area host=%s fn=%s\n", |
|
582 |
+ lprintf(0,"[error] %s: can't get state area host=%s fn=%s\n", |
|
583 | 583 |
__func__, t->hostname, m->fn); |
584 | 584 |
}else{ |
585 | 585 |
if(*s == state){ |
... | ... |
@@ -590,7 +591,7 @@ int ack_check(mfile *m, int state) |
590 | 590 |
if(!memcmp(&(m->addr.sin_addr), &(t->ad), sizeof(m->addr.sin_addr))){ |
591 | 591 |
s = get_hoststate(t,m); |
592 | 592 |
if(!s){ |
593 |
- lprintf(0,"%s: can't get state area host=%s fn=%s\n", |
|
593 |
+ lprintf(0,"[error] %s: can't get state area host=%s fn=%s\n", |
|
594 | 594 |
__func__, t->hostname, m->fn); |
595 | 595 |
}else{ |
596 | 596 |
if(*s == state){ |
... | ... |
@@ -24,30 +24,16 @@ void recv_timeout(mfile *m) |
24 | 24 |
m->retrycnt = MAKUO_SEND_RETRYCNT; |
25 | 25 |
} |
26 | 26 |
|
27 |
-struct timeval *pingpong(int n) |
|
27 |
+void pingpong(int n) |
|
28 | 28 |
{ |
29 |
- static struct timeval tv; |
|
30 | 29 |
mfile *m = mfins(MFSEND); |
31 | 30 |
mping *p = NULL; |
32 | 31 |
char buff[MAKUO_HOSTNAME_MAX + 1]; |
33 | 32 |
|
34 |
- gettimeofday(&tv, NULL); |
|
35 | 33 |
if(!m){ |
36 |
- lprintf(0, "%s: out of memmory\r\n", __func__); |
|
37 |
- return(&tv); |
|
34 |
+ lprintf(0, "[error] %s: out of memmory\r\n", __func__); |
|
35 |
+ return; |
|
38 | 36 |
} |
39 |
- switch(n){ |
|
40 |
- case 0: |
|
41 |
- m->mdata.head.opcode = MAKUO_OP_PING; |
|
42 |
- break; |
|
43 |
- case 1: |
|
44 |
- m->mdata.head.opcode = MAKUO_OP_PING; |
|
45 |
- m->mdata.head.flags |= MAKUO_FLAG_ACK; |
|
46 |
- break; |
|
47 |
- case 2: |
|
48 |
- m->mdata.head.opcode = MAKUO_OP_EXIT; |
|
49 |
- break; |
|
50 |
- } |
|
51 | 37 |
m->mdata.head.reqid = getrid(); |
52 | 38 |
m->mdata.head.seqno = 0; |
53 | 39 |
m->mdata.head.szdata = 0; |
... | ... |
@@ -66,22 +52,41 @@ struct timeval *pingpong(int n) |
66 | 66 |
m->mdata.p += p->versionlen; |
67 | 67 |
p->hostnamelen = htons(p->hostnamelen); |
68 | 68 |
p->versionlen = htons(p->versionlen); |
69 |
- return(&tv); |
|
69 |
+ gettimeofday(&lastpong, NULL); |
|
70 |
+ switch(n){ |
|
71 |
+ case 0: |
|
72 |
+ m->mdata.head.opcode = MAKUO_OP_PING; |
|
73 |
+ break; |
|
74 |
+ case 1: |
|
75 |
+ m->mdata.head.opcode = MAKUO_OP_PING; |
|
76 |
+ m->mdata.head.flags |= MAKUO_FLAG_ACK; |
|
77 |
+ break; |
|
78 |
+ case 2: |
|
79 |
+ m->mdata.head.opcode = MAKUO_OP_EXIT; |
|
80 |
+ msend(m); |
|
81 |
+ break; |
|
82 |
+ } |
|
70 | 83 |
} |
71 | 84 |
|
72 |
-int mcomm_accept(mcomm *c, fd_set *fds, int s) |
|
85 |
+int mcomm_accept(mcomm *c, fd_set *fds) |
|
73 | 86 |
{ |
74 | 87 |
int i; |
75 |
- if(s == -1) |
|
88 |
+ int s = moption.lisocket; |
|
89 |
+ if(s == -1){ |
|
76 | 90 |
return(0); |
77 |
- if(!FD_ISSET(s,fds)) |
|
91 |
+ } |
|
92 |
+ if(!FD_ISSET(s,fds)){ |
|
78 | 93 |
return(0); |
79 |
- for(i=0;i<MAX_COMM;i++) |
|
80 |
- if(c[i].fd[0] == -1) |
|
94 |
+ } |
|
95 |
+ for(i=0;i<MAX_COMM;i++){ |
|
96 |
+ if(c[i].fd[0] == -1){ |
|
81 | 97 |
break; |
98 |
+ } |
|
99 |
+ } |
|
82 | 100 |
if(i==MAX_COMM){ |
83 | 101 |
close(accept(s, NULL, 0)); |
84 |
- return(0); |
|
102 |
+ lprintf(0, "[error] %s: can't accept reached in the maximum\n"); |
|
103 |
+ return(1); |
|
85 | 104 |
} |
86 | 105 |
c[i].addrlen = sizeof(c[i].addr); |
87 | 106 |
c[i].fd[0] = accept(s, (struct sockaddr *)(&c[i].addr), &(c[i].addrlen)); |
... | ... |
@@ -122,22 +127,25 @@ int mcomm_read(mcomm *c, fd_set *fds){ |
122 | 122 |
return(0); |
123 | 123 |
} |
124 | 124 |
|
125 |
-int mcomm_fdset(mcomm *c, fd_set *fds) |
|
125 |
+int mcomm_fdset(mcomm *c, fd_set *rfds, fd_set *wfds) |
|
126 | 126 |
{ |
127 | 127 |
int i; |
128 | 128 |
|
129 | 129 |
/*----- listen socket -----*/ |
130 | 130 |
if(moption.lisocket != -1){ |
131 |
- FD_SET(moption.lisocket, fds); |
|
131 |
+ FD_SET(moption.lisocket, rfds); |
|
132 | 132 |
} |
133 | 133 |
|
134 | 134 |
/*----- connect socket -----*/ |
135 | 135 |
for(i=0;i<MAX_COMM;i++){ |
136 | 136 |
if(c[i].fd[0] != -1){ |
137 |
- FD_SET(c[i].fd[0], fds); |
|
137 |
+ FD_SET(c[i].fd[0], rfds); |
|
138 |
+ if(c[i].working){ |
|
139 |
+ FD_SET(c[i].fd[0], wfds); |
|
140 |
+ } |
|
138 | 141 |
} |
139 | 142 |
if(c[i].fd[1] != -1){ |
140 |
- FD_SET(c[i].fd[1], fds); |
|
143 |
+ FD_SET(c[i].fd[1], rfds); |
|
141 | 144 |
}else{ |
142 | 145 |
if(c[i].cpid){ |
143 | 146 |
if(waitpid(c[i].cpid, NULL, WNOHANG) == c[i].cpid){ |
... | ... |
@@ -180,9 +188,8 @@ int mfdirchk(mfile *d){ |
180 | 180 |
return(1); |
181 | 181 |
} |
182 | 182 |
|
183 |
-int ismsend(mfile *m, int flag) |
|
183 |
+int is_send(mfile *m) |
|
184 | 184 |
{ |
185 |
- int r; |
|
186 | 185 |
if(!m){ |
187 | 186 |
return(0); |
188 | 187 |
} |
... | ... |
@@ -190,108 +197,126 @@ int ismsend(mfile *m, int flag) |
190 | 190 |
return(0); |
191 | 191 |
} |
192 | 192 |
if(m->mdata.head.flags & MAKUO_FLAG_ACK){ |
193 |
- if(flag){ |
|
194 |
- msend(m); |
|
195 |
- return(0); |
|
196 |
- } |
|
197 | 193 |
return(1); |
198 | 194 |
} |
199 |
- if(!S_ISLNK(m->fs.st_mode) && S_ISDIR(m->fs.st_mode)){ |
|
200 |
- if(!mfdirchk(m)){ |
|
201 |
- return(0); |
|
202 |
- } |
|
203 |
- } |
|
204 |
- r = ack_check(m, MAKUO_RECVSTATE_NONE); |
|
205 |
- if(r == -1){ |
|
206 |
- m->mdata.head.seqno = 0; |
|
207 |
- m->mdata.head.nstate = MAKUO_SENDSTATE_BREAK; |
|
195 |
+ switch(m->mdata.head.opcode){ |
|
196 |
+ case MAKUO_OP_SEND: |
|
197 |
+ case MAKUO_OP_DEL: |
|
198 |
+ if(!S_ISLNK(m->fs.st_mode) && S_ISDIR(m->fs.st_mode)){ |
|
199 |
+ if(!mfdirchk(m)){ |
|
200 |
+ return(0); |
|
201 |
+ } |
|
202 |
+ } |
|
203 |
+ break; |
|
208 | 204 |
} |
209 |
- if(!r){ |
|
205 |
+ if(!ack_check(m, MAKUO_RECVSTATE_NONE)){ |
|
210 | 206 |
m->sendwait = 0; |
211 | 207 |
} |
212 | 208 |
if(m->sendwait){ |
213 | 209 |
if(!mtimeout(&(m->lastsend), MAKUO_SEND_TIMEOUT)){ |
214 |
- return(1); |
|
210 |
+ return(0); |
|
215 | 211 |
} |
216 | 212 |
if(!(m->retrycnt)){ |
217 | 213 |
recv_timeout(m); |
218 | 214 |
} |
219 | 215 |
} |
220 |
- if(flag){ |
|
221 |
- msend(m); |
|
222 |
- } |
|
223 | 216 |
return(1); |
224 | 217 |
} |
225 | 218 |
|
226 |
-void mloop() |
|
219 |
+void wfdset(int s, fd_set *fds) |
|
227 | 220 |
{ |
228 |
- int para; |
|
229 |
- mfile *n; |
|
230 | 221 |
mfile *m; |
231 |
- fd_set rfds; |
|
232 |
- fd_set wfds; |
|
233 |
- struct timeval *lastpong; |
|
222 |
+ for(m=mftop[MFSEND];m;m=m->next){ |
|
223 |
+ if(is_send(m)){ |
|
224 |
+ FD_SET(s, fds); |
|
225 |
+ return; |
|
226 |
+ } |
|
227 |
+ } |
|
228 |
+} |
|
229 |
+ |
|
230 |
+int do_select(fd_set *rfds, fd_set *wfds) |
|
231 |
+{ |
|
234 | 232 |
struct timeval tv; |
233 |
+ tv.tv_sec = 1; |
|
234 |
+ tv.tv_usec = 0; |
|
235 |
+ if(select(1024, rfds, wfds, NULL, &tv) <= 0){ |
|
236 |
+ gettimeofday(&curtime, NULL); |
|
237 |
+ moption.sendready = 0; |
|
238 |
+ mrecv_gc(); |
|
239 |
+ return(-1); |
|
240 |
+ } |
|
241 |
+ gettimeofday(&curtime, NULL); |
|
242 |
+ moption.sendready = FD_ISSET(moption.mcsocket, wfds); |
|
243 |
+ return(0); |
|
244 |
+} |
|
235 | 245 |
|
236 |
- /* multicast ping request */ |
|
237 |
- lastpong = pingpong(0); |
|
246 |
+void do_pong() |
|
247 |
+{ |
|
248 |
+ if(mtimeout(&lastpong, MAKUO_PONG_INTERVAL)){ |
|
249 |
+ pingpong(1); |
|
250 |
+ } |
|
251 |
+} |
|
238 | 252 |
|
239 |
- /* main loop */ |
|
240 |
- while(loop_flag){ |
|
241 |
- gettimeofday(&curtime, NULL); |
|
242 |
- if(mtimeout(lastpong, MAKUO_PONG_INTERVAL)){ |
|
243 |
- lastpong = pingpong(1); |
|
244 |
- } |
|
253 |
+void do_recv() |
|
254 |
+{ |
|
255 |
+ while(mrecv()); |
|
256 |
+} |
|
245 | 257 |
|
246 |
- /* udp packet receive */ |
|
247 |
- while(mrecv()); |
|
258 |
+void do_send() |
|
259 |
+{ |
|
260 |
+ int i=0; |
|
261 |
+ mfile *m; |
|
262 |
+ mfile *n; |
|
248 | 263 |
|
249 |
- /* udp packet send */ |
|
250 |
- para = 0; |
|
251 |
- m = mftop[MFSEND]; |
|
252 |
- while(m){ |
|
253 |
- n = m->next; |
|
254 |
- para += ismsend(m, 1); |
|
255 |
- m = n; |
|
256 |
- if(para == moption.parallel){ |
|
257 |
- break; |
|
264 |
+ for(m=mftop[MFSEND];m;m=n){ |
|
265 |
+ if(i == moption.parallel){ |
|
266 |
+ return; |
|
267 |
+ } |
|
268 |
+ n = m->next; |
|
269 |
+ if(m->mdata.head.flags & MAKUO_FLAG_ACK){ |
|
270 |
+ msend(m); |
|
271 |
+ continue; |
|
272 |
+ } |
|
273 |
+ if(!is_send(m)){ |
|
274 |
+ if(m->sendwait){ |
|
275 |
+ i++; |
|
258 | 276 |
} |
277 |
+ continue; |
|
259 | 278 |
} |
279 |
+ msend(m); |
|
280 |
+ i++; |
|
281 |
+ } |
|
282 |
+} |
|
260 | 283 |
|
261 |
- /* command check */ |
|
262 |
- mcomm_check(moption.comm); |
|
263 |
- |
|
264 |
- /* wait */ |
|
284 |
+void mloop() |
|
285 |
+{ |
|
286 |
+ fd_set rfds; |
|
287 |
+ fd_set wfds; |
|
288 |
+ while(loop_flag){ |
|
265 | 289 |
FD_ZERO(&rfds); |
266 | 290 |
FD_ZERO(&wfds); |
267 |
- FD_SET(moption.mcsocket, &rfds); |
|
268 |
- mcomm_fdset(moption.comm, &rfds); |
|
269 |
- for(m=mftop[MFSEND];m;m=m->next){ |
|
270 |
- if(ismsend(m, 0)){ |
|
271 |
- FD_SET(moption.mcsocket, &wfds); |
|
272 |
- break; |
|
273 |
- } |
|
274 |
- } |
|
275 |
- tv.tv_sec = 1; |
|
276 |
- tv.tv_usec = 0; |
|
277 |
- if(select(1024, &rfds, &wfds, NULL, &tv) == -1){ |
|
278 |
- mrecv_gc(); |
|
291 |
+ FD_SET(moption.mcsocket, &rfds); |
|
292 |
+ wfdset(moption.mcsocket, &wfds); |
|
293 |
+ mcomm_fdset(moption.comm, &rfds, &wfds); |
|
294 |
+ if(do_select(&rfds, &wfds)){ |
|
295 |
+ do_pong(); |
|
279 | 296 |
continue; |
280 | 297 |
} |
281 |
- moption.sendready = FD_ISSET(moption.mcsocket,&wfds); |
|
282 |
- mcomm_accept(moption.comm, &rfds, moption.lisocket); /* new console */ |
|
283 |
- mcomm_read(moption.comm, &rfds); /* command exec */ |
|
298 |
+ do_pong(); |
|
299 |
+ do_recv(); |
|
300 |
+ do_send(); |
|
301 |
+ mcomm_check(moption.comm); /* exec check */ |
|
302 |
+ mcomm_accept(moption.comm, &rfds); /* new console */ |
|
303 |
+ mcomm_read(moption.comm, &rfds); /* command exec */ |
|
284 | 304 |
} |
285 |
- |
|
286 |
- /* shutdown notify */ |
|
287 |
- pingpong(2); |
|
288 |
- msend(mftop[MFSEND]); |
|
289 | 305 |
} |
290 | 306 |
|
291 | 307 |
int main(int argc, char *argv[]) |
292 | 308 |
{ |
293 | 309 |
minit(argc,argv); |
310 |
+ pingpong(0); |
|
294 | 311 |
mloop(); |
312 |
+ pingpong(2); |
|
295 | 313 |
mexit(); |
296 | 314 |
return(0); |
297 | 315 |
} |
... | ... |
@@ -25,7 +25,7 @@ mfile *mexec_with_dsync(mcomm *c, char *fn, int dryrun, int recurs, mhost *t) |
25 | 25 |
{ |
26 | 26 |
mfile *m = mfadd(MFSEND); |
27 | 27 |
if(!m){ |
28 |
- lprintf(0, "%s: out of memorry\n", __func__); |
|
28 |
+ lprintf(0, "[error] %s: out of memorry\n", __func__); |
|
29 | 29 |
cprintf(0, c, "error: out of memorry\n"); |
30 | 30 |
return(m); |
31 | 31 |
} |
... | ... |
@@ -86,8 +86,7 @@ int mexec_scan_cmd(int fd, char *buff) |
86 | 86 |
if(errno == EINTR){ |
87 | 87 |
continue; |
88 | 88 |
} |
89 |
- lprintf(0, "%s: commend write error (%s) %s", |
|
90 |
- __func__, strerror(errno), buff); |
|
89 |
+ lprintf(0, "[error] %s: commend write error (%s) %s", __func__, strerror(errno), buff); |
|
91 | 90 |
return(-1); |
92 | 91 |
} |
93 | 92 |
size -= r; |
... | ... |
@@ -416,7 +415,7 @@ int mexec_send(mcomm *c, int n, int sync) |
416 | 416 |
/*----- send file -----*/ |
417 | 417 |
m = mfadd(MFSEND); |
418 | 418 |
if(!m){ |
419 |
- lprintf(0, "%s: out of memorry\n", __func__); |
|
419 |
+ lprintf(0, "[error] %s: out of memorry\n", __func__); |
|
420 | 420 |
cprintf(0, c, "error: out of memorry\n"); |
421 | 421 |
return(0); |
422 | 422 |
} |
... | ... |
@@ -1000,7 +999,7 @@ int mexec(mcomm *c, int n) |
1000 | 1000 |
if(r>0){ |
1001 | 1001 |
}else{ |
1002 | 1002 |
if(r == -1){ |
1003 |
- lprintf(0, "%s: read error n=%d\n", __func__, n); |
|
1003 |
+ lprintf(0, "[error] %s: read error n=%d\n", __func__, n); |
|
1004 | 1004 |
} |
1005 | 1005 |
mexec_close(c, n); |
1006 | 1006 |
} |
... | ... |
@@ -1008,7 +1007,7 @@ int mexec(mcomm *c, int n) |
1008 | 1008 |
} |
1009 | 1009 |
|
1010 | 1010 |
if(n == 1){ |
1011 |
- for(m=mftop[0];m;m=m->next){ |
|
1011 |
+ for(m=mftop[MFSEND];m;m=m->next){ |
|
1012 | 1012 |
if(m->comm == c){ |
1013 | 1013 |
count++; |
1014 | 1014 |
if(count == MAKUO_PARALLEL_MAX){ |
... | ... |
@@ -1019,7 +1018,7 @@ int mexec(mcomm *c, int n) |
1019 | 1019 |
} |
1020 | 1020 |
|
1021 | 1021 |
if(!size){ |
1022 |
- lprintf(0, "%s: buffer over fllow n=%d\n", __func__, n); |
|
1022 |
+ lprintf(0, "[error] %s: buffer over fllow n=%d\n", __func__, n); |
|
1023 | 1023 |
mexec_close(c, n); |
1024 | 1024 |
return(-1); |
1025 | 1025 |
} |
... | ... |
@@ -1086,6 +1086,7 @@ static void mrecv_req_dsync_open(mfile *m, mdata *data, struct sockaddr_in *addr |
1086 | 1086 |
memcpy(m->fn, data->data, data->head.szdata); |
1087 | 1087 |
} |
1088 | 1088 |
m->fn[data->head.szdata] = 0; |
1089 |
+ mtimeget(&(m->lastrecv)); |
|
1089 | 1090 |
} |
1090 | 1091 |
|
1091 | 1092 |
static void mrecv_req_dsync_data(mfile *m, mdata *data, struct sockaddr_in *addr) |
... | ... |
@@ -1097,6 +1098,11 @@ static void mrecv_req_dsync_data(mfile *m, mdata *data, struct sockaddr_in *addr |
1097 | 1097 |
uint16_t len; |
1098 | 1098 |
|
1099 | 1099 |
msend(mkack(data, addr, MAKUO_RECVSTATE_OPEN)); |
1100 |
+ if(!m){ |
|
1101 |
+ return; |
|
1102 |
+ } |
|
1103 |
+ |
|
1104 |
+ mtimeget(&(m->lastrecv)); |
|
1100 | 1105 |
if(m->mdata.head.seqno >= data->head.seqno){ |
1101 | 1106 |
return; |
1102 | 1107 |
} |
... | ... |
@@ -1162,18 +1168,20 @@ static void mrecv_req_dsync_close(mfile *m, mdata *data, struct sockaddr_in *add |
1162 | 1162 |
{ |
1163 | 1163 |
if(!m){ |
1164 | 1164 |
msend(mkack(data, addr, MAKUO_RECVSTATE_CLOSE)); |
1165 |
- return; |
|
1166 |
- } |
|
1167 |
- if(m->link){ |
|
1168 |
- msend(mkack(data, addr, MAKUO_RECVSTATE_OPEN)); |
|
1169 | 1165 |
}else{ |
1170 |
- msend(mkack(data, addr, MAKUO_RECVSTATE_CLOSE)); |
|
1171 |
- mrecv_mfdel(m); |
|
1166 |
+ mtimeget(&(m->lastrecv)); |
|
1167 |
+ if(m->link){ |
|
1168 |
+ msend(mkack(data, addr, MAKUO_RECVSTATE_OPEN)); |
|
1169 |
+ }else{ |
|
1170 |
+ msend(mkack(data, addr, MAKUO_RECVSTATE_CLOSE)); |
|
1171 |
+ mrecv_mfdel(m); |
|
1172 |
+ } |
|
1172 | 1173 |
} |
1173 | 1174 |
} |
1174 | 1175 |
|
1175 | 1176 |
static void mrecv_req_dsync_break(mfile *m, mdata *data, struct sockaddr_in *addr) |
1176 | 1177 |
{ |
1178 |
+ msend(mkack(data, addr, MAKUO_RECVSTATE_BREAK)); |
|
1177 | 1179 |
if(m){ |
1178 | 1180 |
if(m->link){ |
1179 | 1181 |
m->link->mdata.head.nstate = MAKUO_SENDSTATE_BREAK; |
... | ... |
@@ -1181,7 +1189,6 @@ static void mrecv_req_dsync_break(mfile *m, mdata *data, struct sockaddr_in *add |
1181 | 1181 |
} |
1182 | 1182 |
mrecv_mfdel(m); |
1183 | 1183 |
} |
1184 |
- msend(mkack(data, addr, MAKUO_RECVSTATE_BREAK)); |
|
1185 | 1184 |
} |
1186 | 1185 |
|
1187 | 1186 |
/* |
... | ... |
@@ -807,11 +807,12 @@ static void msend_req_dsync_close(int s, mfile *m) |
807 | 807 |
msend_packet(s, &(m->mdata), &(m->addr)); |
808 | 808 |
return; |
809 | 809 |
} |
810 |
- if(!ack_check(m, MAKUO_RECVSTATE_OPEN)){ |
|
811 |
- msend_mfdel(m); |
|
812 |
- }else{ |
|
810 |
+ if(ack_check(m, MAKUO_RECVSTATE_OPEN)){ |
|
813 | 811 |
m->sendwait = 0; |
814 | 812 |
m->initstate = 1; |
813 |
+ }else{ |
|
814 |
+ msend_packet(s, &(m->mdata), &(m->addr)); |
|
815 |
+ msend_mfdel(m); |
|
815 | 816 |
} |
816 | 817 |
} |
817 | 818 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
Name: makuosan |
2 |
-Version: 1.1.4 |
|
2 |
+Version: 1.2.0 |
|
3 | 3 |
Release: 1%{?dist} |
4 | 4 |
Summary: Multicasts All-Kinds of Updating Operation for Servers on Administered Network |
5 | 5 |
|
... | ... |
@@ -83,7 +83,8 @@ rm -rf %{buildroot} |
83 | 83 |
|
84 | 84 |
|
85 | 85 |
%changelog |
86 |
-* Sat May 16 2009 Masanobu Yasui <yasui0906@gmail.com> - 1.1.4 |
|
86 |
+* Mon May 25 2009 Masanobu Yasui <yasui0906@gmail.com> - 1.2.0 |
|
87 | 87 |
|
88 | 88 |
* Thu Nov 6 2008 Naoya Nakazawa <naoya.n@gmail.com> - 1.0.0 |
89 | 89 |
- Initial version |
90 |
+ |
... | ... |
@@ -188,12 +188,13 @@ void mprintf(int l, const char *func, mfile *m) |
188 | 188 |
{ |
189 | 189 |
if(!m) |
190 | 190 |
return; |
191 |
- lprintf(l, "%s: rc=%d rid=%d init=%d wait=%d %s %s %s %s\n", |
|
191 |
+ lprintf(l, "%s: rc=%d id=%d init=%d wait=%d flag=%d %s %s %s %s\n", |
|
192 | 192 |
func, |
193 | 193 |
m->retrycnt, |
194 | 194 |
m->mdata.head.reqid, |
195 | 195 |
m->initstate, |
196 | 196 |
m->sendwait, |
197 |
+ m->mdata.head.flags, |
|
197 | 198 |
inet_ntoa(m->addr.sin_addr), |
198 | 199 |
stropcode(&(m->mdata)), |
199 | 200 |
strmstate(&(m->mdata)), |