Fix up offline mode for pcaprun

git-svn-id: file:///home/svn/framework3/trunk@6210 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
root 2009-02-10 15:54:52 +00:00
parent 705a34dfda
commit 345a816394
1 changed files with 7 additions and 6 deletions

View File

@ -288,12 +288,13 @@ rbpcap_next(VALUE self)
while(! (ret = pcap_dispatch(rbp->pd, 1, (pcap_handler) rbpcap_handler, (u_char *)&job))) {
if(rbp->type == OFFLINE) break;
printf("type = %d and ret = %d\n", rbp->type, ret);
rb_thread_schedule();
}
TRAP_END;
if(rbp->type = OFFLINE && ret <= 0) return Qnil;
if(rbp->type == OFFLINE && ret <= 0) return Qnil;
if(job.hdr.caplen > 0)
return rb_str_new(job.pkt, job.hdr.caplen);