1

我正在尝试从在 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";

}
4

1 回答 1

0

解决了这个问题。问题在于 realtek 驱动程序 r8169,它已损坏并导致内核和接口丢弃数据包。我安装了最新的驱动程序 8168,它解决了这个问题。

于 2013-10-10T18:28:43.677 回答