延续或非HTTP流量错误

时间:2013-10-09 14:18:43

标签: perl apache2 cgi wireshark

我正在尝试通过在Ubuntu上运行的apache2.2在LAN网络上发送http文件传输(视频文件)。 在提供文件后,客户端将无响应。 apache2日志显示get请求的响应代码200。 当我查看wireshark报告时,我看到很多“继续或非HTTP流量”。 不知道为什么我收到此错误,有什么方法可以安排数据包或需要在网络层配置? (代理等)? 以下是服务器代码:

#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use File::Copy qw( copy );
use File::Spec::Functions qw( catfile );
use POSIX qw(strftime);
use Time::Local;
use HTTP::Status qw(:constants :is status_message);
use Digest::MD5 qw(md5 md5_hex md5_base64);
use File::Basename;
#use File::Slurp;
use URI;
use utf8;


my $extfile = '/home/suresh/clientrequest.txt';
open(FH, ">>$extfile") or die "Cannot open file";
my $query = CGI->new;
my $stcode = status_message(206);
my $uri =$ENV{'REQUEST_URI'};
my $rdate =strftime("%a, %d %b %Y %H:%M:%S %Z", localtime());
print FH "Client request: ", $ENV{'REQUEST_URI'}, "\n";
my $dir  = '/srv/samba/Assets';
my $nffFile = fileparse ("$uri", qr/\.[^.]*/);
my $fullFname = $nffFile . ".nff";
my $path = catfile($dir, $fullFname);
my $filesize = -s $path;
print FH "Size of the file: ", $filesize, "\n";
print FH "Requested File: ", $fullFname, "\n";
#Search requested asset files
opendir(DIR, $dir);
my @files = readdir(DIR);
if (grep($_=~/$fullFname/,@files)){
    print FH "Found the requested NFF file: ", $fullFname, "\n";

#    open my $fh, '<:raw', $path;
open (FILE, "< $path") or die "cannot open $fullFname\n";

print "$ENV{SERVER_PROTOCOL} 206 $stcode";
print("Content Type: application/octet-stream\n\n");


while (<FILE>) {

        print;
}
sleep(1);
close FILE or die "Cannot close the file";

}

1 个答案:

答案 0 :(得分:0)

解决了这个问题。问题出在realtek驱动程序r8169上,它被破坏并导致内核和接口丢包。我安装8168这是最新的驱动程序,它解决了这个问题。